诊断根因
danielvm-git2026-10-27查看 580复制 1452
运行 4 阶段根因分析——复现、隔离、假设、验证。当缺陷已确认但根因不明确时、在 investigate-bug 之后,或用户提到根因分析时使用。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md1115 chars
--- name: diagnose-root model: sonnet description: "Run 4-phase root cause analysis — reproduce, isolate, hypothesize, verify. Use when a bug is confirmed but root cause is unclear, after investigate-bug, or when user mentions root cause analysis." --- # Diagnose Root **Boundary**: Canonical, reusable 4-phase RCA engine. Invoked by `investigate-bug` (as step 2 of the end-to-end flow) and by `fix-bug` (when no bug file exists). Does not write the bug file — that is `investigate-bug`'s responsibility. Four phases — do not skip. Update the active `specs/bugs/BUG-*.md` file at each phase. ## Phases 1. **Reproduce** — minimal steps; record environment; capture logs. 2. **Isolate** — narrow to module/function; binary-search commits or config. 3. **Hypothesize** — list ranked hypotheses with falsification test each. 4. **Verify** — run falsification; confirm single root cause; link to fix plan. > **HARD GATE** — Do not propose a fix until phase 4 confirms one root cause with evidence. ## Verify → verify: `[ "$(grep -lE 'Reproduce' specs/bugs/BUG-*.md 2>/dev/null | grep -cv "\.okf\.md$")" -ge 1 ]`