跳到正文
Skillpedia
通用编程8.2k · #12541

systematic-debugging

它能做什么

这项技能为你的 AI 提供一种有条理的方法来查找错误,而不是靠猜测。适合面对复杂问题、原因不明显的开发者。

适用场景

  • ✓当一个错误在草率修复后反复出现,而且没有真正解决的时候。
  • ✓当你需要在修改代码之前,先弄清问题的根本原因的时候。
  • ✓当某个问题只在某些环境中出现,你需要缩小范围的时候。

技能链接

https://github.com/vudovn/ag-kit/blob/main/.agents/skills/systematic-debugging/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/vudovn/ag-kit/blob/main/.agents/skills/systematic-debugging/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“这个登录错误只是偶尔出现。请一步步调试,在改动任何代码之前,先找到真正的原因。”

每周 5 个新技能,1 分钟读完。

工作原理

技能要求 AI 先稳定地复现问题,缩小问题来源的范围,用五个为什么追溯根本原因,然后确认修复有效。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Systematic Debugging

Source: obra/superpowers

Overview

This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.

4-Phase Debugging Process

Phase 1: Reproduce

Before fixing, reliably reproduce the issue.

## Reproduction Steps
1. [Exact step to reproduce]
2. [Next step]
3. [Expected vs actual result]

## Reproduction Rate
- [ ] Always (100%)
- [ ] Often (50-90%)
- [ ] Sometimes (10-50%)
- [ ] Rare (<10%)

Phase 2: Isolate

Narrow down the source.

## Isolation Questions
- When did this start happening?
- What changed recently?
- Does it happen in all environments?
- Can we reproduce with minimal code?
- What's the smallest change that triggers it?

Phase 3: Understand

Find the root cause, not just symptoms.

## Root Cause Analysis
### The 5 Whys
1. Why: [First observation]
2. Why: [Deeper reason]
3. Why: [Still deeper]
4. Why: [Getting closer]
5. Why: [Root cause]

Phase 4: Fix & Verify

Fix and verify it's truly fixed.

## Fix Verification
- [ ] Bug no longer reproduces
- [ ] Related functionality still works
- [ ] No new issues introduced
- [ ] Test added to prevent regression

Debugging Checklist

## Before Starting
- [ ] Can reproduce consistently
- [ ] Have minimal reproduction case
- [ ] Understand expected behavior

## During Investigation
- [ ] Check recent changes (git log)
- [ ] Check logs for errors
- [ ] Add logging if needed
- [ ] Use debugger/breakpoints

## After Fix
- [ ] Root cause documented
- [ ] Fix verified
- [ ] Regression test added
- [ ] Similar code checked

Common Debugging Commands

# Recent changes
git log --oneline -20
git diff HEAD~5

# Search for pattern
grep -r "errorPattern" --include="*.ts"

# Check logs
pm2 logs app-name --err --lines 100

Anti-Patterns

❌ Random changes - "Maybe if I change this..." ❌ Ignoring evidence - "That can't be the cause" ❌ Assuming - "It must be X" without proof ❌ Not reproducing first - Fixing blindly ❌ Stopping at symptoms - Not finding root cause

常见问题

四个阶段是什么?

复现、隔离、弄清根本原因,以及修复并验证。

为什么要先复现错误再修复?

技能说明,必须先能稳定地复现问题,这样 AI 才不会靠猜测去修复。

它要求编写回归测试吗?

要求。修复验证清单包括添加一个测试,防止错误再次出现。

详情

作者的原始描述

4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.

repo: vudovn/ag-kit

热度

GitHub 星标
8.2k
排名
#12541
许可证
MIT
更新时间
2026/10/18

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能