debugging-test-failures
Skill11 starsChanged 47 days agoMITView on GitHub
Systematically investigates failing tests, distinguishes between test bugs and implementation bugs, and drives a fix with verification. Use when the user wants to debug failing tests.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- auditing-uiSkill
- browser-testingSkill
- capturing-product-mediaSkill
- ci-local-exportSkill
- ci-pulseSkill
- ci-quarantineSkill
- ci-statusSkill
- creating-pull-requestsSkill
- debugging-systematicallySkill
- debugging-typescript-errorsSkill
- deps-weeklySkill
- designing-frontendSkill
- opensrcSkill
- organizing-fsd-architectureSkill
- runtime-watchSkill
- stewarding-ci-pipelineSkill
- syncing-agent-skillsSkill
- verification-before-completionSkill
- vision-drift-checkSkill
- visual-companionSkill
- writing-adrsSkill
- writing-app-copySkill
- writing-blog-postsSkill
- writing-changelogsSkill
- writing-developer-guidesSkill
- writing-for-humansSkill
- writing-to-usersSkill
- adding-config-fieldsSkill
- clarifying-requirementsSkill
- maintaining-dependenciesSkill
- maintaining-dev-playgroundSkill
- managing-specsSkill
- marketplace-devSkill
- orchestrating-parallel-workSkill
- reading-session-transcriptsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- styling-with-tailwind-shadcnSkill
- test-driven-developmentSkill
- upgrading-runtime-dependenciesSkill
- working-in-worktreesSkill
- dorkbot-triageSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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 12
Use it when tests are failing and the goal is to identify the real root cause instead of making blind changes.
- Distinctive: line 65
Prefer implementation fixes when the test encodes correct expected behavior.
- Distinctive: line 66
Prefer test fixes when the implementation is correct and the test is asserting the wrong thing.
- Distinctive: line 67
If multiple failures share one cause, fix the root cause before touching individual assertions.
- Distinctive: line 68
If the test never demonstrated a correct RED state, repair the test before trusting it.
- Very specific: line 72
Treat this skill as the portable replacement for /debug:test.
- Distinctive: line 73
Keep a short execution plan, but do not depend on a tool-specific todo API.
- Distinctive: line 74
Ask bounded clarification only if multiple failure scopes or fix strategies are materially different.
- Distinctive: line 75
Always end with real verification, not reasoning alone.
≈ “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
Debugging Test Failures
Overview
This is the shared-skill replacement for the legacy Claude Code /debug:test workflow.
Use it when tests are failing and the goal is to identify the real root cause instead of making blind changes.
Read First
Before acting, read:
.agents/skills/debugging-systematically/SKILL.md.claude/skills/test-driven-development/SKILL.mdwhen the failing test is tied to new feature work or a bugfix
Core Workflow
- Run the relevant test scope
- one file or one pattern when possible
- whole-suite only when needed
- Parse the failure output
- failing test names
- expected vs actual behavior
- error messages and stack traces
- Check load-sensitivity before diving in
- passes in isolation but fails in the full run
- the assertion is about timing, throughput, or sample counts rather than behavior
- the failure text names milliseconds, wall-clock boundaries, or "expected N samples"
- the file is in a known flake family: harness atomic-write AP-10
(sample-throughput guard, MIN_SAMPLES fixed at 200), RoomLiveLane
(wall-clock boundaries), agent-activity (teardown timing),
palette-scope-chips (DOR-1502), and the browser spec
apps/e2e/tests/settings/runtimes-tab.spec.ts"Make default moves the default, and it survives a reload" (DOR-2043:page.waitForResponse/locator.click90s timeouts on merge-queue shard 2, three times on 2026-09-14 on diffs that cannot reach it) - a load-starved guard refusing to conclude is not a defect in your branch — re-run once before spending a cycle, and if it repeats, it belongs to the test's owner, not yours
- Read the failing test first
- understand arrange / act / assert
- explain what the test is trying to prove
- Read the implementation under test
- trace inputs, transformations, and outputs
- Decide where the bug lives
- implementation
- test logic
- mock/setup
- broader shared root cause
- Apply a minimal fix
- fix the real problem, not just the symptom
- Re-run verification
- the failing test
- nearby tests when relevant
Decision Heuristics
- Prefer implementation fixes when the test encodes correct expected behavior.
- Prefer test fixes when the implementation is correct and the test is asserting the wrong thing.
- If multiple failures share one cause, fix the root cause before touching individual assertions.
- If the test never demonstrated a correct RED state, repair the test before trusting it.
Cross-Agent Rules
- Treat this skill as the portable replacement for
/debug:test. - Keep a short execution plan, but do not depend on a tool-specific todo API.
- Ask bounded clarification only if multiple failure scopes or fix strategies are materially different.
- Always end with real verification, not reasoning alone.
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.

