debug-test-failures
Skill110 starsChanged 3 months agoMITView on GitHub
Systematic debugging workflow for test failures. Use when tests are failing, a CI build is red, or when asked to debug test issues.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- SandAI-org/MagiAttentiontheir own version, first seen Oct 8, 2026
- LJMStark/geo-doctortheir own version, first seen Jul 3, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- SandAI-org/MagiAttention★ 971same name
- LJMStark/geo-doctor★ 0same 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- api-designSkill
- copilot-cli-modesSkill
- dependency-updateSkill
- deterministic-scriptsSkill
- imagery-provider-adaptationSkill
- release-notesSkill
- security-analysisSkill
- validation-diagnosticsSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
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
- Distinctive: line 33
Run the failing test in isolation:
- Distinctive: line 41
Run it 2-3 times. If intermittent, it's likely flaky.
- Distinctive: line 44
Read the error message and stack trace carefully
- Distinctive: line 46
Check if the failure is in the test or the code under test
- Distinctive: line 49
Read the test code to understand what it's testing
- Distinctive: line 50
Read the production code being tested
- Distinctive: line 51
Check recent changes to both
- Distinctive: line 61
If the test is wrong (testing outdated behavior), update the test
- Distinctive: line 62
If the code is wrong, fix the code
- Very specific: line 63
Run the full test suite: cd hastelib && hatch run test:pytest
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debug Test Failures
Overview
A systematic process for diagnosing and fixing test failures. Use this skill when tests fail, CI is red, or someone reports a broken build. The key principle: find the root cause, not just the symptom.
Key Concepts
Failure Categories
- Deterministic failure: Same result every time. Usually a code bug or outdated test.
- Flaky failure: Intermittent. Usually caused by timing, ordering, shared state, or external dependencies.
- Environment failure: Works locally, fails in CI. Usually paths, permissions, or missing dependencies.
Patterns & Techniques
Systematic Debugging Process
Step 1: Reproduce Run the failing test in isolation:
# Python tests
cd hastelib && hatch run test:pytest
# UI lint
cd ui && npm run lintRun it 2-3 times. If intermittent, it's likely flaky.
Step 2: Analyze
- Read the error message and stack trace carefully
- Identify the assertion that failed: expected vs actual values
- Check if the failure is in the test or the code under test
Step 3: Investigate
- Read the test code to understand what it's testing
- Read the production code being tested
- Check recent changes to both
- Common root causes:
- Changed function signatures or return types
- Modified data structures
- New dependencies not mocked
- Environment differences (paths, timezones, locale)
- Race conditions in async code
Step 4: Fix
- Fix the root cause, not just the symptom
- If the test is wrong (testing outdated behavior), update the test
- If the code is wrong, fix the code
- Run the full test suite:
cd hastelib && hatch run test:pytest
Step 5: Report Summarize: root cause, fix applied, verification that all tests pass.
Decision Framework
| Symptom | Likely Cause | Action |
| Test always fails | Code bug or outdated test | Read both, fix the wrong one |
| Test passes locally, fails in CI | Environment difference | Check paths, deps, permissions |
| Test fails intermittently | Timing, shared state, or ordering | Add isolation, remove shared state |
| Many tests fail at once | Breaking change in shared code | Find the common dependency |
Common Pitfalls
- Fixing the test to match broken code — Verify the code is correct before changing the test
- Adding sleep() to fix flaky tests — Fix the root cause (usually missing await or shared state)
- Only running the fixed test — Always run the full suite to check for regressions
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.

