test-audit

Identify and retire low-value tests that duplicate coverage or keep unnecessary test-only code alive.

139k|20.6k|Updated Mar 11, 2026
Ready to run
npx skills add https://github.com/garrytan/gstack --skill test-audit-garrytan
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: test-audit
Source: https://github.com/garrytan/gstack/tree/main/test-audit
Command: npx skills add https://github.com/garrytan/gstack --skill test-audit-garrytan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Test suites accumulate tests that cost more to maintain than they protect. Low-value tests obscure signal in CI, slow down feedback loops, and keep dead test-only code alive. This Skill finds those tests with hard evidence and retires them in approved batches. ## Core Features & Use Cases - Mechanical Pre-filtering: Identifies assertion-free tests, self-comparisons, and export-list grepping in seconds without reading every file. - Value Assessment: Evaluates each candidate against a four-point bar: what behavior it protects, what regression makes it fail, why existing tests don't catch that, and whether it requires production seams that no real caller needs. - Evidence-Based Retirement: Each candidate gets a complete retirement card (test name, what it detects, production callers, search command, stronger proof, git history, what unlocks, validation status) before any deletion. - Use Case: Your test suite has 500+ tests but half are duplicates of table-driven test rows or kept alive only to suppress unused-export warnings. Run this Skill, get a ranked list with evidence, approve one owner-boundary batch, and watch both test and production LOC drop. ## Quick Start Run the test-audit skill on your repository to discover low-value tests grouped by ownership boundary with retirement recommendations and evidence.

Frequently Asked Questions about test-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find duplicate or low-value tests in my codebase?▼

This Skill runs a multi-step discovery: mechanical pre-filters catch assertion-free tests and export-list greps in seconds, then evaluates each candidate against a four-point retention bar—what behavior it protects, credible regressions that fail it, why existing tests don't catch that, and production seams it requires. Each ready candidate gets a retirement card with git history, caller search results, and validation status before any deletion.

What makes a test low-value enough to retire?▼

A test is a candidate for retirement if it fails to independently enforce a public API, protocol, config, migration, storage, security, platform, default, or generated-output contract; duplicates another test's assertions; keeps test-only exports or globals alive; or asserts implementation details rather than behavior. Tests skipped with `gstack:test-value keep reason="..."` are never retired.

Can I retire tests that are slow or rarely fail?▼

Speed and low failure rate alone do not justify retirement. A slow test that independently protects a real contract stays. A test is retired only when it fails the value bar—it protects nothing public, nothing unique, or only test-only code. Slow behavior-protecting tests often unlock parallelization or caching wins instead.

What happens to production code when I retire a test?▼

Only production code reachable from the package entrypoint (exports, main, re-exports) or actively called outside tests is kept. Test-only exports, globals, and wrappers referenced only by the retiring test are deleted as part of the retirement batch. Production code removal requires the repo's typecheck, build, or dead-code tool to pass in a scratch worktree with the code removed.

How do I know if a retirement batch is safe to land?▼

Each batch includes validation: run the owner tests and siblings with your test runner, then `git diff --check` to verify no style violations. The Skill shows the production and test LOC delta separately. Batch landing goes through `/ship` for full CI; this Skill is read-only discovery and approved-batch editing only.

What if I disagree with a retirement recommendation?▼

The Skill marks each candidate `retain`, `rewrite`, `extend`, or `retire` with a complete retirement card—test name, what it detects, non-test callers, search command, stronger proof options, git history, what unlocks, and validation status. You approve or skip each batch before any edit. Incomplete cards stay as candidates marked not-ready for the next audit.