From ai-agents
四阶段根因分析:调查、模式分析、假设测试、修复。铁律:没有根因就没有修复。禁止猜测性修复和症状压制。触发短语:"调试"、"debug"、"排查"、"根因"。
npx claudepluginhub stringke/ai-agents --plugin ai-agentsThis skill is limited to using the following tools:
用结构化的四阶段流程定位和修复问题的根因。拒绝猜测性修复和症状压制。
Guides systematic debugging in 4 stages—root cause investigation, pattern analysis, hypothesis validation, targeted fixes—for bugs, test failures, builds, performance, and integrations before proposing solutions.
Implements four-phase debugging framework: root cause investigation, pattern analysis, hypothesis testing, implementation. For bugs, test failures, unexpected behavior when root cause unknown.
Applies four-phase framework (root cause investigation, pattern analysis, hypothesis testing, implementation) to debug bugs, test failures, performance issues, and unexpected behavior before fixes.
Share bugs, ideas, or general feedback.
用结构化的四阶段流程定位和修复问题的根因。拒绝猜测性修复和症状压制。
没有根因就没有修复。
如果你无法清晰说出"问题的原因是 X,因为 Y",就不要开始写修复代码。
目标:收集事实,理解问题的完整表现。
# 有用的调查命令
git log --oneline -20 # 最近提交
git log --all --oneline -- path/to/file # 文件变更历史
git bisect start HEAD known-good-commit # 二分定位
产出:一份事实清单,不含任何推测。
详细的根因追踪方法见 references/root-cause-tracing.md。
目标:从事实中识别模式,缩小怀疑范围。
分析方向:
产出:2 到 3 个可能的根因假设,按可能性排序。
目标:通过实验验证或排除每个假设。
对每个假设:
# 实验方法示例
# 添加诊断日志
# 修改输入数据
# 隔离组件运行
# 对比正常和异常环境的差异
如果 3 个以上的修复尝试失败,停下来质疑架构层面的假设。参考 references/defense-in-depth.md。
产出:确认的根因,附带实验证据。
目标:修复根因,不是掩盖症状。
修复守卫:
在调试过程中,维护一个调试笔记(可以在聊天中,不需要写入文件):
问题:[一句话描述]
事实:
- [事实 1]
- [事实 2]
假设:
1. [假设 1] — 状态:[待验证/已排除/已确认]
2. [假设 2] — 状态:[待验证/已排除/已确认]
实验记录:
- [实验 1]:[结果]
根因:[确认后填写]
references/root-cause-tracing.md:详细的根因追踪方法论references/defense-in-depth.md:多层防御思维references/condition-based-waiting.md:基于条件的等待替代 sleep