systematic-debugging
Four-phase debugging framework that enforces root cause investigation before attempting any fixes - turning hours of thrashing into 15-minute resolutions.
Core Principle
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Random fixes waste 2-3 hours thrashing. Systematic investigation takes 15-30 minutes and achieves 95% first-time fix rate. If you donât understand the root cause, youâre guessing - and guessing introduces new bugs.
When to Use
Always use for ANY technical issue:
- Test failures, bugs in production, unexpected behavior
- Performance problems, build failures, integration issues
Especially when:
- Under time pressure (systematic is FASTER than random)
- âQuick fixâ seems obvious (usually wrong)
- Youâve tried multiple fixes already
- You donât fully understand the issue
The Process
1. Root Cause Investigation (REQUIRED FIRST)
Read error messages carefully - Stack traces often contain exact solution Reproduce consistently - Can you trigger it reliably? If not, gather more data first Check recent changes - Git diff, dependencies, config changes Gather evidence - Add diagnostic logging at component boundaries, trace data flow Trace to source - Where does bad value originate? Fix source, not symptom
2. Pattern Analysis
Find working examples - Locate similar working code in codebase Compare references - Read reference implementation COMPLETELY, understand fully Identify differences - List every difference, donât assume âthat canât matterâ Check dependencies - What components, settings, config, environment needed?
3. Hypothesis Testing
Form single hypothesis - âI think X because Yâ (specific, not vague) Test minimally - SMALLEST possible change, one variable at a time Verify before continuing - Worked â Phase 4. Didnât work â NEW hypothesis (donât stack fixes) Count attempts - If 3+ fixes failed â STOP, question architecture
4. Implementation
Create failing test - Simplest reproduction, automated if possible (MUST have before fixing) Implement single fix - Address root cause, ONE change, no âwhile Iâm hereâ improvements Verify completely - Test passes? No other tests broken? Issue actually resolved?
Common Use Cases
Senior Backend Dev: Test Suite Failing After Dependency Update
âUse systematic-debugging to investigate test failures: Read error messages completely, check what dependency changed, reproduce locally, trace data flow to find where new version breaks contract, create minimal failing test, fix root causeâ
Frontend Engineer: Button Click Not Working
âUse systematic-debugging for button not responding: Check browser console for errors, verify event handler attached, trace click event flow, compare with working buttons, identify missing handler or binding issueâ
DevOps Engineer: Production API Returning 500 Errors
âUse systematic-debugging for production 500s: Gather error logs, reproduce in staging, check recent deployments, analyze error patterns, trace request flow through services, identify failing component, fix at sourceâ
Full-Stack Dev: Slow Page Load Performance
âUse systematic-debugging to investigate slow page loads: Measure actual load time, check network waterfall, analyze bundle size, profile JavaScript execution, identify bottleneck, test optimization, verify improvementâ
Integration Specialist: Third-Party API Integration Failing
âUse systematic-debugging for API integration: Log request/response at boundary, verify data format matches contract, compare with working examples, check both sides of integration, trace to source of mismatchâ
Pro Tips
Red flags to STOP immediately:
- âQuick fix for nowâ â Sets bad precedent
- âJust try changing Xâ â Random guessing
- âAdd multiple changesâ â Canât isolate what worked
- âSkip the testâ â Untested fixes donât stick
- âOne more fixâ (after 2+) â Architecture problem
If 3+ fixes failed: Donât try more fixes. Each failure revealing new problem = architectural issue. Question fundamentals before continuing.
Emergency = MORE systematic: Time pressure makes random fixes tempting, but systematic is 8-12x faster than thrashing.
Not activating? Say: âUse systematic-debugging skill to investigate this issue - follow the four phases starting with root cause investigationâ
Related Skills
- debugging - General debugging skill
- problem-solving - Structured problem solving
- sequential-thinking - Step-by-step analysis
Key Takeaway
Systematic debugging converts 2-3 hours of random fix attempts into 15-30 minutes of focused investigation. Always investigate root cause first, fix once, move on. If 3+ fixes fail, stop and question architecture - donât keep trying.