test-audit
Skill2 starsChanged 2 months agoApache-2.0View on GitHub
Invoke whenever writing, changing, reviewing, or sweeping tests. Authoring gate for new tests plus audit workflow for low-value, implementation-coupled, or duplicative tests and the test-only production seams they demand.
18 other projects use a version of this, 12 of them edited.
Adopted by
Most recently taken up by
- garrytan/gstacktheir own version, first seen Oct 7, 2026
- rafaelob/pragmatic-agent-skillsedited, first seen Oct 5, 2026
- superplanehq/superplaneedited, first seen Oct 5, 2026
- udecode/dotaiedited, first seen Oct 4, 2026
- iliaal/ai-skillstheir own version, first seen Oct 3, 2026
- shortcuts/dotfilesedited, first seen Oct 2, 2026
Used with
Projects with it also use review.
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.
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 12
- superplanehq/superplane★ 7.7k81% same
- vercel/eve★ 5.5k62% same
- udecode/dotai★ 1.2k17% same
- mblode/agent-skills★ 14210% same
- PyModel/jev-judge-mcp★ 9136% same
- rafaelob/pragmatic-agent-skills★ 2320% same
- shortcuts/dotfiles★ 1889% same
- 851-labs/codevisor★ 1654% same
- hcaiano/skills★ 335% same
- Rvey/agent-engineering-kit★ 385% same
2 more not listed
Wrote their own version · 6
- garrytan/gstack★ 143ksame name
- supabase/cli★ 2.4ksame name
- iliaal/ai-skills★ 43same name
- greglas75/zuvo★ 8same name
- juliomrqz/skills★ 1same name
- T0mSIlver/skills★ 1same name
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 repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- src-desktop/AGENTS.mdAGENTS.md
- src-server/AGENTS.mdAGENTS.md
- src-ui/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- src-desktop/CLAUDE.mdCLAUDE.md
- src-server/CLAUDE.mdCLAUDE.md
- src-ui/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- deslopSkill
- documentation-auditSkill
- security-triageSkill
- tauri-v2-buildSkill
The file
We split this skill into the rules it gives an agent
12 rules. 1 is common, 8 are distinctive, and 3 are very specific to this project.
1
Common
Most of the 18 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Before adding any test, answer four questions.
- Distinctive: line 83
Before judging a candidate, read the complete test and production owner, its entry point, callers, callees, sibling implementations, …
- Distinctive: line 86
When the test claims dependency-backed behavior, inspect the dependency source or types directly.
- Distinctive: line 91
Keep discovery read-only and report evidence before editing.
- Distinctive: line 109
Keep a test when it independently enforces a public API, plugin SDK, protocol, config, migration, storage, security, platform, default, …
- Common: line 113
call ordering when order is observable behavior.
- Distinctive: line 144
Prefer net-negative production LOC.
- Very specific: line 150
Never edit source or tests while Vitest is running in the worktree.
- Very specific: line 154
Before editing, run npm run gate:for -- <paths...> and follow the checks it routes to.
- Very specific: line 156
Run the smallest owner and sibling tests with npm run test:focused -- <file...>, not ad-hoc npx vitest.
- Distinctive: line 171
After final audit edits, get an independent report-only review of the deletions against their named keepers.
- Distinctive: line 176
Commit, push, open a PR, or land only when authorized.
“Common” is measured: kept by at least 6 in 10 of the 18 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 a package or server/UI area owns); before starting one, read CAMPAIGN.md.
Adapted from OpenClaw's test-audit skill (openclaw/openclaw@80930af),
Copyright (c) 2026 OpenClaw Foundation, used under the MIT License; see
LICENSE-MIT.
The method is unchanged; discovery lanes, validation, and landing use
Station's commands. Station's own testing rules in
docs/guides/testing.md
take precedence where they are stricter.
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 or shared fixture over a near-duplicate test; consolidate duplicated setup in the same change.
- Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? 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;
- provider-local replays of shared helpers;
- 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;
- mocks that implement the asserted behavior, or one identical mock standing in for different APIs;
- fixtures that supply the receipt, admission, or callback ordering the owner should produce, or persistence asserted against a store the path never writes;
- capability tests that restate declared flags instead of exercising the delivery or acknowledgement the flag 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 a "retires the window" test asserting the window was not cleared.
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, CI
routing, and relevant history. Read root and scoped AGENTS.md files first.
When the test claims dependency-backed behavior, inspect the dependency source
or types directly.
Discovery
Keep discovery read-only and report evidence before editing. For broad scope, run parallel discovery lanes when available:
- server (
src-server/); - UI (
src-ui/); - packages and end-to-end tests (
packages/,tests/); - scripts, gates, and tooling (
scripts/,.github/, root configuration).
Discovery uses a detached worktree at a pinned origin/main SHA so every lane
reads the same tree. npm run test:fixtures:check -- --inventory lists the
known fixture-policy sites, and the code-health report from npm run ci:fast
lists unused exports; neither list is a verdict on its own.
Outside campaign mode, prefer a few high-confidence candidates over a large speculative inventory. Hunt for the junk patterns.
Retention bar
Keep a test when it independently enforces a public API, plugin SDK, protocol, config, migration, storage, security, platform, default, prompt-byte, generated cross-language, package, 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;
- 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 Vitest is running in the worktree. Follow
docs/guides/testing.md; edit only in a
sibling worktree under ../station-worktrees/.
- Before editing, run
npm run gate:for -- <paths...>and follow the checks it routes to. - Run the smallest owner and sibling tests with
npm run test:focused -- <file...>, not ad-hocnpx vitest. - For a retained or repaired assertion, prove it can fail: commit, confirm
git status --shortis empty, break the production owner, confirm the named test goes red for the intended reason, restore, and re-run green.npm run test:mutation:smokeis the curated form of this check. - For removed source greps or plan assertions, run the executable script or gate that owns the real contract, as a child process, and assert its exit status.
- Run
git diff --check origin/main...HEAD,npm run test:changed -- --base=origin/main --explain, thennpm run ci:fast. Exit 3 from the selector is provisional, not completion. - Inspect
git diff --numstat origin/main...HEAD; report production/tooling separately from tests and test support. Updatescripts/test-fixture-policy-baseline.jsonwhen a deleted test removes a legacy site. - After final audit edits, get an independent report-only review of the deletions against their named keepers.
Landing and continuation
Commit, push, open a PR, or land only when authorized. Land through the merge
queue as described in the root AGENTS.md.
Land one coherent PR at a time; after landing, refresh from current main 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.
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.

