debugging
Systematic debugging with graded exploration and agent escalation. MUST BE USED when encountering errors, test failures, or unexpected behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Systematic debugging with graded exploration and agent escalation. MUST BE USED when encountering errors, test failures, or unexpected behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide CLAUDE.md updates based on doc-guard suggestions. This skill should be used when updating documentation, fixing docs, addressing doc-guard suggestions, or updating CLAUDE.md. Activates when user requests "update documentation", "fix docs", "doc-guard suggestions", or "update CLAUDE.md".
Monitor blocked workers and help respond to them. Loop checks ft inbox, shows blocked workers, lets you respond naturally.
Adds tasks to FormalTask with mandatory discovery and validated criteria. Use when "add task", "create task", or "/task-add". For batch creation, use /epic-decompose instead.
Groups uncommitted changes into logical commits, walks through each grouping for approval, then optionally syncs with remote. Resolves merge conflicts interactively with context from recent remote and local history. Use when "commit my changes", "group commits", "smart commit", "commit and sync", or "organize my changes". Never resolves conflicts without user confirmation.
Unified critique for plans, specs, OR task artifacts. Auto-detects target. Spawns auditors. Commits tasks to DB when READY. Use "critique", "review", "is this ready".
Decompose plan -> specs OR specs -> tasks. Auto-detects stage. Use when "decompose", "break down", or after /critique APPROVED. For initial planning, use /plan instead.
| name | debugging |
| description | Systematic debugging with graded exploration and agent escalation. MUST BE USED when encountering errors, test failures, or unexpected behavior. |
| required_todos | ["meta-analysis","quick-investigation","systematic-analysis","deep-trace","pre-commit-adversarial","commit-checkpoint"] |
BLOCKING GATE: Error or unexpected behavior exists.
quick: State the error and 2 hypotheses in plain text. Skip XML.
full: Before touching code, understand the problem conceptually:
<meta_analysis>
<symptom>[Exact error message and location]</symptom>
<surface_interpretation>[What this error literally means]</surface_interpretation>
<deeper_question>[What STATE is invalid? Not "what line failed" but "what assumption was violated"]</deeper_question>
<misdirection_risk>[Ways I could waste time—staring at symptom location when bug is upstream]</misdirection_risk>
<root_cause_hypotheses>[2-3 possible root causes BEFORE looking at code]</root_cause_hypotheses>
</meta_analysis>
EXIT CRITERIA: Hypotheses formed. Now investigate with direction.
BLOCKING GATE: Meta-analysis complete with hypotheses.
full: Use sequential reasoning to test hypotheses:
<sequential>
<thought id="T1">[Test first hypothesis - evidence for/against]</thought>
<thought id="T2" builds="T1">[What T1 implies about second hypothesis]</thought>
<revision revises="T1" reason="[if evidence contradicts]">[Updated understanding]</revision>
</sequential>
If root cause found → fix it and stop.
EXIT CRITERIA: Either fixed, or need deeper investigation.
BLOCKING GATE: Phase 1 didn't solve it.
quick: Trace caller vs callee yourself. Check both paths, report findings inline.
full: When uncertain which layer has the bug, use branching:
<branching>
<fork point="Bug in caller or callee?"/>
<path id="caller">[Trace upward—who passed bad data? What state was wrong?]</path>
<path id="callee">[Trace inward—what assumption violated? What edge case?]</path>
<converge when="[Evidence showing which path has the source]"/>
</branching>
full: Spawn debug-specialist agent:
Task(
subagent_type="debug-specialist",
description="Investigate: [error summary]",
prompt=f"""Error: {error_message}
Context: {what_was_happening}
Already checked: {phase_1_findings}
Hypotheses from meta-analysis: {hypotheses}
Find root cause. Report back with:
- Reproduction steps
- Root cause with file:line evidence
- Recommended fix"""
)
If root cause found → write failing test, fix, verify.
EXIT CRITERIA: Either fixed, or need cross-file tracing.
BLOCKING GATE: Phase 2 didn't solve it.
Spawn code-analyzer for cross-file flow tracing:
Task(
subagent_type="code-analyzer",
description="Trace: [error] through call chain",
prompt=f"""Error occurs at: {location}
Trace backward through call chain to find original trigger.
For each level:
- What function called this?
- What parameters were passed?
- Where did those values come from?
Find the SOURCE of the problem, not where it manifests."""
)
If you have a theory but aren't sure:
Task(
subagent_type="claim-verifier",
description="Verify: [hypothesis]",
prompt=f"""Hypothesis: {your_theory}
Verify with evidence. Find file:line proof that confirms or refutes."""
)
BLOCKING GATE: Fix implemented.
Before committing, assume the fix will fail:
<adversarial>
<future_state>6 months later. This "fix" regressed or caused new bugs.</future_state>
<failure>[What went wrong—the fix was too narrow, missed edge case, broke something else]</failure>
<cause>[What we should have caught before committing]</cause>
<prevent>[Additional test or change that blocks this failure]</prevent>
</adversarial>
quick: State "Fixed [error] because [root cause]. Test: [test name or N/A]." Done.
full:
BLOCKING GATE: Adversarial check complete.
<checkpoint>
<verify>Does fix address ROOT CAUSE from meta_analysis hypotheses? [YES/NO + evidence]</verify>
<verify>Test covers the specific failure mode? [YES/NO]</verify>
<conclusion>[Commit message explaining WHY this fixes it]</conclusion>
<flips_if>[What symptom would indicate this fix is wrong]</flips_if>
</checkpoint>
- Root cause before fixes - symptom fixes are failure
- Escalate without asking - speed matters
- 3 fix limit - after 3 failures, stop and question architecture
- Test first on real fixes - write failing test before implementing
- Never mask problems - no defaults or guards at symptom site
- Re-run original failure before commit - test fixtures lie