test-doctor
Skill0 starsChanged 3 months agoMITView on GitHub
Diagnose failing tests systematically — classify the failure mode, find the true cause with evidence, and fix the code or the test with confidence
3 other projects use a version of this.
Adopted by
Most recently taken up by
- jongio/skillstheir own version, first seen Nov 1, 2026
- liangmiQwQ/skillstheir own version, first seen Oct 11, 2026
- zerob13/skillstheir own version, first seen Jun 30, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- jongio/skills★ 18same name
- zerob13/skills★ 7same name
- liangmiQwQ/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 repository2 other files it gives its agents.
- api-debuggerSkill
- git-surgerySkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Run ONLY the failing test: pytest tests/test_foo.py::test_bar -x -v (or the project's equivalent).
- Distinctive: line 23
Run it again in isolation — flaky vs deterministic changes the whole diagnosis.
- Distinctive: line 24
Run the whole file — state leakage between tests is a top cause.
- Distinctive: line 27
For assertion failures: read the actual value, then read the code path that produced it.
- Distinctive: line 28
For exceptions: follow the traceback to the FIRST frame where the error originates, not where it surfaces.
- Distinctive: line 29
For timeouts: check for unbounded loops, missing mocks on network calls, or synchronous waits.
- Distinctive: line 34
If the test was wrong (stale expectation), update it deliberately and state why.
- Distinctive: line 36
If the failure was real: add a regression test that would catch it again.
- Distinctive: line 39
Never "fix" a test by disabling it — investigate first, always.
“Common” is measured: kept by at least 6 in 10 of the 3 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 Doctor
Diagnose failing tests like a clinician: classify the failure, gather evidence, find the root cause, fix it, and prove the fix.
Step 1 — Classify the failure mode
| Mode | Signature | Likely cause |
| Assertion | assertion fails with actual vs expected | logic bug, changed behavior, wrong expectation |
| Error/exception | test crashes with traceback | unhandled error path, missing import, type mismatch |
| Timeout | test hangs or exceeds limit | blocking call, infinite loop, missing mock, slow I/O |
| Flaky | passes alone, fails in suite | shared state, ordering, timing, random data |
| Setup/teardown | fails before first assertion | fixtures, DB state, env vars |
Step 2 — Reproduce with evidence
- Run ONLY the failing test:
pytest tests/test_foo.py::test_bar -x -v(or the project's equivalent). - Capture the full traceback and the diff between actual and expected.
- Run it again in isolation — flaky vs deterministic changes the whole diagnosis.
- Run the whole file — state leakage between tests is a top cause.
Step 3 — Find the root cause
- For assertion failures: read the actual value, then read the code path that produced it. The test is usually right — the code is wrong.
- For exceptions: follow the traceback to the FIRST frame where the error originates, not where it surfaces.
- For timeouts: check for unbounded loops, missing mocks on network calls, or synchronous waits.
- For flaky tests: hunt shared mutable state: module-level globals, class-level fixtures, environment variables, DB records, time/random without seeding.
Step 4 — Fix and prove
- Fix the root cause, not the symptom — do not delete, skip, or loosen a failing assertion without an explicit reason.
- If the test was wrong (stale expectation), update it deliberately and state why.
- Re-run the single test, then the full file, then the whole suite.
- If the failure was real: add a regression test that would catch it again.
Rules
- Never "fix" a test by disabling it — investigate first, always.
- One failing test in a suite is usually a symptom; three in a row usually share one cause — find the shared cause first.
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.

