cookys/autopilot/debug-sg-red-v12
Claude Code and agent skill by cookys/autopilot
- community
Checking that the SKILL.md file is still in the repository.
Evidence-first debugging for correctness issues. Invoke when diagnosing bugs, crashes, logic errors, data corruption, connectivity problems, intermittent failures (incl. flaky tests with environment divergence), or 'works on my machine' issues. For performance issues (slow / high latency / CPU / memory), use the profiling skill instead. For perf regressions with known change attribution, profiling is still primary — measure first, don't guess from the deploy diff.
Install
npx vskill@latest install cookys/autopilot/debug-sg-red-v12Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cookys/autopilot/debug-sg-red-v12.
Evidence-First Debugging
Routing overlap? If this intent better matches a sibling skill, redirect per references/routing-tiebreaks.md (prefer single-bug diagnosis over baseline test design).
Coexistence with Superpowers
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:
- autopilot:debug is evidence-first (tool → log → code) with explicit Three Red Lines integration and
debug-config.mdproject context injection. Stricter discipline; prescriptive ordering. - superpowers:systematic-debugging is more general-purpose with broader hypothesis-driven framing. Less prescriptive, broader applicability.
<!-- Project-specific config (tool tables, log locations, common commands) --> !cat .claude/debug-config.md 2>/dev/null || echo "No project-specific debug config found. Use generic evidence collection below."
Core Principle
Never guess from code alone. Always collect evidence first.
Available Scripts
| 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 |
Relationship with Profiling
| 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.
Debug Cycle
- Reproduce the issue reliably
- Collect evidence with appropriate tools
- Form hypothesis based on evidence; write it down:
node scripts/decision-ledger.js append --ledger <ledger> --kind hypothesis --json '{"hypothesis_id":"h1","text":"…","status":"open","work_unit":"<task>"}' - Verify hypothesis (don't assume). When it fails, append the same id with
"status":"refuted"and anevidence_refsentry, then runnode 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→ surveyissue-searchwith the exact error string, thennode 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-discusswhen the discuss seat is qualified, elseautopilot:debugger(PUA mode,heterogeneous:false); thennode 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), thennode 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) (areasonofbudget-exhausted/not-heterogeneous/knob-offnames why nothing is recommended)
Ledger: <project>/ledger/decisions.jsonl, or the probe's default ~/.autopilot/ladder/<repo-hash>.jsonl when no project exists.
- Fix root cause (not symptoms)
- Verify fix with same tool + same test
- Record in knowledge base if non-trivial (invoke learn skill)
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.)
Evidence Collection Guide
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 |
Log Query Funnel
- Filter by time range -- narrow to incident window
- Filter by severity -- errors, warnings, panics, exceptions
- Correlate by request -- trace ID, request ID, session context
- Expand context -- surrounding log lines for the correlated events
Anti-Patterns
| 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 |
See Also
learn-- record debugging discoveriesaudit-- systematic comparison for parity issuesprofiling-- performance-specific investigation- `references/probe-playbook.md` -- match symptom against playbook entries (discriminating checks); no match ⇒ escalate per ledger convention
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingevals/skill-onoff/packs/debug-sg-red-v12/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cookys/autopilot/debug-sg-red-v12)