debugging-process
Provides systematic debugging methodology for thorough root cause analysis with evidence-based investigation. Use this skill when investigating code, analyzing bugs, tracing errors, or understanding unexpected behavior.
When & Why to Use This Skill
This Claude skill provides a systematic debugging methodology designed for thorough root cause analysis through evidence-based investigation. By implementing the '5 Whys' technique and enforcing real-time reporting with precise file and line references, it helps developers move beyond surface-level symptoms to identify and fix the actual source of software errors. It promotes a logical, transparent troubleshooting process that eliminates guesswork and prevents common anti-patterns like superficial null-checks or unexplained try-catch blocks.
Use Cases
- Case 1: Investigating complex application crashes or runtime exceptions by tracing the causal chain back to the original state or data initialization error.
- Case 2: Analyzing unexpected UI behaviors and race conditions by systematically verifying component lifecycles and API response timing with documented evidence.
- Case 3: Debugging logic flaws in legacy codebases where understanding the 'why' behind a failure is critical before applying any structural changes.
- Case 4: Resolving intermittent bugs or 'heisenbugs' by following a disciplined investigation pattern that relies on progressive evidence rather than trial-and-error fixes.
| name | debugging-process |
|---|---|
| description | Provides systematic debugging methodology for thorough root cause analysis with evidence-based investigation. Use this skill when investigating code, analyzing bugs, tracing errors, or understanding unexpected behavior. |
Debugging Process
Instructions
Core Principles
- Real-Time Reporting: Share findings immediately with
file:linereferences. Report "Checking [X] at [location]" → "Found [Y], suggests [Z]" - Root Cause First: Use 5 Whys technique. Fix the source, not symptoms.
Investigation Pattern
1. "Investigating [X] by checking [Y]"
2. "Found [this] at [location:line]. Suggests [interpretation]"
3. "Based on this, checking [next location]"
4. Root cause identified → Apply fix
Anti-Patterns
- Adding try-catch without understanding why it throws
- Null-checks everywhere instead of understanding cause
- Guessing solutions (e.g., setTimeout hoping it helps)
- Presenting only conclusions without evidence
DO / DON'T
DO: Use file:line references, share evidence progressively, trace to origin, explain causal chain
DON'T: Rush to fix, hide investigation process, fix symptoms not causes
Examples
5 Whys Example
Problem: App crashes on submit
Why? → Exception in validation
Why? → Receives null value
Why? → Form data not initialized
Why? → Component mounts before API response
Why? → Race condition
→ Fix: Correct initialization order