skills/systematic-debugging/SKILL.md
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
npx skillsauth add nhouseholder/nicks-claude-code-superpowers 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.
ROOT CAUSE FIRST — except for obvious fixes (typos, missing imports, wrong variable names) where the cause IS the fix. For anything non-trivial, complete Phase 1 before proposing fixes.
When the user asks about data quality or correctness, determine whether they want an AUDIT or a FIX:
READ MODE triggers: "check", "audit", "review", "what's wrong with", "look at", "inspect", "verify", "go through each" → First action: READ the existing data/output → Identify specific errors item-by-item → List what's wrong BEFORE proposing any fix → Only THEN suggest the fix approach
FIX MODE triggers: "fix", "run", "regenerate", "re-run", "update", "rebuild", "re-score" → Proceed to Phase 1
DEFAULT: If ambiguous, start in READ MODE. You can always escalate to FIX MODE after identifying specific issues. The reverse wastes the user's time — they asked you to CHECK, not to blindly re-run everything.
Anti-pattern: User says "go through every event table and audit them" → Claude runs the backtester. This skips the audit entirely. The correct response is to open each event table, inspect each cell, list the errors, THEN propose using the backtester to fix them.
Complete each phase before proceeding to the next.
BEFORE attempting ANY fix:
Read Error Messages Carefully — Full stack traces, line numbers, file paths, error codes
Reproduce Consistently — If not reproducible, gather more data, don't guess
Check Recent Changes — Git diff, recent commits, new dependencies, config changes, environmental differences
Gather Evidence in Multi-Component Systems
When system has multiple components (CI → build → signing, API → service → database):
For EACH component boundary:
- Log what data enters/exits component
- Verify environment/config propagation
Run once → analyze evidence → identify failing component → investigate
Trace Data Flow — Trace backwards from the symptom: Where does the bad value originate? Keep tracing up until you find the source. Fix at source, not at symptom.
Create Failing Test Case — Use superpowers:test-driven-development skill
Implement Single Fix — ONE change at a time. No "while I'm here" improvements.
Verify Fix — Test passes? No regressions? Issue resolved?
If Fix Doesn't Work
If 3+ Fixes Failed: Question Architecture
Pattern indicating architectural problem:
STOP and question fundamentals:
If 3+ fixes failed: Question the architecture (Phase 4.5)
Note: qa-gate escalates to Tier 3 on the 2nd failure — earlier than this threshold. QA escalation catches verification gaps; this 3-fix threshold catches architectural problems. Both can fire.
When you see these: STOP. Return to Phase 1.
| 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 investigation reveals issue is environmental, timing-dependent, or external:
95% of "no root cause" cases are incomplete investigation.
tools
Unified context management and session continuity skill. Combines total-recall, strategic-compact, /ledger, and session continuity. Runs in background to preserve critical context across compaction and sessions.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
tools
Suggest /ultraplan for complex planning tasks on Claude Code CLI (2.1.91+ only). Research preview.
tools
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.