debug
Use when encountering bugs, test failures, or unexpected behavior - find root cause before fixing
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Systematic Debugging
The Rule
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Four Phases
Phase 1: Investigate
- Read error messages completely - They often contain the solution
- Reproduce consistently - Can you trigger it reliably?
-
Check recent changes -
git diff, what changed? - Trace data flow - Where does the bad value come from?
Phase 2: Find Pattern
- Find working similar code in codebase
- Compare working vs broken
- List every difference
Phase 3: Hypothesis
- Form ONE hypothesis: "I think X because Y"
- Make smallest possible change to test it
- If wrong, form NEW hypothesis (don't pile fixes)
Phase 4: Fix
- Write failing test that reproduces bug
- Implement single fix for root cause
- Verify test passes
- Verify no other tests broke
Red Flags
If thinking:
- "Quick fix, investigate later" - STOP
- "Just try changing X" - STOP
- "I don't understand but this might work" - STOP
Return to Phase 1.
3+ Fixes Failed?
If you've tried 3+ fixes without success:
- STOP attempting more fixes
- Question the architecture
- Ask your orchestrator for guidance
Quick Reference
| Phase | Do | Confirm |
|---|---|---|
| Investigate | Read errors, reproduce, check changes | Understand WHAT and WHY |
| Pattern | Find working example, compare | Know the difference |
| Hypothesis | Single theory, minimal test | Confirmed or rejected |
| Fix | Test first, single fix, verify | Bug gone, tests pass |
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!