test-audit
Skill0 starsChanged 2 months agoMITView on GitHub
Use whenever writing, changing, reviewing, or sweeping tests in a Ruby, JavaScript/TypeScript, Python, or Rust project. Authoring gate for new tests, plus an audit workflow for low-value, implementation-coupled, or duplicated tests and the test-only production seams they keep alive. Triggers on 'add a test', 'write tests for', 'review these tests', 'test audit', 'prune the tests', 'clean up the test suite', 'are these tests worth keeping'.
80 other projects use a version of this, 31 of them edited.
Adopted by
Most recently taken up by
- udecode/better-convextheir own version, first seen Nov 9, 2026
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- mageyuki/skillstheir own version, first seen Nov 8, 2026
- openclaw/openclaw-enterprisetheir own version, first seen Nov 8, 2026
- Swarzy-LLC/skillstheir own version, first seen Nov 8, 2026
- MammadovEshgin/clean-code-skilltheir own version, first seen Nov 8, 2026
Used with
Projects with it also use chips, redo and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
udecodeSkillchips
Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.
Also in 3 projects that use this
Scylla23Skillredo
Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.
Also in 3 projects that use this
Aetheria-Labs1Skillplan-page
Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.
Also in 3 projects that use this
SocialKit-APISkillvideo-transcripts
Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.
Also in 3 projects that use this
clawdbotSkillpr-simplify
Simplify your own change to its smallest complete fix. Use before opening a PR, before pushing large repairs to one, or when asked to shrink a PR or clean up slop.
Also in 3 projects that use this
spitoglouSkilltechnical-documentation
Create and improve technical documentation including architecture designs, PRDs, API docs, code explanations, and visual diagrams. Use when asked to document systems, explain codebases, create design documents, write PRDs, generate Mermaid/PlantUML diagrams, review architecture, write user stories, or create pull request descriptions. Triggers include "document this", "create a design doc", "explain this code", "write a PRD", "create a diagram", "architecture overview", "user story for", "PR description".
Also in 3 projects that use this
Other versions80 projects use a version of this.
Word for word · 0
None found.
Edited · 31
- molt-bot/clawdbot★ 391k75% same
- simstudioai/sim★ 30k19% same
- every-app/open-seo★ 27k35% same
- superplanehq/superplane★ 9.1k69% same
- BuilderIO/agent-native★ 7.6k64% same
- vercel/eve★ 5.8k54% same
- wannabespace/conar★ 1.5k55% same
- friuns2/openclaw-android-assistant★ 57375% same
- OpenClawAndroid/openclaw-android-assistant★ 55675% same
- Genshin-bots/gsuid_core★ 36375% same
21 more not listed
Wrote their own version · 49
- moltbot/clawdbot★ 394ksame name
- steipete/warelay★ 394ksame name
- steipete/clawdis★ 394ksame name
- moltbot/moltbot★ 394ksame name
- clawdbot/clawdbot★ 394ksame name
- openclaw/openclaw★ 394ksame name
- garrytan/gstack★ 141ksame name
- paperclipai/paperclip★ 112ksame name
- udecode/plate★ 17ksame name
- supabase/cli★ 2.5ksame name
39 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- create-pull-requestSkill
- deep-researchSkill
- herdrSkill
- pr-review-loopSkill
- readme-writerSkill
- remixSkill
- sandi-metz-rulesSkill
- skill-creatorSkill
- tearing-down-a-merged-worktreeSkill
- worktree-spaceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 12 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 77 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Run once per repo, before the first judgement:
- Distinctive: line 27
Read the root file and every scoped file above the paths in scope.
- Very specific: line 37
TEST_SURFACE: test and support file, line, and declaration counts.
- Distinctive: line 43
Before adding any test, answer four questions.
- Distinctive: line 108
Before judging a candidate, read the complete test and production owner, its entry point, callers, callees, sibling implementations, …
- Distinctive: line 112
When the test claims dependency-backed behavior, inspect the dependency source or types directly.
- Distinctive: line 118
Keep discovery read-only and report evidence before editing.
- Distinctive: line 134
Keep a test when it independently enforces a public API, CLI, wire protocol, file format, config, database migration, storage, security, …
- Distinctive: line 139
call ordering when order is observable behavior.
- Distinctive: line 171
Prefer net-negative production LOC.
- Very specific: line 177
Never edit source or tests while a watch-mode runner (WATCH_RUNNERS) is running in the checkout.
- Distinctive: line 179
Ask the user to stop it first.
- Distinctive: line 181
Run the smallest owner and sibling tests with the focused command from the stack section.
- Distinctive: line 185
Run the formatter and linter on changed files, then git diff --check.
- Very specific: line 186
Run the gate the repo requires for the changed paths: the CI test lines, the repo wrapper (bin/ci, make check, pre-commit run --files …
- Very specific: line 200
After final audit edits, run a review pass over the whole diff: the code-review skill (/code-review) when available, otherwise re-check …
- Very specific: line 206
Commit, push, open a PR, or merge only when the user asked.
“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Audit
Three modes, one value bar. Authoring mode gates every new or changed test at write time. Audit mode runs focused sweeps of tests that re-assert source, duplicate stronger proof, couple behavior to implementation, or keep test-only production seams alive. Continue broad audits as separate coherent follow-up PRs; optimize for confidence, not deletion count. Campaign mode prunes one whole subsystem's test surface (every test file one gem, package, crate, app module, or plugin owns); before starting one, read CAMPAIGN.md.
Repo context
Run once per repo, before the first judgement:
"$HOME/.claude/skills/test-audit/scripts/test_context.sh"It prints labeled sections:
- AGENT_DOCS:
AGENTS.md,CLAUDE.md,CONTRIBUTING.mdand testing docs. Read the root file and every scoped file above the paths in scope. Repo rules win over this skill. - RUBY / JAVASCRIPT / PYTHON / RUST: one section per project root, with the focused test command, formatter, linter, type checker, and the test libraries in use. Read the matching section of references/stacks.md for each stack in scope; it maps the generic rules below to that language's idioms.
- TASK_RUNNERS and CI: repo wrappers (
bin/ci,make test, package scripts, pre-commit hooks) and the test lines CI actually runs. Prefer the repo's wrapper over the raw runner; CI shows what gates a merge. - TEST_SURFACE: test and support file, line, and declaration counts.
- SKIP_MARKERS: focused (
.only,fit,focus: true) and skipped tests. - WATCH_RUNNERS: watch-mode runners running in this checkout.
Authoring gate
Before adding any test, answer four questions; a missing answer means do not add it yet:
- What observable behavior, invariant, or independent contract does it protect?
- What credible regression makes it fail?
- Why does existing coverage not already catch that failure? Each contract has
one primary test owner at the strongest boundary; another layer needs its
own distinct risk, such as a transport or lifecycle failure the owner cannot
reach. Prefer extending a table-driven case (
it.each,pytest.mark.parametrize, an RSpec example loop, anrstestcase) or a shared fixture over a near-duplicate test; consolidate duplicated setup in the same change. - Does it need a production seam that no production caller needs: an export,
a flag, a wrapper, an injection hook, visibility widened for tests, or an
if test environmentbranch? If yes, move the test to the real boundary instead.
Then check the test against every junk pattern; a match fails the gate unless the retention bar names the contract it independently guards. A test that would break under behavior-preserving refactoring is asserting implementation, not behavior; rewrite it at the owning boundary before landing it.
Bug regression tests must fail on the pre-fix code for the intended reason and pass after the owner-boundary repair. A regression test that never demonstrably failed proves the mock, not the fix. One regression at the owner boundary covers the bug; do not replay the same scenario at every layer it crosses.
Junk patterns
The shared checklist for both modes: the authoring gate rejects a new test that matches one, and audits hunt for existing tests that do.
- assertion-free coverage probes;
- self-comparisons and identity copiers;
- copied fixtures, inventories, manifests, or export lists;
- exact source, import, or string greps;
- private predicate or call-shape tests duplicated at real boundaries;
- duplicate invocations of the same contract;
- each caller replaying a shared helper's own tests;
- tests whose only purpose is preserving test-only exports, globals, or wrappers;
- dead production code whose only callers are tests;
- expected values produced by the helper or renderer under test, including snapshots accepted without anyone reading them;
- mocks that implement the asserted behavior, or one identical mock standing in for different APIs;
- fixtures or stubs that supply the result, acknowledgement, or callback order the code under test should produce, or persistence asserted against a store the path never writes;
- tests that restate a declared flag, config value, or declaration instead of exercising the behavior it promises;
- negative controls that pass for an unrelated reason, such as a denial from a different guard or a rejection the production path never reaches;
- names or fixtures that promise more than the input exercises, such as an "expires the session" test that asserts the session still exists;
- focus markers that silently shrink the suite, and skipped or ignored tests with no reason, owner, or CI job that runs them.
Value bar
Tests justify their maintenance cost by protecting behavior, a credible regression, or an independently meaningful contract. In an audit, an existing test that must change for behavior-preserving source reorganization is suspect, not automatically deletable; the authoring gate still rejects new ones.
Before judging a candidate, read the complete test and production owner, its
entry point, callers, callees, sibling implementations, overlapping tests,
whether and where CI runs it (tags, markers, feature flags, excluded paths),
and relevant history (git log -L or git log --follow -p on the test).
When the test claims dependency-backed behavior, inspect the dependency source
or types directly; references/stacks.md says where each
stack keeps them.
Discovery
Keep discovery read-only and report evidence before editing. For broad scope, run parallel read-only discovery lanes (subagents) when available:
- core library and application code (
lib/,app/,src/,packages/*,crates/*); - plugins, engines, or workspace members with their own suites;
- UI, apps, scripts, and tooling (
bin/,scripts/, frontend); - a cross-cutting pattern sweep across all test files.
Outside campaign mode, prefer a few high-confidence candidates over a large speculative inventory. Hunt for the junk patterns. Coverage reports help find production code whose only callers are tests; they are evidence, not a verdict.
Retention bar
Keep a test when it independently enforces a public API, CLI, wire protocol, file format, config, database migration, storage, security, platform, default value, exact output bytes (rendered text, prompts, serialized formats), generated code, packaging, release, or architecture contract. Also keep:
- call ordering when order is observable behavior;
- regressions with a credible failure mode;
- source inspection when it is the cheapest independent guard: it fails when the contract changes (the user-facing key, byte, or path) and survives an identifier-only refactor;
- a retained test that fails on the baseline: treat it as a possible product bug, reproduce it, and repair the owner rather than deleting it.
Static or slow is not a deletion reason. A test that resembles implementation may still be the independent contract; prove otherwise before removing it.
Candidate evidence
Record every field below before editing. A missing field means the candidate is not ready for deletion:
- exact test name and location;
- what failure it can actually detect;
- non-test callers of the covered production or support seam, including dynamic ones (see the stack notes);
- stronger remaining owner-boundary proof, or why no proof is needed;
- relevant history and the reason the test or seam exists;
- production or test-support deletion unlocked;
- risk and the focused validation command.
Edit shape
Choose one coherent owner-boundary batch. Delete obsolete test-only exports, globals, wrappers, and dead production paths instead of preserving aliases. Move retained regressions to their canonical owners. Consolidate repeated package or dependency assertions into one generic contract.
Prefer net-negative production LOC. Do not add replacement tests that restate the same implementation, and do not convert uncertain candidates into cleanup to increase deletion counts.
Validation
Never edit source or tests while a watch-mode runner (WATCH_RUNNERS) is running in the checkout; it reruns half-edited files and reports misleading results. Ask the user to stop it first.
- Run the smallest owner and sibling tests with the focused command from the stack section.
- For removed source greps or plan assertions, run the executable script, CLI, or dry-run that owns the real contract.
- Run the formatter and linter on changed files, then
git diff --check. - Run the gate the repo requires for the changed paths: the CI test lines,
the repo wrapper (
bin/ci,make check,pre-commit run --files <paths>), and the type checker where the stack has one. Deleted tests can drop coverage below a configured threshold; lowering a threshold needs the user's approval. Split the diff into tests, test support, and production:
"$HOME/.claude/skills/test-audit/scripts/test_context.sh" diff [<base>]With no base it covers uncommitted work; pass the default branch for a whole branch. Report production/tooling separately from tests and test support.
- After final audit edits, run a review pass over the whole diff: the
code-reviewskill (/code-review) when available, otherwise re-check every deletion against its candidate evidence.
Landing and continuation
Commit, push, open a PR, or merge only when the user asked. Open PRs with the
create-pull-request skill when it is installed. Land one coherent PR at a
time; after landing, refresh from the default branch and rerun read-only
discovery for the next high-confidence batch.
Handoff
Report:
- root cause and removed low-value categories;
- production owner simplifications;
- retained false positives and why they remain valuable;
- focused and full proof actually run;
- production versus test LOC;
- PR and merge state;
- named follow-ups.
Resources
scripts/test_context.sh: repo survey (stacks, commands, CI, surface, markers, watchers);diff [<base>]splits the diff into tests, support, and production.references/stacks.md: per-language runners, idioms, seams, mocks, dynamic callers, dependency source, coverage.CAMPAIGN.md: whole-subsystem pruning, lane by lane.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

