/superpowers-optimized:systematic-debuggingfrom superpowers-optimized
Enforces hypothesis-driven root cause analysis before fixing bugs, test failures, errors, or performance regressions. No fix without evidence.
Ships in superpowers-optimized. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Do root-cause investigation before proposing fixes.
No fix without evidence for root cause.
This is non-negotiable. Every fix must trace back to a proven root cause. A fix applied without understanding why it works is not a fix — it is a mask.
known-issues.md exists at the project root, search it for the error message, error code, or failing test name.Read the full error output — not just the last line.
Reproduce the bug reliably. If you cannot reproduce, you cannot fix. For tests that fail only in certain orderings (test pollution), run bash find-polluter.sh <marker> <test-pattern> from this skill's directory to identify which test is corrupting shared state. Read its exit code — they are not interchangeable:
| Exit | Meaning |
|---|---|
| 0 | Every matched test ran and none created the marker. A real clean result. |
| 1 | Polluter found; it is named in the output. |
| 2 | The pattern matched no test files. Nothing ran, so nothing was proven — fix the pattern and re-run. Never report this as clean. |
| 3 | The marker already existed before the run. Reset it first; no test can be blamed until you do. |
Check recent changes — what changed since it last worked?
context-snapshot.json exists at the project root: read it. The changed_files and recent_commits fields answer this immediately without additional git commands.git log --oneline -10 and git diff HEAD~1..HEAD --name-only.Add instrumentation (logging, breakpoints) at component boundaries.
Multi-component systems: When the system has multiple components (CI → build → signing, API → service → database), add diagnostic logging at EACH component boundary before proposing fixes:
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
THEN analyze evidence to identify the failing component
THEN investigate that specific component
Example (multi-layer system):
# 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 (e.g., secrets → workflow OK, workflow → build FAILS).
Trace data/control flow backward from the error to its source.
Self-Consistency Gate — Before committing to a hypothesis, apply multi-path reasoning (see self-consistency-reasoner):
Then for the selected hypothesis:
verification-before-completion — a root cause that spanned subsystems earns the full suite;
a one-module fix earns that module's suite.| Temptation | Why it fails |
|---|---|
| "I know what the bug is" | You had a hypothesis, not proof. Test it. |
| "Quick fix, investigate later" | Later never comes. The mask becomes permanent debt. |
| "It's obviously this one line" | Obvious bugs get fixed in 5 minutes. If it were obvious, it would be fixed already. |
| "Let me try a few things" | Shotgun debugging creates new bugs and wastes time. |
| "The error message tells me exactly what's wrong" | Error messages describe symptoms, not causes. |
| "I'll just revert to a known-good state" | Reverts don't teach you what broke or prevent recurrence. |
If 3 fix attempts fail, stop. Do not attempt a fourth. Discuss architecture with the user before continuing. The bug may indicate a design flaw, not a code defect.
If you catch yourself doing any of these, restart from Phase 1:
root-cause-tracing.md — trace bugs backward through the call stackdefense-in-depth.md — validation at every data layercondition-based-waiting.md — replace timeouts with condition pollingAfter resolving a bug:
Recurring error? (environment-dependent, configuration, platform-specific, external-state) → offer to add the error→solution mapping to known-issues.md using the format defined in error-recovery.
Permanent constraint discovered? (API limitation, platform behavior, library quirk that will never change) → offer to add it to project-map.md Critical Constraints section via context-management. These are facts every future session needs, not just error→fix mappings.
self-consistency-reasoner — multi-path reasoning for root cause diagnosistest-driven-development — write the regression test before the fixverification-before-completion — prove the fix with fresh evidenceerror-recovery — consult and update project-specific known issuesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugging, root-cause-analysis, hypothesis-driven, bug-hunting
npx claudepluginhub repozy/superpowers-optimized --plugin superpowers-optimized24 skills in this plugin
/brainstormingUse when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no approved design exists yet. Produces a design before any code is written — in the conversation for small changes, as an approved spec document for larger work. Triggers on: "build this", "add a feature", "I want to change", "how should we", "design", "architect", "new project", "refactor", "we need to add/build/create", "implement a new". Routed by using-superpowers, or invoke directly via /brainstorming.
/claude-md-creatorCreates minimal, high-signal CLAUDE.md and AGENTS.md context files based on empirical best practices. Invoke on /init command, "create CLAUDE.md", "update CLAUDE.md", "write AGENTS.md", or "set up Claude Code for this project". Also invoked by brainstorming when repo lacks a context file. tools: Read, Glob, Grep, Bash, Edit
/context-managementOther plugins' skills for the same job