systematic-debugging
Originally fromobra/superpowers
SKILL.md
Systematic Debugging
Overview
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
Violating the letter of this process is violating the spirit of debugging.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
When to Use
Use for ANY technical issue:
- Test failures
- Bugs in production
- Unexpected behavior
- Performance problems
- Build failures
The Four Phases
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
- Read Error Messages Carefully - They often contain the exact solution
- Reproduce Consistently - Can you trigger it reliably?
- Check Recent Changes - What changed that could cause this?
- Gather Evidence - Add diagnostic instrumentation in multi-component systems
- Trace Data Flow - See root-cause-tracing.md
Phase 2: Pattern Analysis
- Find Working Examples - Locate similar working code
- Compare Against References - Read reference implementation COMPLETELY
- Identify Differences - List every difference, however small
- Understand Dependencies - What settings, config, environment?
Phase 3: Hypothesis and Testing
- Form Single Hypothesis - "I think X is the root cause because Y"
- Test Minimally - One variable at a time
- Verify Before Continuing - Did it work? If not, NEW hypothesis
- When You Don't Know - Say "I don't understand X"
Phase 4: Implementation
- Create Failing Test Case - Use test-driven-development skill
- Implement Single Fix - ONE change at a time
- Verify Fix - Test passes? No other tests broken?
- If 3+ Fixes Failed - Question the architecture
Red Flags - STOP and Follow Process
- "Quick fix for now, investigate later"
- "Just try changing X and see if it works"
- "I don't fully understand but this might work"
- Proposing solutions before tracing data flow
- "One more fix attempt" (when already tried 2+)
ALL of these mean: STOP. Return to Phase 1.
Common Rationalizations
| Excuse | Reality |
|---|---|
| "Issue is simple" | Simple issues have root causes too. |
| "Emergency, no time" | Systematic debugging is FASTER than thrashing. |
| "Just try this first" | First fix sets the pattern. Do it right. |
| "I see the problem" | Seeing symptoms != understanding root cause. |
Supporting Techniques
- root-cause-tracing.md - Trace bugs backward through call stack
- defense-in-depth.md - Add validation at multiple layers
Weekly Installs
14
Repository
aaaaqwq/claude-…e-skillsGitHub Stars
11
First Seen
14 days ago
Security Audits
Installed on
opencode13
gemini-cli13
github-copilot13
amp13
cline13
codex13