/autopilot:debugfrom autopilot
Evidence-first debugging methodology for correctness bugs, crashes, and flaky tests. Collects tool evidence before forming hypotheses, with decision ledger tracking.
Ships in autopilot. 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.
None: SKILL.md is the whole skill.
Routing overlap? If this intent better matches a sibling skill, redirect per references/routing-tiebreaks.md (prefer single-bug diagnosis over baseline test design).
This skill is autopilot's standalone fallback for debugging methodology. If the superpowers plugin is installed, you may prefer superpowers:systematic-debugging — both work; .claude/dispatch-config.md's ## Debugging chain controls which one orchestrator skills (ceo-agent / finish-flow / quality-pipeline) dispatch.
Differences worth knowing:
debug-config.md project context injection. Stricter discipline; prescriptive ordering.!cat .claude/debug-config.md 2>/dev/null || echo "No project-specific debug config found. Use generic evidence collection below."
1. Tool-collected evidence -> profiler, logs, EXPLAIN, debugger, DevTools
2. Log analysis -> correlate with tool findings
3. Source code analysis -> informed by evidence from 1 + 2
Never guess from code alone. Always collect evidence first.
| Script | Replaces LLM-judgment for | When invoked |
|---|---|---|
scripts/probe-unknown.js | Count refuted hypotheses and the other ladder signals; recommend one rung (U0–U4) | Step 4, after every refuted hypothesis |
scripts/dispatch-consult.sh | Ask the consult seat one bounded question, advice only; --ladder-receipt stamps the U1 row | Step 4, only on recommend: U1 |
scripts/decision-ledger.js | append --kind hypothesis — every hypothesis and its refutation as a ledger row (the S1 counter) | Steps 3–4 |
| Skill | When to Use |
|---|---|
| debug | Correctness: crashes, bugs, logic errors, data corruption, connectivity |
| profiling | Performance: slow queries, high memory, CPU spikes, latency |
If unsure, start with debug. If evidence points to a performance root cause, switch to profiling.
node scripts/decision-ledger.js append --ledger <ledger> --kind hypothesis --json '{"hypothesis_id":"h1","text":"…","status":"open","work_unit":"<task>"}'"status":"refuted" and an evidence_refs entry, then run node scripts/probe-unknown.js classify --ledger <ledger> --work-unit <task> --terms <error nouns> and act only on recommend (the probe counts the refutations — the "after two failed hypotheses" rule is its S1 threshold, not a rule you police by memory):
U1 → bash scripts/dispatch-consult.sh --question-file <q> --artifact <a> --ladder-receipt <ledger> --ladder-terms <terms> --ladder-unknown-type why --ladder-signals S1 --ladder-work-unit <task> (advice only, never a verified fix)U2 → survey issue-search with the exact error string, then node scripts/probe-unknown.js receipt --ledger <ledger> --rung U2 --unknown-type why --terms <terms> --signals S1 --work-unit <task>U3 → a panel on the rail classify names: dispatch-discuss when the discuss seat is qualified, else autopilot:debugger (PUA mode, heterogeneous:false); then node scripts/probe-unknown.js receipt --ledger <ledger> --rung U3 --unknown-type why --terms <terms> --signals S1 --work-unit <task> --rail <rail> --families <a,b> (non-heterogeneous: add --heterogeneous false, no --reason)U4 → an experiment: a spike in a throwaway worktree that tests the leading hypothesis (only recommended after a U2 receipt with S1 or S4 still present), then node scripts/probe-unknown.js receipt --ledger <ledger> --rung U4 --unknown-type why --terms <terms> --signals S1 --work-unit <task> --question <q> --criterion <c> --result pass|fail|inconclusivenone → keep verifying (the probe never recommends U5; when you stop for the owner, that is U5 — show the ledger) (a reason of budget-exhausted / not-heterogeneous / knob-off names why nothing is recommended)
Ledger: <project>/ledger/decisions.jsonl, or the probe's default ~/.autopilot/ladder/<repo-hash>.jsonl when no project exists.3-fix architecture gate. If 3 fix attempts have failed, STOP attempting fix #4 — the repeated failure is itself evidence that the mental model of the architecture is wrong, not that the next tweak is the right one. Step back and question the structure: is the bug where you think it is? Is a component boundary / assumption (data shape, ordering, ownership, environment) violated upstream of where you're patching? Re-collect evidence at the boundary above the suspected site before any further fix. (Changing a flag/parameter is not a new attempt; changing the diagnostic angle is.)
Identify the right tools for your problem category. If your project has a debug-config.md, it will list specific commands. Otherwise, use this generic guide:
| Problem Category | What to Look For | Generic Tool Examples |
|---|---|---|
| Crash / panic | Stack trace, exit code, core dump | Debugger (gdb/lldb), backtrace env vars, crash logs |
| Logic error | Wrong output, unexpected state | Breakpoints, print/log statements, unit test isolation |
| Data corruption | Bad values in storage, schema mismatch | DB query tools, EXPLAIN plans, data validation scripts |
| Connectivity | Timeout, refused, DNS failure | curl, netcat, ping, tcpdump, browser Network tab |
| Auth / permissions | 401/403, token expiry, role mismatch | Token decode tools, request headers, auth middleware logs |
| Build / compile | Error messages, missing deps | Build tool verbose mode, dependency tree, clean rebuild |
| State / concurrency | Race condition, deadlock, stale cache | Thread dumps, lock analysis, cache inspection |
| Anti-Pattern | Fix |
|---|---|
| Guessing from code without evidence | Collect tool evidence first |
| Changing code to "see what happens" | Form hypothesis, then verify |
| Fixing symptoms instead of root cause | Trace the full causal chain |
| Ignoring intermittent failures | Reproduce under controlled conditions |
| Assuming "works on my machine" | Check environment differences |
learn -- record debugging discoveriesaudit -- systematic comparison for parity issuesprofiling -- performance-specific investigationreferences/probe-playbook.md -- match symptom against playbook entries (discriminating checks); no match ⇒ escalate per ledger conventionWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugging, bug-hunting, flaky-tests, evidence-first, decision-ledger
32 skills in this plugin
/agent-callContact an already-running persistent coding-agent session via fleet v2 (fallback: Claude SendMessage + outbox). Use when: "通知 <host>", "跟 <host> 說", naming a fleet member/pane. Not for: opinions (→ consult), hetero review (→ hetero-review), new workers (→ /l4–/l6).
/auditCompare two existing implementations for feature parity and missing items. Use when: "compare X with Y", "verify X matches Y", "比對 X 和 Y". Not for: future plan review, single-bug debug, writing tests.
/brainstormPre-code Socratic design exploration that surfaces 2-3 approaches and gates coding until approved. Use when: "help me think through X", "還沒想清楚", "我不確定要怎麼做". Not for: existing options (→ think-tank), external research (→ survey), chosen approach/quick fix (→ dev-flow).
npx claudepluginhub cookys/autopilot --plugin autopilotOther plugins' skills for the same job