ix-debug
Root cause analysis — trace execution path to a failure, narrow candidates, read minimal source only at suspected failure points.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Root cause analysis — trace execution path to a failure, narrow candidates, read minimal source only at suspected failure points.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze system design — structure, coupling, code smells, and high-risk hotspots. Purely graph-based, no code reads.
Generate narrative-first, importance-weighted documentation for a repo, system, or subsystem with a selective reference layer. Use --full for deeper module/class/method coverage.
Route to the right Ix skill or command for your task
Change risk analysis — blast radius, affected systems, and what to test. Depth scales with risk level; low-risk targets stop early.
Deep dive into a symbol, feature, or bug. Graph-first, minimal code reads, early stopping when sufficient evidence found.
Generate a risk-ordered implementation plan for a set of targets. Assesses blast radius per target, finds data flows between them, and produces a safe change sequence.
| name | ix-debug |
| description | Root cause analysis — trace execution path to a failure, narrow candidates, read minimal source only at suspected failure points. |
| argument-hint | <error message, symptom description, or name of failing function> [--save [path]] |
Strip --save and any following path token from $ARGUMENTS before resolving the entry point.
--save <path> is present, set SAVE_PATH to that path.--save is present without a path, auto-generate ix-debug-<target-slug>.md in cwd (target slug = the first symbol or first three words of the symptom with spaces and slashes replaced by -).--save is absent, SAVE_PATH is empty — do not write a file.Call ix_briefing with {}. If ok is true, Pro is available. Extract data.decisions for use in Pro steps below. If it returns ok: false, skip all [Pro] labeled steps.
[Pro] If data.decisions is non-empty, scan for a recorded decision matching this symptom area before proceeding. Surface any relevant match — it may already explain the behavior or constrain the fix.
Answer: where in the execution path is this likely failing, and why? Stop once you have 1–3 root cause candidates with supporting evidence.
Call ix_locate with { "symbol": "<$ARGUMENTS>" }.
If $ARGUMENTS is a symptom description rather than a symbol name, also call ix_text with { "pattern": "<$ARGUMENTS>", "limit": 10 }.
Identify the most likely entry point (where the failure originates or first manifests).
Call ix_explain with { "symbol": "<entry-point>" }.
Extract: role.role, importance.level, facts.callerCount, facts.calleeCount. Identify whether this is:
Stop if: the explanation makes the failure source obvious → skip to Output.
Use the Phase 1–2 results to choose the path:
facts.calleeCount ≤ 10 → continue to Phase 4.facts.calleeCount > 10 → use the Agent tool with subagent_type: "ix-memory:ix-bug-investigator" and pass the pre-computed context below.You MUST pass pre-computed context so the agent skips redundant work. Launch the agent with:
Investigate: $ARGUMENTS
Pre-computed context (skip Steps 1–2): Entry point: [symbol, subsystem, file — from Phase 1] Entity type: [boundary / orchestrator / utility — from Phase 2] Explain output: [paste ix_explain result]
Start from Step 3. The symptom is: [description]. The entry point classification suggests: [hint from Phase 2].
If the Agent tool is unavailable, continue inline through Phases 4–6, reduce breadth, preserve the 2-read cap, and surface uncertainty rather than over-reading.
Call ix_trace with { "symbol": "<entry-point>" }.
Walk the downstream path. At each step, look for:
Narrow: Identify the 1–3 nodes most likely to contain the bug.
Delegate if: the trace crosses subsystem boundaries, reveals multiple plausible contract boundaries, or fans out enough that confidence drops. Use the Phase 3 delegation prompt.
Stop if: trace reveals an obvious candidate → proceed to Phase 6.
Call ix_callers with { "symbol": "<entry-point>" } (limit 10).
Check whether the fault is in how this is called rather than in its own logic.
For each root cause candidate (max 2):
Call ix_read with { "symbol": "<candidate-function>" }.
Read the specific function only. Look for:
Hard limit: 2 ix_read calls maximum. If still ambiguous, surface the candidates and uncertainty to the user.
## Debug: [entry point]
**Execution path:**
[entry-point] → [step] → [step] → [suspected failure point]
**Root cause candidates:**
1. [function/file] — [reason: what assumption might be wrong]
2. [function/file] — [reason]
**Evidence:**
- [what graph data supports each candidate]
- [what code read revealed, if any]
**Confidence:** [high / medium / low] — [why]
**Next steps:**
- Add logging at [specific point] to confirm
- Check [specific edge case] in [function]
- Run `/ix-investigate <X>` to understand [unclear component] more deeply
Only if SAVE_PATH is non-empty:
SAVE_PATH.Saved to <SAVE_PATH>.--save was not passed.