debugging-three-strikes
Skill1 starsChanged 11 days agoMITView on GitHub
Stop speculative debugging after 3 same-bug strikes. Diagnose systematically before writing code. Use when repetitive fixes fail. Do NOT use for first-time bugs.
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Strike 1 — Diagnose then fix: Every attempt starts with evidence, not speculation.
- Distinctive: line 58
Document root cause vs expected behavior
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
3 Strikes Protocol
When the same bug is reported 3+ times with different fixes, STOP.
When to Use
- Same test failing across 3+ consecutive commits (mechanical STRIKES_LOG trigger)
- Same component fixed twice with different root causes
bug-tag:repeating in commit body for the same issue- Escalated from
debugging-and-error-recoveryafter repeated fix attempts
When NOT to Use
- First occurrence of a bug (use
debugging-and-error-recoveryinstead) - One-off test flakiness or network-dependent failure
- Different components failing independently (not the same root cause)
Output Contract
Strike log entry + escalation diagnosis — .git/STRIKES_LOG recording each strike with test name and timestamp, root cause documented per strike, route-to-skill assigned at strike 3 (test gap → TDD, spec gap → review, process gap → doubt, architecture gap → analysis), user notified before any fix code at strike 3.
Trigger: Test Failure Recurrence
A mechanical pre-commit check reads .git/STRIKES_LOG. Same test name failing 3 consecutive commits → BLOCK and escalate.
Commit 1: test-X FAIL → strike 1 (logged)
Commit 2: test-X FAIL → strike 2 (logged)
Commit 3: test-X FAIL → BLOCK. Escalating.Other triggers: session-level agent memory (same component fixed twice), bug-tag: in commit body repeating.
Protocol
Strike 1 — Diagnose then fix. Every attempt starts with evidence, not speculation. Inspect DOM, network, console, logs. Document root cause. Fix. Verify tests pass.
Strike 2 — Your diagnosis was wrong. Re-diagnose with fresh context. Fix + add regression guard (test coverage, instrumentation, or lint rule).
Strike 3 — Systemic failure. The diagnosis-fix-verify cycle works but the system reproduces the bug. BLOCK. No more fix code.
Agent must on strike 3:
- Stop all commits
- Inspect real state (computed styles, network, console, DOM)
- Document root cause vs expected behavior
- Report to user before any fix code
Escalation Matrix
| Root Cause | Route To |
| Test gap (no regression guard) | test-driven-development |
| Spec gap (requirements missed) | code-review-and-quality |
| Process gap (no quality gate) | doubt-driven-development |
| Architecture gap (design flaw) | architecture-analysis |
| Unknown or recurring after escalation | Full project-health-check + improvement loop |
Anti-Patterns
- Same fix, harder — The definition of insanity. Strike 3 means your approach is wrong.
- Skipping diagnosis — "I know what's wrong" without inspecting. You didn't last 2 times.
- Not escalating — Fixing strike 3 locally when the problem is systemic.
- Ignoring strike log — Strike 3 didn't come from nowhere. The log told you test X was failing.
Verification
- Strike 1: diagnose before fix, evidence documented
- Strike 2: re-diagnose, add regression guard
- Strike 3: BLOCK, escalate to appropriate skill
bash tests/run-all.shpasses after fix
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- adapt-skillSkill
- api-and-interface-designSkill
- architecture-analysisSkill
- audit-skillSkill
- backend-api-masterySkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- clarify-skillSkill
- cli-toolsSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- critique-skillSkill
- customize-opencodeSkill
- debugging-and-error-recoverySkill
- delight-skillSkill
- deprecation-and-migrationSkill
- dev-environment-auditSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- engineering-fundamentalsSkill
- frontend-desktopSkill
- frontend-mobileSkill
- frontend-pwaSkill
- frontend-ui-engineeringSkill
- frontend-webSkill
- fullstack-shippingSkill
- gateSkill
- git-init-and-versioningSkill
- git-workflow-and-versioningSkill
- hard-skillSkill
- idea-refineSkill
- incremental-implementationSkill
- industrial-brutalist-uiSkill
- interview-meSkill
- minimalist-uiSkill
- multi-agent-orchestrationSkill
- observability-and-instrumentationSkill
- optimize-skillSkill
- output-skillSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- polish-skillSkill
- project-health-checkSkill
- project-metricsSkill
- redesign-skillSkill
- security-and-hardeningSkill
- self-improvementSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-improverSkill
- soft-premium-uiSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- typeset-skillSkill
- user-onboardingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

