/code:test-coveragefrom code
Raises test coverage by writing tests for the least-covered, most-changed code. Detects coverage tooling, ranks files by churn times uncovered share, and generates tests with strict acceptance checks.
Ships in code. 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.
None: SKILL.md is the whole skill.
Write tests that cover behavior nobody tested, in the code that changes most. Coverage is the measure, not the goal: a test that raises the number without checking behavior is worse than no test, because it hides the gap.
Load code:test-assertions, code:test-data and code:test-speed alongside this skill. New tests follow their shape: strict whole-value assertions, self-evidently fake literals, and extending an existing test file before creating one.
Resolve <plugin-root> first: in Claude Code use ${CLAUDE_PLUGIN_ROOT}; in Codex use the plugin root that contains this skills/test-coverage/SKILL.md file. The scripts below need Python 3.9 or later.
unattended: passed by callers such as burn. An unattended run asks the user nothing. Every question it would have asked becomes a queued finding instead (see Report).Detect the coverage tooling, then run it once and save the normalized report:
python3 <plugin-root>/scripts/coverage_baseline.py --root . detect
python3 <plugin-root>/scripts/coverage_baseline.py --root . run > "$WORKDIR/coverage-before.json"
detect recognizes Vitest, Jest, pytest-cov, Go, cargo tarpaulin, JaCoCo through Maven or Gradle, plus any just coverage recipe that writes coverage/lcov.info, and prints the command it would run. Pass --ecosystem <name> to run to pick one when several are detected. Put $WORKDIR outside the repository so reports are never committed.
When the project uses a tool detect does not know, or needs different flags, run the project's own coverage command and normalize what it writes with coverage_baseline.py parse --format lcov|cobertura|gocover|jacoco <report>.... When the project has no coverage provider at all, add one temporarily, and revert the dependency and lockfile changes before committing. An interactive run asks before adding one; an unattended run queues the question and stops.
The baseline must pass. If the suite fails before any change, stop and report it: this skill never fixes a broken build.
Rank files by churn times the uncovered share:
python3 <plugin-root>/scripts/churn_rank.py "$WORKDIR/coverage-before.json" --root . --paths <scope>...
The script skips generated, vendored, test, trivial and fully covered files, and files with no commits in the window (--since, default one year), and lists each skip with its reason. Work through the targets from the top.
Within a target file, the unit of work is the smallest public function or class that encloses uncovered or partially covered lines, about 50 lines at most. Split a larger unit by its public methods. Show the agent writing the tests that unit's source with its coverage tags, plus the existing test file for it so new tests match its style:
python3 <plugin-root>/scripts/coverage_baseline.py --root . annotate "$WORKDIR/coverage-before.json" <path>
! marks an uncovered line and ~ a line with an untaken branch. Without these hints, models write many more tests and most of them add no coverage.
Test the unit's public behavior: given these inputs, this output or this observable effect. Add new cases to an existing test file that already covers the area; create a test file only when none fits, at the lowest level of the pyramid that proves the behavior.
Never do any of these:
When covering a line would need one of these, skip the target and record why.
Keep a new test only when all of these hold. Check them in this order, and drop the test at the first failure:
coverage_baseline.py compare.Do not rewrite a rejected test and try again. Record the target as skipped with the reason (randomness, I/O, unreachable code, a failed acceptance check) and move on to the next target. Studies of generated tests found that only about a quarter raise coverage, so rejection is the normal case and these checks do real work.
When the targets are done, run the full suite and coverage again, then compare against the baseline:
python3 <plugin-root>/scripts/coverage_baseline.py --root . run > "$WORKDIR/coverage-after.json"
python3 <plugin-root>/scripts/coverage_baseline.py compare "$WORKDIR/coverage-before.json" "$WORKDIR/coverage-after.json"
compare exits 1 when no line or branch gained coverage, or when the total of covered lines dropped. Without a measured gain, the run failed: commit nothing and report why. With a gain, commit the new tests together, following the repository's commit conventions.
Report in the terminal, or return to the caller when unattended:
compare;An unattended run also returns its queued findings as task text the caller can append to .llm/todo.md: whether to add a coverage provider, untested code that looks dead, code that needs a design change before it can be tested, and any other judgment call. Each finding names the file, the symbol and the evidence.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub motlin/claude-code-plugins --plugin code12 skills in this plugin
/build-warningsMake a build quiet by fixing the causes of the warnings it prints, one class at a time, with before and after counts from the same command as evidence. Covers compiler, linter and deprecation warnings, runtime warnings printed during tests, slow-test reports, and stray noise such as debug prints and unsilenced logs. Use when the user asks to clean up build or test warnings, deprecations, or noisy output, or when a caller such as burn runs it unattended./cliCLI guidelines. Use whenever using the Bash tool, which is almost always. Also use when you see "command not found: __zoxide_z" errors./code-generationFormatting rules for Java code generators that build source code via string concatenation. Use when the user asks to "fix formatter-off", "fix code generation formatting", "fix auto-formatted string concatenation", or "add formatter off", and proactively when writing, reviewing, or modifying a code generation method./code-qualityCode quality guidelines. ALWAYS use skill for ANY code changes./dead-codeFind and remove unused code, files, exports and dependencies, with detector output or a zero-reference grep as evidence for every removal, and leave anything uncertain for a human. Use when the user asks to find or delete dead, unused or unreachable code, unused dependencies or exports, for a file, a directory, or the whole repo, or when a caller such as burn runs it unattended./docs-driftFind documentation that disagrees with the code, such as renamed paths, missing recipes, stale versions and outdated behavior claims, apply only mechanical one-to-one fixes, and propose the rest. Use when the user asks to check, audit or fix docs, READMEs, CLAUDE.md, AGENTS.md or SKILL.md files against the code, or to find stale or broken documentation, or when a caller such as burn runs it unattended.Other plugins' skills for the same job