bundles/dev-workflow/skills/systematic-debugging/SKILL.md
Full four-phase root-cause loop — investigate, analyze patterns, hypothesize, implement — for a failure that survived a first pass. Bars any further fix until the cause is proven, counts failed attempts, and turns the third failure into an architecture question. Use when a fix attempt has already failed, the same defect keeps coming back, each fix exposes a new problem elsewhere, or the root cause must be proven before another line changes — including when time pressure makes guessing tempting. `debug` is the front door that hands cases here.
npx skillsauth add shipshitdev/library systematic-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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
debug is the front door for a freshly reported failure — it owns the first
reproduction loop and hands cases here on escalation. The normal arrival carries
its loop, its evidence, and its attempt count. Start at Phase 1 regardless and
re-verify that evidence; an escalated case is escalated precisely because the
earlier read was wrong somewhere.
Enter this loop once a first pass has already been spent on any technical issue — a test failure, a production bug, a performance problem, a build break, an integration fault:
Enter directly, skipping the front door, when:
Complete the whole process even 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.
development
Coordinates a weekly engineering review of board accuracy, recent code changes, operational health, and scoped cleanup. Use for a recurring repository health review or a review of the last several days.
testing
Audits project board configuration and prepares explicitly requested setup, copy, or normalization changes while preserving the existing workflow and provider boundaries. Use when inspecting a board's fields, columns, scope, or configuration.
testing
Reconciles a project board with current work and delivery evidence, reports incomplete coverage and metadata gaps, and applies only approved provider-supported field changes. Use when auditing board drift, reviewing blocked work, or assessing upcoming delivery.
development
Walk through how a subsystem works. Use for "how does X work", code walkthroughs before changing something, and placement or ownership questions. Explains architecture, runtime flow, and onboarding mental models. Can critique architecture. Use why for motivation.