| name | systematic-debugging |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes |
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.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
The Four Phases
Phase 1: Root Cause Investigation
Before attempting ANY fix:
- Read error messages carefully
- Reproduce consistently
- Check recent changes
- Gather evidence in multi-component systems
- Trace data flow
Phase 2: Pattern Analysis
- Find working examples
- Compare against references
- Identify differences
- Understand dependencies
Phase 3: Hypothesis and Testing
- Form single hypothesis
- Test minimally
- Verify before continuing
- If you don't know, say so
Phase 4: Implementation
- Create failing test case
- Implement single fix
- Verify fix
- If fix doesn't work, return to Phase 1
- If 3+ fixes failed, question architecture
Red Flags - STOP and Follow Process
If you catch yourself thinking:
- "Quick fix for now, investigate later"
- "Just try changing X and see if it works"
- "Add multiple changes, run tests"
- "It's probably X, let me fix that"
All of these mean: STOP. Return to Phase 1.
Supporting Techniques
root-cause-tracing.md
defense-in-depth.md
condition-based-waiting.md
Related skills:
test-driven-development
verification-before-completion