Disciplined debugging methodology for finding root cause before fixing. Triggers on bug reports, test failures, unexpected behavior, build failures, integration issues, or performance regressions.
Ships in atelier. 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.
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: find root cause before a permanent corrective fix. Temporary containment is appropriate when needed to limit security, production, or data-loss impact.
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 when safe. Confirm the failure matches what the user described and capture the exact symptom. When reproduction is unsafe or impossible, use historical artifacts, static evidence, or targeted telemetry instead.
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. Narrow timing windows and vary one condition at a time. Treat added delay or load as a perturbation, not proof. Do not replay state-changing traffic, stress production, or collect sensitive artifacts without explicit authorization and a safe operational plan.
Stop and say so explicitly. Ask the user for:
Do not claim root cause without evidence you can explain. A safe loop is preferred, but artifact-based investigation is valid when a loop is unavailable.
Find the pattern before fixing. Finding working examples across a large codebase can be delegated to a read-only subagent (see Delegation in atelier-orchestrator). Phases 1, 3 and 4 stay in the main thread.
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. Establish a baseline measurement using the least intrusive evidence available, 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. Use the seam and depth vocabulary from oracle-codebase-design when you raise it.
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:
oracle-codebase-design). Discuss with the user before attempting Fix #4.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/bug-patterns.mdreferences/techniques.mdStructure inspired by obra/superpowers systematic-debugging.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugging, root-cause-analysis, bug-hunting, troubleshooting
/atelier:oracle-debugfrom atelier
npx claudepluginhub martinffx/atelier --plugin atelier17 skills in this plugin
/atelier-orchestratorSkill routing and workflow orchestration. Selects Inline Plan or Spec-backed Plan, routes
to the correct workflow skill, and manages transitions between phases. Use when starting
any conversation or task to determine which planning mode and skill apply.
/atelier-setupConfigure a repository for Atelier's development workflow. Use only when explicitly invoked; inspect existing guidance, issue-tracker and domain-document conventions, preview the proposed configuration, and write only after approval. It does not install Atelier or initialize external tooling./code-commitGenerate and validate conventional commit messages following the conventionalcommits.org spec. Use whenever the user wants to commit code, mentions commit messages, git commit, or asks to create a commit. Triggers on "commit", "git commit", "conventional", or when reviewing commit message format./code-handoffCompact the current conversation into a handoff document for another agent to pick up./code-pull-requestManage GitHub pull requests or GitLab merge requests: create, read/leave/respond to comments, and merge. Triggers on "open a PR", "make a PR", "merge this PR", "merge the MR", "read PR comments", "leave a comment on the PR", "respond to a comment", "ship this", or when a feature branch is ready for review.
/code-retroLook back at one branch or PR, find the Corrections the human had to make, and propose ranked Nudges that make the right behaviour the default next time. Proposes in conversation and writes nothing except a report the user approves. Runs only when invoked, before or after merge.
Other plugins' skills for the same job