systematic-debugging
它能做什么
这个工具可以帮你找到技术问题的根本原因,比如程序报错或行为异常。它会引导你先调查,再动手修复,确保问题真正解决,而不是只做临时遮掩。
适用场景
- ✓程序出现你看不懂的错误时。
- ✓你已经尝试修复好几次都没有成功时。
- ✓在紧急情况下,人很容易想要快速打补丁时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/systematic-debugging/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的代码在保存文件时出现了奇怪的错误,应该怎么调查根本原因?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具建议按照有条理的步骤来:首先,弄清楚错误内容,并想办法重现它;然后,检查最近有哪些改动。接下来,再提出假设,并用尽可能小的改动来验证原因。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Systematic Debugging
Overview
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: Investigate before guessing and separate a verified repair from a temporary mitigation. During an incident, an authorized rollback or containment action may restore service while root-cause work continues.
Violating the letter of this process is violating the spirit of debugging.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Start with the observable failure and the smallest useful evidence check. Label any emergency mitigation explicitly and preserve evidence for the later root-cause investigation.
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)
- Manager 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:
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
Reproduce Consistently
- Can you trigger it reliably?
- What are the exact steps?
- Does it happen every time?
- If not reproducible → gather more data, don't guess
Check Recent Changes
- What changed that could cause this?
- Git diff, recent commits
- New dependencies, config changes
- Environmental differences
Gather Evidence in Multi-Component Systems
WHEN system has multiple components (CI → build → signing, API → service → database):
BEFORE proposing fixes, add diagnostic instrumentation:
For EACH component boundary: - Record allowed field names, sizes, statuses and correlation IDs - Redact secrets and private payloads before logging - Verify environment/config propagation - Check state at each layer Run once to gather evidence showing WHERE it breaks THEN analyze evidence to identify failing component THEN investigate that specific componentExample (multi-layer system):
# In each relevant process, report presence only; never dump secret values. if [ -n "${IDENTITY:-}" ]; then echo 'IDENTITY is set' else echo 'IDENTITY is absent or empty' fi # Read-only validation of an already-built artifact, when available. codesign --verify --verbose=2 "$APP"Interpretation: Compare presence checks at the actual workflow/build boundaries. Artifact verification does not itself prove that the correct signing identity propagated.
Trace Data Flow
WHEN error is deep in call stack:
See
root-cause-tracing.mdin this directory for the complete backward tracing technique.Quick version:
- Where does bad value originate?
- What called this with bad value?
- Keep tracing up until you find the source
- Fix at source, not at symptom
Phase 2: Pattern Analysis
Find the pattern before fixing:
Find Working Examples
- Locate similar working code in same codebase
- What works that's similar to what's broken?
Compare Against References
- If implementing pattern, read reference implementation COMPLETELY
- Don't skim - read every line
- Understand the pattern fully before applying
Identify Differences
- What's different between working and broken?
- List every difference, however small
- Don't assume "that can't matter"
Understand Dependencies
- What other components does this need?
- What settings, config, environment?
- What assumptions does it make?
Phase 3: Hypothesis and Testing
Scientific method:
Form Single Hypothesis
- State clearly: "I think X is the root cause because Y"
- Write it down
- Be specific, not vague
Test Minimally
- Make the SMALLEST possible change to test hypothesis
- One variable at a time
…
常见问题
为什么不能直接试一个快速修复?
快速修复可能会掩盖真正的问题,还可能引入新的 bug,最终反而花费更多时间。调查根本原因,才能得到持久的解决方案。
什么是“根本原因”?
它是问题发生的根本原因。只处理表面现象(也就是可见的错误)是不够的,根本原因才是源头问题,修好它,错误才不会再次出现。
如果问题涉及系统的多个部分怎么办?
工具会建议检查各部分之间的通信,并在每个“边界”(即一个部分与另一个部分交互的地方)记录信息,从而找出故障最先出现的位置。
详情
作者的原始描述
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
热度
- GitHub 星标
- 48k
- 排名
- #5918
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。