/skills:run-affected-testsfrom skills
Selects and runs only the tests affected by a diff, tracing static imports and widening for dynamic loads, fixtures, and config changes. Speeds up feedback by skipping the full suite.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Running the whole test suite after every edit slows down feedback, while guessing tests by file name misses indirect callers and runtime loads. Trace static dependencies from the diff to test files, widen for blind spots the import graph cannot see, and run only that set with a clear reason why it covers the change.
Find the base commit for the change, such as the merge base with the default branch or the commit range the user names. Collect every added, modified, renamed, and deleted file from that diff, along with staged, unstaged, and relevant untracked edits.
Sort the changed paths into four groups: source files, test files, fixtures or snapshots, and config or environment files. Add every modified test file to the run set right away and record its reason as a direct test edit.
Start from each changed source file and find every file that statically imports or requires it. Follow incoming edges through intermediate modules, re-exports, wildcard exports, and index barrel files until each path reaches a test file or ends with no more callers.
Resolve path aliases, workspace package names, and implicit index files from the project's module config so chains do not stop early at folder or package boundaries. Add each reached test file to the run set and save the import chain from the changed file as its reason. Keep out tests that have no static path or blind-spot link to the change.
Search test files and shared test helpers for links that static import tracing misses:
require calls with computed paths, variables, or string templates that could load a changed file or its barrel.Include every test file that executes a matching dynamic import or loads a matching fixture or snapshot, and mark it as a blind-spot addition. When you cannot narrow a dynamic loader to specific test files, or when config, shared setup, or environment files change, widen the run set to that package's test suite (or the full suite for repository-wide config) and record what triggered the widening.
Run only the selected test files and any widened suites through the project's test runner using explicit file or suite paths. If a failure exposes another affected module, update the set and rerun before finishing.
Show the user four details in the final report:
Based on Copybook original (CC BY 4.0), rewritten by Copybook.
What SKILL.md sets; muted values are Claude Code's defaults
24 skills in this plugin
/add-pre-commit-checksUse when asked to add pre-commit hooks, set up Husky or lint-staged, stop bad commits, or run Prettier and type checks on commit. Sets up a pre-commit hook that formats staged files, type-checks with the project config, and runs related tests, proven by blocked and fast commits. Not for picking a test set for a change (run-affected-tests)./build-throwaway-prototypeUse when asked to prototype, spike, try an idea out quickly, sanity-check a state model or logic, or mock up what a UI should look like. Builds a throwaway prototype that answers one named design question from one command or one HTML file while leaving production code untouched. Not for building a finished production page (design-web-page)./npx claudepluginhub heyvhuang/copybook-skills --plugin skillsOther plugins' skills for the same job