test-audit
Skill4 starsChanged 11 days agoMITView on GitHub
Invoke whenever writing, changing, reviewing, or sweeping Vitest tests in this repo. Authoring gate for new or changed tests, plus an audit workflow for low-value, implementation-coupled, or duplicative tests and the test-only production seams they keep alive. Use when asked to add tests, review tests, clean up tests, or when a PR touches *.test.ts.
80 other projects use a version of this, 29 of them edited; 7 new projects in the last 4 weeks, against 13 the 4 before.
Adopted by
Cooling: 7 new projects took it in the last 4 weeks, 0.5× the 4 weeks before.
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 9 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 · 1
- every-app/open-seo★ 27k100% same
Edited · 29
- molt-bot/clawdbot★ 391k56% same
- simstudioai/sim★ 30k21% same
- superplanehq/superplane★ 9.1k51% same
- BuilderIO/agent-native★ 7.6k48% same
- vercel/eve★ 5.8k41% same
- wannabespace/conar★ 1.5k55% same
- friuns2/openclaw-android-assistant★ 57356% same
- OpenClawAndroid/openclaw-android-assistant★ 55656% same
- Genshin-bots/gsuid_core★ 36355% same
- open-constructs/cdk-terrain★ 28126% same
19 more not listed
Wrote their own version · 50
- 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
40 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 repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- ai-prompt-researchSkill
- ai-visibility-auditSkill
- competitive-landscapeSkill
- competitor-analysisSkill
- create-repo-skillSkill
- deslopSkill
- evaluate-skillSkill
- keyword-clusteringSkill
- keyword-researchSkill
- link-prospectingSkill
- local-seoSkill
- merge-readySkill
- observability-triageSkill
- openseo-release-notesSkill
- openseo-review-web-contentSkill
- papercutsSkill
- review-briefSkill
- review-simplifySkill
- review-ui-statesSkill
- seo-auditSkill
- seo-coachSkill
- seo-project-setupSkill
- seo-reportSkill
- setup-openseoSkill
- simple-issue-descriptionSkill
- stageshowSkill
- verify-local-mcpSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 76 edited versions we read keep these.
9
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 24
Before adding a test, answer four questions.
- Distinctive: line 97
Before judging a candidate, read the complete test and its production owner, the entry point, callers, callees, sibling implementations, …
- Distinctive: line 105
Keep discovery read-only and report evidence before editing.
- Distinctive: line 116
Prefer a few high-confidence candidates over a large speculative inventory.
- Distinctive: line 120
Use only when the maintainer explicitly asks for a suite-wide prune.
- Very specific: line 147
Use pnpm exec prettier --write <files>.
- Very specific: line 149
After all slices land, run the full suite in normal order and with two or three --sequence.shuffle.tests --sequence.seed=<n> runs.
- Distinctive: line 156
Keep a test when it independently enforces a public API, MCP tool contract, Zod boundary schema, config, migration, storage (both SQLite …
- Distinctive: line 160
call ordering when order is observable behavior.
- Distinctive: line 193
Prefer net-negative production LOC.
- Distinctive: line 199
Never edit tests while Vitest is running in the checkout.
- Very specific: line 201
Run the owner and sibling tests: pnpm exec vitest run <path-or-filter>.
- Very specific: line 208
Run the full suite once: pnpm test.
- Very specific: line 214
Commit, push, or open a PR only when authorized.
“Common” is measured: kept by at least 6 in 10 of the 76 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 for tests that re-assert source, duplicate stronger proof, couple behavior to implementation, or keep test-only production seams alive. Campaign mode reviews every test file with a per-test verdict when the maintainer asks to prune the whole suite; see Campaign mode. Optimize for confidence, not deletion count. Land one coherent batch per PR; continue broad audits as separate follow-ups.
The repository's own rules live in the "Testing" section of AGENTS.md. This
skill is the procedure for applying them; when the two disagree, AGENTS.md
wins and this file needs an update.
Authoring gate
Before adding a 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 owner at the strongest boundary (usually the service or the MCP
tool handler, not the repository or a private helper). Another layer needs
its own distinct risk. Prefer extending a table-driven case or a shared
factory (
ga4-test-fixtures.ts,tool-test-support.ts) over a near-duplicate test, and 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, test at the real boundary instead.
Grep the whole repo for callers, not just
src/;scripts/counts.
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 fix. 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 it at every layer it crosses.
Junk patterns
The shared checklist for both modes. The authoring gate rejects a new test that matches one; audits hunt for existing tests that do.
Repo-specific (each is a AGENTS.md rule):
- per-test
await import()orvi.resetModules()without a comment explaining which module-level state must reset; - a production class re-declared inside a test instead of imported from a leaf
module (
ga4Errors.ts,gscErrors.tsare the pattern); mockReset/mockClearceremonies inbeforeEach(VitestclearMocksis already on);- fixtures longer than the assertions that read them, or inline copies of a shape that already has a factory;
- Zod schemas or third-party libraries re-tested through the module under test;
- an output-schema round-trip repeated in every happy path;
- Drizzle builder chains mocked (
select().from().where()withvi.fn()chains); repositories are tested through services or real SQL; - argument forwarding to a mock asserted when the mapping is not the contract (billing params and telemetry events are the contract; internal helper arguments are not).
General:
- assertion-free coverage probes;
- self-comparisons, and expected values produced by the helper or renderer under test;
- 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;
- tests whose only purpose is preserving test-only exports or wrappers;
- dead production code whose only callers are tests;
- mocks that implement the asserted behavior, or one identical mock standing in for different APIs;
- 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.
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 its production owner, the entry point, callers, callees, sibling implementations, overlapping tests, and relevant git history. When the test claims dependency-backed behavior (DataForSEO response shapes, Autumn, Better Auth, Drizzle), inspect the dependency source or types directly.
Discovery
Keep discovery read-only and report evidence before editing. For broad scope, run parallel read-only lanes (Explore subagents work well):
src/server/mcp/andsrc/server/mcp/tools/;src/server/lib/,src/server/auth/,src/server/billing/,src/server/workflows/,src/serverFunctions/;src/server/features/;src/client/,src/shared/,src/lib/,src/types/,scripts/,web/tests/, plus a cross-cutting grep sweep for the repo-specific patterns above.
Prefer a few high-confidence candidates over a large speculative inventory.
Campaign mode
Use only when the maintainer explicitly asks for a suite-wide prune. Run the pipeline in two phases with disjoint file slices so agents never edit the same file:
- Review, read-only. Split every
*.test.tsinto 6-8 slices balanced by line count and grouped by directory. One reviewer per slice reads each test file and its production owner completely and writes a report with a table per file: test name, DELETE / MERGE / KEEP, one-line evidence naming the code change that would fail it or the test that already owns it. The report also lists test-only production seams (with callers checked insrc/,scripts/,tests/badseo/,web/), test support that becomes unused, whole files to delete, and a "risky calls" section. Reviewers do not edit. - Apply, per slice. One applier per slice re-verifies each DELETE and MERGE against the source before acting, keeps anything whose evidence does not hold, folds MERGE rows into table-driven siblings, deletes newly unused fixtures and mocks, and skips every risky item, listing it back for the maintainer. If a deletion's justification cites a test in another slice, the applier confirms that test still exists at the end of its run.
Rules that hold throughout a campaign:
- The only permitted non-test edit is removing an
exportkeyword from a helper whose remaining callers are all tests. Knip failsci:checkon the orphaned export otherwise. Never remove parameters, delete branches, or change behavior in the same change, even when a test looks like the only reason the code exists; report those as follow-ups. - Route modules under
src/routes/and barrel files keep their exports. - Use
pnpm exec prettier --write <files>;pnpm format:writeignores arguments and formats the whole repository. - After all slices land, run the full suite in normal order and with two or
three
--sequence.shuffle.tests --sequence.seed=<n>runs. Removing reset ceremony can surface latent order dependence; fix it by setting the mock's default inbeforeEach, never by restoring the ceremony.
Retention bar
Keep a test when it independently enforces a public API, MCP tool contract, Zod boundary schema, config, migration, storage (both SQLite and Postgres), billing, auth, security, default, prompt-byte, or package 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 (a user-facing key, byte, or path) and survives an
identifier-only refactor. The pinned SAM skill roster in
samSkills.test.tsand the unique-index parity check insrc/db/schema-parity.test.tsare this kind; - 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 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
scripts/,tests/badseo/, andweb/(a profiling script is still a caller); - 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,
wrappers, and dead production paths instead of preserving aliases (Knip will
flag survivors in pnpm ci:check). Move retained regressions to their
canonical owners. Consolidate repeated assertions into one table-driven case.
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 tests while Vitest is running in the checkout.
- Run the owner and sibling tests:
pnpm exec vitest run <path-or-filter>. - For a removed source grep or static assertion, run the executable that owns
the real contract (for example
pnpm sync-plugin-skillsfor plugin skill drift). pnpm format:write, thenpnpm ci:check(prettier, knip, tsc, oxlint, plugin-skill sync). Knip failing on a now-unused export means delete the export, not re-add a test.- Run the full suite once:
pnpm test. - Inspect
git diff --numstat; report production/tooling separately from tests and test support.
Landing
Commit, push, or open a PR only when authorized. Use the merge-ready skill
for the review and PR flow. If a verified finding exposes a recurring
invariant that .greptile/ does not capture, use maintain-greptile-rules;
do not promote one-off cleanups into permanent rules. Log repository friction
met along the way with papercuts.
Handoff
Report:
- removed low-value categories and the root cause behind them;
- production owner simplifications;
- retained false positives and why they remain valuable;
- focused and full proof actually run, with real output;
- 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.

