configs/claude-code/skills/systematic-debugging/SKILL.md
Use when a bug or test failure persists after one fix attempt, or for any production bug or multi-component failure
npx skillsauth add jimweller/dotfiles 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.
STARTER_CHARACTER = 🐛
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.
Violating the letter of this process is violating the spirit of debugging.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If Phase 1 is incomplete, no fixes can be proposed.
Use for any technical issue:
Use this especially when:
Do not skip when:
Each phase must be complete before proceeding to the next.
Before attempting any fix:
Read error messages carefully
Reproduce consistently
Check recent changes
Gather evidence in multi-component systems
When the system has multiple components (CI to build to signing, API to service to database):
Before proposing fixes, add diagnostic instrumentation. For each component boundary:
Run once to gather evidence showing where it breaks. Then analyze evidence to identify failing component. Then investigate that specific component.
Example multi-layer instrumentation:
# Layer 1: Workflow
echo "=== Secrets available in workflow: ==="
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
# Layer 2: Build script
echo "=== Env vars in build script: ==="
env | grep IDENTITY || echo "IDENTITY not in environment"
# Layer 3: Signing script
echo "=== Keychain state: ==="
security list-keychains
security find-identity -v
# Layer 4: Actual signing
codesign --sign "$IDENTITY" --verbose=4 "$APP"
This reveals which layer fails (secrets to workflow OK, workflow to build broken).
Trace data flow
When the error is deep in the call stack, see @root-cause-tracing.md in this directory for the complete backward tracing technique.
Quick version:
Find the pattern before fixing.
Find working examples
Compare against references
Identify differences
Understand dependencies
Apply the scientific method.
Form a single hypothesis
Test minimally
Verify before continuing
When stuck
Fix the root cause, not the symptom.
Create failing test case
Implement single fix
Verify fix
If fix does not work
If 3+ fixes failed: question architecture
Patterns indicating an architectural problem:
STOP and question fundamentals:
Discuss with the user before attempting more fixes.
This is not a failed hypothesis, this is a wrong architecture.
Catch these thoughts:
All of these mean: STOP. Return to Phase 1.
If 3+ fixes failed, question the architecture (see Phase 4 step 5).
Watch for these redirections:
When these appear: STOP. Return to Phase 1.
| Excuse | Reality | | ------------------------------------------- | ------------------------------------------------------------------------ | | "Issue is simple, no need for 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" | First fix sets the pattern. Do it right from the start. | | "Write the test after confirming fix works" | Untested fixes do not stick. Test first proves it. | | "Multiple fixes at once saves time" | Cannot isolate what worked. Causes new bugs. | | "Reference too long, adapt the pattern" | Partial understanding guarantees bugs. Read it completely. | | "I see the problem, fix it" | Seeing symptoms is not understanding root cause. | | "One more fix attempt" (after 2+ failures) | 3+ failures means architectural problem. Question pattern, do not retry. |
| 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 | Identify differences | | 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis | | 4. Implementation | Create test, fix, verify | Bug resolved, tests pass |
If systematic investigation reveals the issue is truly environmental, timing-dependent, or external:
But: 95% of "no root cause" cases are incomplete investigation.
These techniques are part of systematic debugging and live in this directory:
Related skills:
testing
Search saved session transcripts for past decisions, actions, errors, and context that has left the current conversation window.
data-ai
Review a PRD for defects via Claude opus subagent.
development
Markdown authoring guidelines for formatting, code blocks, and structure. Use when writing or editing markdown files.
development
--- name: md-style description: README style guide for concise, direct documentation. Use when writing or editing README files. ß--- <!-- markdownlint-disable-file MD041 --> # README Style Guide Write concise, direct README files for experienced engineers. ## Principles - **No fluff** - Skip tables of contents, verbose explanations, development history - **No roadmaps** - Document current state only, not plans or decisions. Readme is an engineering specification. Not a project plan or chan