From shipshitdev-library
Enforces root-cause investigation before any fix using a four-phase methodology: investigate, analyze patterns, hypothesize, implement. Use for bugs, test failures, unexpected behavior, or performance regressions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/shipshitdev-library:systematic-debuggingWhen to use
bug, broken, not working, test failing, unexpected behavior, regression, fix not working, keeps breaking, investigate, diagnose
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
If Phase 1 is not complete, no fix may be proposed.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Use for ANY technical issue:
Use this ESPECIALLY when:
Do not skip when:
Complete each phase before proceeding to the next.
Before attempting ANY fix:
1. Read error messages carefully.
2. Reproduce consistently.
3. Check recent changes.
4. Gather evidence in multi-component systems.
When a system has multiple components (e.g., API → service → database, CI → build → signing):
Before proposing any fix, add diagnostic instrumentation at each component boundary:
For EACH component boundary:
- Log what data enters the component
- Log what data exits the component
- Verify environment / config propagation
- Check state at each layer
Run once to gather evidence showing WHERE it breaks.
Analyze evidence to identify the failing component.
Then investigate that specific component.
Example instrumentation pattern:
# Layer 1: entry point
echo "=== Input at layer 1: ${VAR:+SET}${VAR:-UNSET} ==="
# Layer 2: downstream component
echo "=== Env vars reaching layer 2: ==="
env | grep VAR || echo "VAR not in environment"
# Layer 3: leaf operation
echo "=== State at layer 3: ==="
# inspect relevant runtime state here
This reveals which layer fails (e.g., value passes layer 1 but is missing at layer 2).
5. Trace data flow.
When an error is deep in a call stack:
Find the pattern before fixing:
Apply scientific method:
Fix the root cause, not the symptom:
Create a failing test case — the simplest possible reproduction — automated if a test framework exists, a one-off script otherwise. This must exist before the fix is written.
Implement a single fix. Address the identified root cause. One change at a time. No "while I'm here" improvements or bundled refactoring.
Verify the fix.
If the fix does not work:
If 3+ fixes have failed — question the architecture.
Signs of an architectural problem:
Stop and question fundamentals:
Discuss with the user before attempting any further fixes. This is not a failed hypothesis — it is a wrong architecture.
If any of these thoughts arise, stop immediately:
All of these mean: STOP. Return to Phase 1.
If 3+ fixes have failed: question the architecture (Phase 4, step 5).
| Excuse | Reality |
|---|---|
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
| "Emergency, no time for process" | Systematic debugging is faster than guess-and-check thrashing. |
| "Just try this first, then investigate" | The first fix sets the pattern. Do it right from the start. |
| "I'll write the test after confirming the fix works" | Untested fixes do not stick. A test first proves it. |
| "Multiple fixes at once saves time" | Cannot isolate what worked. Causes new bugs. |
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
| "I see the problem, let me fix it" | Seeing symptoms does not equal understanding root cause. |
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question the pattern, do not fix again. |
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare against broken | Differences identified |
| 3. Hypothesis | Form specific theory, test minimally | Confirmed or new hypothesis formed |
| 4. Implementation | Create failing test, apply single fix, verify | Bug resolved, tests pass |
If systematic investigation genuinely reveals the issue is environmental, timing-dependent, or fully external:
Note: 95% of "no root cause found" cases are incomplete investigation. Exhaust Phase 1 fully before concluding this.
npx claudepluginhub shipshitdev/skillsProvides a four-phase framework (root cause investigation, pattern analysis, hypothesis testing, implementation) for systematically debugging bugs, test failures, and unexpected behavior.
Enforces root-cause investigation before any fix. Guides through four phases: evidence gathering, pattern analysis, hypothesis testing, and implementation.
Provides four-phase debugging framework prioritizing root cause investigation before fixes. Use for bugs, test failures, unexpected behavior, performance issues, build failures.