/test-audit:test-audit <repo path> [--base origin/dev] [--slices a,b,c]from test-audit
Use when the user asks to audit, prune, slim down or de-theater a test suite, or asks which tests are worth keeping. Delete-by-default audit: slice the suite, plant known-bad calibration tests, gather evidence, run prosecutor/defender/judge per slice, apply deletions one PR per area.
Ships in test-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.
Every test starts as DELETE. It stays only if you can name a realistic bug that only that test catches. Expect heavy cuts: on one large production suite, 5,616 tests were reviewed and about 72 percent of them were ruled delete or merge.
The suite is large, slow or noisy, and the owner wants it smaller without losing real protection. Not for a single flaky test or a one-file cleanup.
df -h), and leave tens of GB. An earlier run filled the host with worktrees and coverage data. Audit in a throwaway worktree pinned to a commit; keep all evidence outside it.audit/planted): a literal equals itself, a JSON round trip of a literal, a stub returning its own value. Put each in the MIDDLE of an existing test file, between two existing tests, in that file's style (naming, helpers, imports, fixtures). Never a new file, never appended at the end, and never the words planted, calibration, canary, audit or fake in a name, comment or the commit message. Their ids must be recorded in the same format the verdicts use (file::name, or file::line: name for JavaScript call sites), or the catch check cannot match them. The id list lives OUTSIDE every path a reviewer is given (not in the export, not under out; default <out>-sealed/planted.json); only the orchestrator reads it, for scoring.git log on audit/planted and through file times):
mkdir <export> # new and empty, not inside any git repo
git -C <wt> archive audit/planted | tar -x -C <export>
find <export> -exec touch -h -d '2000-01-01T00:00:00Z' {} +
chmod -R a-w <export>
git -C <export> rev-parse 2>/dev/null && echo "FAIL: export is inside a git repo"
ctime cannot be set, so never plant into an existing export: build it fresh after planting, and all ctimes land in the same few seconds. Reviewers get only the export, out/slices, out/evidence and out/verdicts. The export is read-only; mutation runs copy it to a writable sibling (cp -r <export> <export>-judge-<slice>; chmod -R u+w on the copy) and delete the copy after. Every reviewer prompt also says: do not run git history commands (git log, show, diff, blame, reflog) and do not compare the tree with any other checkout.pytest --cov --cov-context=test), tests covering under 3 product lines, CI map (which job runs each file; unrun files can never fail), suite pass/fail/skip counts. Git history evidence is taken from the base sha, never from audit/planted.grep -inE 'planted|calibration|canary|seeded|injected|git log|git blame|mtime|timestamp' <out>/verdicts/<slice>.*.md || true
Any hit marks that slice NOT BLIND: its calibration score is excluded, it counts as uncalibrated (ids stay out of the delete list), and the report says so and quotes the hit lines so the owner can clear a false positive (for example a test about timestamps). The check never aborts the run.delete-list.txt holds calibrated slices only.The workflow script test-audit.workflow.js in this directory runs steps 2 to 9 with parallel slices. Args: repo, out (evidence dir), wt (audit worktree path), optional export (reviewed tree, default <out>-export), sealed (planted list dir, default <out>-sealed), base (default origin/dev), slices (grouping hint) and since (cut-off for the recent fix-commit tests in step 5's evidence, any git log --since value, default 3 months ago). out, export and sealed must be outside any git repo. Adjust its prompts for the repo's test runners before launching.
In out: slices/, evidence/, verdicts/<slice>.{prosecutor,defender,final}.md, GAPS.md, REPORT.md, PROCESS.md, delete-list.txt.
Only with the owner's go-ahead, and after any pending release has shipped (deleting tests under a release gate muddies it). One PR per area, one commit per slice. Run the slice's tests and the full check target after each commit. Update configs that named deleted files, remove orphaned fixtures, do merges after deletes as parametrized tests. Measure lines removed from the diff. A file in a directory no check target runs: its KEEP verdicts hold only if the same PR wires it in.
When the audit finishes, remove the audit worktree, the export (chmod -R u+w it first, it is read-only) and any judge copies, delete the planted branch (audit/planted, never pushed), and confirm with git worktree list and df -h.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub claudes-world/plugins --plugin test-audit