Engineering / test-stinky
Detect test-suite quality smells in any language or framework, explain the cost of each, and propose a fix with a source link.
Signed, graded provenance for this skill. Integrity, authorship, capability, and freshness as evidence you weigh, not a verified badge.
A holistic quality detector and gate stack for test suites, in any language and any framework. It exists as a counterweight, agents love to cover code with tests and overshoot: they ship suites that are huge, slow, and flaky, where coverage is the goal instead of a map, and where a green badge stops meaning anything. It finds the patterns that make a suite expensive to run, impossible to trust, and painful to change, explains the cost of each, and proposes a concrete fix. The full catalog with detection signals, fixes, exceptions, and sources is in catalog.md; read it before running a scan.
The judged artifact is the tests, not the production code. Production smells found along the way defer to sibling skills (react-stinky for React/TypeScript, tauri-stinky for Rust and Tauri); if those are not installed, note the finding in one line and move on. Everything about the tests themselves, the fixtures, the doubles, the waiting, the lanes, and the CI hygiene around them is in scope.
Nine pillars, 49 categories. Detection signals, fixes, and sources live in catalog.md. The background models the findings lean on (the test pyramid, the doubles taxonomy, flakiness, hermeticity, DAMP vs DRY, mutation and property-based testing) are separate linked concepts under references/concepts/; read one when a finding needs the underlying model explained, not just named.
Match the scope to the request, then run the workflow below over it.
| Mode | Trigger | What to scan |
|---|---|---|
| Suite sweep | "audit the test suite" | Every test file, runner config, and the CI steps that run them, all languages in the repo. Prioritize the largest files and the slowest lanes. |
| Folder scan | one or more directories named | Test files and their shared fixtures/helpers in those directories. |
| File scan | specific files named | Read each fully; check every test, fixture, helper, and inline test module. |
| Fragment sniff | a pasted test or one named case | Check only that surface. State what you assumed about helpers and fixtures off-screen. |
| Slim mode | "the suite is huge/slow, shrink it" | Suite sweep, then the slimming procedure in suite-pass.md, ending in a ranked deletion-and-push-down plan. |
| Gate setup | "keep it from regressing", "add test quality gates" | Skip the scan; apply the gate stack to the project's toolchain and report what each gate will start catching. |
Suite-sweep and slim scope additionally run the suite pass, the shape-of-the-whole audit (pyramid placement, runtime concentration, redundancy across layers, flake and disabled surface) that per-file scans cannot see. Narrower scopes cannot, so say the suite shape was not checked rather than implying it is fine.
Suite shape heading.The catalog carries a per-smell exception line. These cut across all of them. Honor them or this skill becomes a nuisance.
react-stinky and tauri-stinky rather than duplicating them.Test Stinky report, <scope>src/App.test.tsx[Funky] eager-test (intent and shape), line 746Smell: one it() walks connect, scope dialog, templates, attachments, streaming,and export, ~400 lines and 114 awaited steps.Cost: a failure at step 12 hides every behavior after it, and all failures shareone test name; nobody can tell what actually broke.Fix: split along the assertion clusters into six tests sharing a fixture thatgets the app to the connected state.Source: xUnit Test Patterns, Eager Test (http://xunitpatterns.com/Assertion%20Roulette.html)src-tauri/src/agent/host/agent_process.rs[Rancid] silent-conditional-pass (lifecycle and CI), line 181Smell: the test returns early, and green, unless OKF_STUDIO_PROCESS_TREE_FIXTURE is set.Cost: it reports passed on machines where it never ran; the guarantee is onlychecked in one special CI job, if that.Fix: convert the early return into a framework skip with a reason, and make theprovisioned CI lane assert zero skips for it.Source: pytest, Skipping tests (https://docs.pytest.org/en/stable/how-to/skipping.html)Suite shape: 266 frontend cases in 33 files (2 god files hold 27%), 242 Rust tests;storybook lane never runs in CI; 1 ignored network test; no durations reporting.Summary: 1 rancid, 1 funky across 2 files, plus 3 suite-shape findings.
When the scope is clean, say so plainly: "Smells fresh. No test-suite smells found in <scope>."
The catalog distills the canon of test-suite quality: Meszaros's xUnit Test Patterns smell taxonomy, the Google Testing Blog and Software Engineering at Google chapters on unit tests, doubles, flakiness, and coverage, Fowler's non-determinism and test-pyramid essays, Kent C. Dodds on implementation details and snapshots, and the Playwright best-practice docs. Each entry in catalog.md carries its own link.