From claude-corps
Use when facing a bug, test failure, or unexpected behavior that isn't immediately obvious
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-corps:debugThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Iron Law**: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Iron Law: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Before forming hypotheses, collect facts:
git log --oneline -10 -- <file>Known bug patterns — check these first:
| Pattern | Signature |
|---|---|
| Race condition | Intermittent failure, timing-dependent, works in debugger |
| Nil/null propagation | undefined is not a function, NoMethodError, NoneType |
| State corruption | Works first time, fails on second; stale data after mutation |
| Integration failure | Works in isolation, fails with real dependency (DB, API, queue) |
| Configuration drift | Works locally, fails in CI/staging; env var mismatch |
| Stale cache | Old behavior persists after code change; hard refresh fixes it |
| Off-by-one / boundary | Fails at 0, 1, max, or empty input; pagination edge cases |
If the bug matches a known pattern, state which one and focus investigation there.
"5 Whys" drill-down — when the cause isn't obvious, ask why iteratively:
Keep asking why until you reach something you can fix directly.
If 3 hypotheses have failed, STOP. You are likely wrong about the root cause.
Escalation is not failure. Bad work is worse than no work. Stop guessing.
If you catch yourself thinking any of these, STOP:
| Excuse | Reality |
|---|---|
| "Let me try a quick fix first" | Quick fixes without root cause analysis create new bugs. |
| "I know what the problem is" | Then state your hypothesis and predict the test outcome. |
| "It works now after my change" | Correlation is not causation. Verify your fix addresses the root cause. |
| "The test is flaky, not my code" | Reproduce it 3 times. If it fails 2/3, it's your code. |
| "I'll add better error handling" | Error handling hides bugs. Fix the cause, not the symptom. |
After resolution, output a structured report:
═══════════════════════════════════════════
DEBUG REPORT
═══════════════════════════════════════════
Status: DONE / DONE_WITH_CONCERNS / BLOCKED
Symptom: [what was observed]
Root Cause: [what was actually wrong]
Pattern: [known pattern match, if any]
Fix: [what was changed and why]
Regression Test: [test name and what it verifies]
Evidence: [how you confirmed the fix addresses the root cause]
Hypotheses Tested: N (list failed ones if >1)
═══════════════════════════════════════════
If the root cause was non-obvious, save debugging insights to auto-memory.
Evolved from obra/superpowers systematic-debugging skill with patterns from garrytan/gstack and community best practices.
npx claudepluginhub josephneumann/claude-corps --plugin claude-corpsEnforces systematic root cause analysis before fixes for bugs, test failures, unexpected behavior, performance issues, and build failures.
Enforces systematic root cause investigation for bugs, test failures, and unexpected behavior through four phases: investigation, pattern analysis, hypothesis testing, and implementation.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.