Detox
Skill tokyubevoxelverse/detox
Claude Code skill that hunts flaky tests β separates flaky from broken, diagnoses the root cause (shared state, timing, ordering, network), fixes the cause, and proves it with 20+ runs. Retries and sleeps are banned. π§ͺ
npx -y skills add tokyubevoxelverse/detoxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Hunt down and fix flaky tests. Use when a test suite fails intermittently, CI needs re-runs to go green, or the user wants to know which tests are flaky versus genuinely broken β and why.
SKILL.md
3.0 KB, 644 tokens by cl100k_base, as published. Nobody here has run it
Detox
A flaky test is worse than a missing test: it trains everyone to ignore red. Your job is to separate flaky from broken, diagnose each flake's root cause class, and fix the cause β never the symptom.
Banned fixes
Retry wrappers, longer sleeps, and skip are not fixes; they are how flakes become permanent residents. The only acceptable retry is around a call to a genuinely external system the test cannot control β and that usually means the test should be mocking it instead.
Phase 1 β Census
Run the full suite repeatedly β default 5 runs, more if runs are cheap β and build a per-test pass/fail matrix.
- Fails every run β broken, not flaky. Report separately; out of scope unless asked.
- Fails some runs β flaky. This is the target list, ranked by failure rate.
- Record conditions per run: ordering, parallelism, seed, timing β the variance between a passing and failing run often names the culprit by itself.
Phase 2 β Diagnose each flake
Isolate, then classify. Standard experiments:
| Experiment | If behavior changes β |
|---|---|
| Run the test alone vs. after the full suite | Shared state / test-order dependence |
| Run the suite in random order / different parallelism | Order dependence, resource contention (ports, files, DB rows) |
| Run with a fixed seed / frozen clock | Unseeded randomness, time-of-day or timezone dependence |
| Run repeatedly in a tight loop | Race conditions, timing assumptions, hardcoded timeouts |
| Run with network blocked / observed | Real network calls hiding in a "unit" test |
Read the failing assertion under each hypothesis: a flake almost always belongs to one of six families β shared state, ordering, timing/races, unseeded randomness, clock/timezone, external systems (network, filesystem, ports).
Phase 3 β Fix the cause
Match the fix to the family: proper setup/teardown isolation for shared state; explicit awaiting or synchronization points instead of sleeps for races; injected/frozen clocks; seeded randomness; mocks or test doubles for external systems; per-test unique resources (temp dirs, ephemeral ports) for contention. The fix should make the test deterministic, not tolerant.
Phase 4 β Prove it
A fix isn't proven by one green run. Run the fixed test 20+ times, including under the conditions that made it fail (full-suite ordering, parallelism, tight loop). Then run the whole suite to confirm the fix didn't shift the flake elsewhere.
Phase 5 β Report
Write FLAKES.md: per test β failure rate before, root-cause family, the experiment that proved it, the fix, runs-passed after. Plus a short "flake debt" section: patterns in the codebase likely to breed the same families again (a shared fixture, a real HTTP client in unit tests), so the next flake gets prevented rather than hunted.
What ships with it: 2 files
2.8 KB alongside SKILL.md