/test-gap-audit:test-gap-auditfrom test-gap-audit
Read-only audit of missing, weak and stale tests for a repo, PR, feature or route. Maps source to tests with a bundled script, ranks gaps P0-P3 by behavior and risk (never coverage percentage) and proposes exact tests. Use for "what tests are missing?", "is this change covered?", "is our test coverage enough?" or "what regression tests does this PR need?". Not for writing a test (unit-testing).
Ships in test-gap-audit. 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; scripts run unread.
Find tests that should exist and tests that exist but prove nothing, then recommend specific ones. Edit nothing unless the user asks you to add the tests afterward.
Not for writing one test (unit-testing), running the suite (test-run), bug hunting (problem-solving), or security review (security-scan, if installed).
Learn the conventions. Read manifests, CI workflows, test config, and a few nearby tests. Note the runner, naming, fixtures, factories, and mocks.
Map source to tests. Run the bundled script from the repo. To scope a monorepo package, pass --repo <package dir> --no-git-root.
python3 ${CLAUDE_SKILL_DIR}/scripts/coverage_map.py --top 25
It lists source files no test matches (risk-keyword paths first), unmatched directories, and test files with cases but few assertions. It is read-only and runs no tests. Add --format json to filter the output yourself. It matches by name, mirrored path, and imports, so it cannot see coverage through fixtures, end-to-end tests, or indirection. Treat each unmatched file as a lead and grep for its module name before calling it a gap. Without the script, compare source areas against test directories by hand.
Read what the tests prove. For each lead and each scoped behavior, open the tests and check the assertions, fixtures, and mocks. Note tests that only call or render code, mock away the behavior they claim to cover, or went stale after the code changed.
List gaps. Look for the following.
Verify cheaply. Prefer checks that write nothing, such as test-list commands, search, and reading. Running tests executes repo code and can leave ignored cache files, so run them only with the user's go-ahead, and say so in the report if you did. Never install dependencies, start long-running services, or run formatters or compileall (which leaves .pyc files that git ignores) in an audit.
| Level | Meaning |
|---|---|
| P0 | No practical safety net for data loss, security or privacy exposure, billing errors, destructive actions, or an outage |
| P1 | Common user paths, authorization, critical API contracts, migrations, background jobs, or release-blocking behavior |
| P2 | Edge cases, validation, error handling, state transitions, integrations, or stale and weak tests |
| P3 | Cleanup, naming drift, fixture polish, redundant tests |
path:line where the line contains the thing you name. Re-read a line before writing its number.Open with the scope, that no code changed, the checks run, and the P0 count. Then list each gap in severity order.
1. **P1: <title>.**
Gap: <behavior or risk not covered>.
Current coverage: <what tests prove, or "none found in <area>">.
Evidence: code `<path>:<line>`; tests `<path>:<line>`.
Confidence: <high/medium/low, for inferred gaps>.
Suggested test: <level, location, scenario, key assertions>.
Close with these sections, omitting any that are empty. Suggested test plan (ordered), existing coverage worth keeping, surveyed but not inspected (full-repo audits only), checks run (command and result), not tested (and why), and assumptions. If you find no meaningful gaps, say so, name the strongest coverage, and list residual risk.
Write the highest-priority gaps first. Match the repo's style, helpers, and file placement, prove behavior with clear assertions, and avoid broad snapshot tests unless snapshots are the local convention. Run the new tests and their closest neighbors, then map each gap to the test that closes it.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin test-gap-audit