From python
Enforces a disciplined debugging methodology requiring root cause investigation before any fix, with phases for reproduction, tracing, and verification of technical issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python:oracle-debugThe 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.
Core principle: find root cause before attempting any fix. Symptom fixes are failure.
Violating the letter of this process is violating the spirit of debugging.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
Use for any technical issue:
Use this especially when:
You must complete each phase before proceeding to the next.
Before attempting any fix:
Use the project's domain glossary and ADRs to build a clear mental model of the relevant modules before tracing.
Read error messages carefully. Read the full stack trace, line numbers, file paths, and error codes. Don't skip warnings.
Build a fast feedback loop. If you don't have a fast, deterministic, pass/fail signal for the bug, no amount of code-reading will save you. Spend disproportionate effort here.
Try these in order:
git bisect run)Iterate on the loop: make it faster, sharper, and more deterministic. A 30-second flaky loop is barely better than no loop.
Reproduce the bug. Run the loop. Confirm the failure matches what the user described, is reproducible across runs, and the exact symptom is captured.
Check recent changes. git diff, recent commits, new dependencies, config changes, environment differences.
Trace data flow. In multi-component systems, add diagnostic instrumentation at each boundary:
Run once to gather evidence, then narrow to the failing component.
Trace backward through the call stack. Where does the bad value originate? What called this with the bad value? Trace up until you find the source. Fix at the source, not at the symptom.
The goal is not a clean repro but a higher reproduction rate. Loop the trigger 100×, parallelize, add stress, narrow timing windows, inject sleeps. A 50% flake is debuggable; 1% is not — keep raising the rate until it is.
Stop and say so explicitly. Ask the user for:
Do not proceed to Phase 2 without a loop you believe in.
Find the pattern before fixing.
Use the scientific method.
Generate 3–5 ranked hypotheses. Single-hypothesis generation anchors on the first plausible idea. Each hypothesis must be falsifiable: state the prediction it makes. Show the ranked list to the user before testing — they often have domain knowledge that re-ranks instantly.
Format: "If
<X>is the cause, then<changing Y>will make the bug disappear /<changing Z>will make it worse."
Test one variable at a time. Make the smallest possible change to test the hypothesis.
Instrument mapped to predictions. Each probe must map to a specific prediction. Prefer a debugger/REPL over logs; prefer targeted logs at boundaries over "log everything and grep".
Tag every debug log with a unique prefix, e.g. [DEBUG-a4f2]. Cleanup becomes a single grep.
Performance regressions. Logs are usually wrong. Establish a baseline measurement (timing harness, profiler, query plan), then bisect. Measure first, fix second.
When you don't know, say so. Don't pretend. Ask for help or research more.
Fix the root cause, not the symptom.
Create a failing test case. The simplest possible reproduction. MUST exist before the fix.
A correct seam is one where the test exercises the real bug pattern as it occurs at the call site. If the only available seam is too shallow, note that the codebase architecture is preventing the bug from being locked down.
Implement a single fix. Address the root cause. One change at a time. No "while I'm here" improvements. No bundled refactoring.
Verify the fix. Does the test pass? Do other tests still pass? Does the original repro no longer reproduce?
If the fix doesn't work:
Before declaring done:
[DEBUG-...] instrumentation removedIf you catch yourself thinking:
All of these mean: stop. Return to Phase 1.
| Excuse | Reality |
|---|---|
| "Issue is simple, don't need process" | Simple issues have root causes too. |
| "Emergency, no time for process" | Systematic debugging is faster than thrashing. |
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
| "I'll write the test after confirming the fix" | Untested fixes don't stick. Test first proves the bug. |
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. |
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root cause | Read errors, build loop, reproduce, trace data flow | Understand what and why |
| 2. Pattern analysis | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Failing test, single fix, verify | Bug resolved, tests pass |
After each session, summarize:
## Debug Summary
**Problem:** [One sentence]
**Root Cause:** [What actually was wrong]
**Fix:** [How you fixed it]
**Verification:** [Test results]
**Prevention:** [Regression test added? Architectural finding?]
references/language-tools.mdreferences/bug-patterns.mdreferences/techniques.mdStructure inspired by obra/superpowers systematic-debugging.
npx claudepluginhub martinffx/atelier --plugin codeEnforces systematic root cause investigation for bugs, test failures, and unexpected behavior through four phases: investigation, pattern analysis, hypothesis testing, and implementation.
Systematic debugging methodology for any technical issue: bugs, test failures, unexpected behavior, build failures. Emphasizes root cause investigation before proposing fixes.
Four-phase debugging framework that enforces root cause investigation before fixes. Use for bugs, test failures, or unexpected behavior.