systematic-debugging
它能做什么
这项技能让你的 AI 以有计划的方式调查错误,而不是凭猜测进行快速修补。适合遇到测试失败、生产环境错误或异常行为的开发者。
适用场景
- ✓测试失败或程序行为异常,而原因不明的时候。
- ✓某个快速修复已经失败,你需要了解真正问题的时候。
- ✓构建失败或集成出错,你希望先找到根本原因的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/systematic-debugging/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“登录页面只在生产环境中出错,我尝试的快速修复都没有效果。在我们改动任何东西之前,请帮我找出根本原因。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能让你的 AI 先编写一个能展示问题的快速测试,然后收集证据并提出理论。只有在根本原因得到确认之后,才提出并测试修复方案。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Systematic Debugging
Overview
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
Violating the letter of this process is violating the spirit of debugging.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
The Feedback Loop Rule
The feedback loop is the debugging work. Before reading code to build a theory, create or identify a tight command that can go red on the user's exact symptom and green when the bug is fixed. A tight loop is fast, deterministic, agent-runnable, and specific enough to catch this bug — not merely "doesn't crash".
When a clean repro is hard, spend disproportionate effort building the loop. Guessing without a red-capable loop is the failure mode this skill exists to prevent.
When to Use
Use for ANY technical issue:
- Test failures
- Bugs in production
- Unexpected behavior
- Performance problems
- Build failures
- Integration issues
Use this ESPECIALLY when:
- Under time pressure (emergencies make guessing tempting)
- "Just one quick fix" seems obvious
- You've already tried multiple fixes
- Previous fix didn't work
- You don't fully understand the issue
Don't skip when:
- Issue seems simple (simple bugs have root causes too)
- You're in a hurry (rushing guarantees rework)
- Someone wants it fixed NOW (systematic is faster than thrashing)
The Four Phases
You MUST complete each phase before proceeding to the next.
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
1. Read Error Messages Carefully
- Don't skip past errors or warnings
- They often contain the exact solution
- Read stack traces completely
- Note line numbers, file paths, error codes
Action: Use read_file on the relevant source files. Use search_files to find the error string in the codebase.
2. Build a Tight Feedback Loop
- Can you trigger the user's exact symptom with one command?
- Does the command fail for this bug and only pass once the bug is fixed?
- Is it fast enough to run repeatedly?
- Is it deterministic? For flaky bugs, can you raise the reproduction rate high enough to debug?
- If not reproducible → gather more data, don't guess.
Ways to construct a loop — try in roughly this order:
- Failing test at the seam that reaches the bug: unit, integration, or end-to-end.
- HTTP script / curl against a running dev server.
- CLI invocation with fixture input, diffing stdout/stderr against expected output.
- Headless browser script (Playwright/Puppeteer) asserting on DOM, console, or network.
- Replay a captured trace: HAR, request payload, event log, queue message, or webhook body.
- Throwaway harness that boots the smallest useful slice of the system and calls the failing path.
- Property / fuzz loop when the bug is intermittent wrong output over a broad input space.
- Bisection harness suitable for
git bisect runwhen the bug appeared between two known states. - Differential loop comparing old vs new version, two configs, two providers, or two datasets.
- Human-in-the-loop script only as a last resort: script the human steps and capture their result so the loop stays structured.
Tighten the loop once it exists:
- Make it faster: cache setup, narrow scope, skip unrelated initialization.
- Make the signal sharper: assert the exact symptom, not generic success.
- Make it more deterministic: pin time, seed randomness, isolate filesystem, freeze network.
For non-deterministic bugs, the immediate goal is a higher reproduction rate, not perfection. Run the trigger 100x, parallelize, add stress, narrow timing windows, or inject sleeps. A 50% flake is debuggable; a 1% flake usually is not.
Action: Use the terminal tool to run the tight loop:
# Run a specific failing test
pytest tests/test_module.py::test_name -v
# Or run a scripted repro
python scripts/repro_bug.py
# Or run a high-repetition flaky repro
for i in {1..100}; do pytest tests/test_flake.py::test_name -q || break; done
3. Check Recent Changes
- What changed that could cause this?
- Git diff, recent commits
- New dependencies, config changes
Action:
# Recent commits
git log --oneline -10
# Uncommitted changes
git diff
# Changes in specific file
git log -p --follow src/problem
常见问题
为什么不直接尝试快速修复?
技能说明随意修复会浪费时间,还可能引入新的错误,因此应先找到根本原因。
什么是反馈循环?
技能将其描述为一条快速命令:错误存在时它失败,修复后则通过。
它适用于简单的错误吗?
技能说明即使是简单的错误也应遵循这一流程,因为它们可能掩盖真正的原因。
详情
热度
- GitHub 星标
- 260k
- 排名
- #625
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。