跳到正文
Skillpedia
通用编程12k · #11416

debugging-wizard

它能做什么

它指导 AI 智能体用结构化的方法查找并修复缺陷。适用于遇到崩溃、错误或意外行为的人。

适用场景

  • ✓当你的程序显示了你无法解释的错误信息或堆栈跟踪时。
  • ✓当行为出乎意料,你需要找出根本原因时。
  • ✓当程序崩溃,需要阅读日志寻找线索时。

技能链接

https://github.com/Jeffallan/claude-skills/blob/main/skills/debugging-wizard/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我的应用出现了这个堆栈跟踪后崩溃。请帮我找出原因并修复。”

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

工作原理

智能体会复现问题,把范围缩小到最小的失败案例,并每次只验证一个假设。然后它修复缺陷,并添加回归测试。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Debugging Wizard

Expert debugger applying systematic methodology to isolate and resolve issues in any codebase.

Core Workflow

  1. Reproduce - Establish consistent reproduction steps
  2. Isolate - Narrow down to smallest failing case
  3. Hypothesize and test - Form testable theories, verify/disprove each one
  4. Fix - Implement and verify solution
  5. Prevent - Add tests/safeguards against regression

Reference Guide

Load detailed guidance based on context:

<!-- Systematic Debugging row adapted from obra/superpowers by Jesse Vincent (@obra), MIT License -->
Topic Reference Load When
Debugging Tools references/debugging-tools.md Setting up debuggers by language
Common Patterns references/common-patterns.md Recognizing bug patterns
Strategies references/strategies.md Binary search, git bisect, time travel
Quick Fixes references/quick-fixes.md Common error solutions
Systematic Debugging references/systematic-debugging.md Complex bugs, multiple failed fixes, root cause analysis

Constraints

MUST DO

  • Reproduce the issue first
  • Gather complete error messages and stack traces
  • Test one hypothesis at a time
  • Document findings for future reference
  • Add regression tests after fixing
  • Remove all debug code before committing

MUST NOT DO

  • Guess without testing
  • Make multiple changes at once
  • Skip reproduction steps
  • Assume you know the cause
  • Debug in production without safeguards
  • Leave console.log/debugger statements in code

Common Debugging Commands

Python (pdb)

python -m pdb script.py          # launch debugger
# inside pdb:
# b 42          — set breakpoint at line 42
# n             — step over
# s             — step into
# p some_var    — print variable
# bt            — print full traceback

JavaScript (Node.js)

node --inspect-brk script.js     # pause at first line, attach Chrome DevTools
# In Chrome: open chrome://inspect → click "inspect"
# Sources panel: add breakpoints, watch expressions, step through

Git bisect (regression hunting)

git bisect start
git bisect bad                   # current commit is broken
git bisect good v1.2.0           # last known good tag/commit
# Git checks out midpoint — test, then:
git bisect good   # or: git bisect bad
# Repeat until git identifies the first bad commit
git bisect reset

Go (delve)

dlv debug ./cmd/server           # build & attach
# (dlv) break main.go:55
# (dlv) continue
# (dlv) print myVar

Output Templates

When debugging, provide:

  1. Root Cause: What specifically caused the issue
  2. Evidence: Stack trace, logs, or test that proves it
  3. Fix: Code change that resolves it
  4. Prevention: Test or safeguard to prevent recurrence

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

常见问题

它会凭猜测修复吗?

不会。该技能说明不要猜测,每次只验证一个假设。

它会清理调试代码吗?

会。它要求在提交之前删除调试代码。

它会记录发现的问题吗?

会。它会记录发现的问题,供以后参考。

详情

作者的原始描述

Parses error messages, traces execution flow through stack traces, correlates log entries to identify failure points, and applies systematic hypothesis-driven methodology to isolate and resolve bugs. Use when investigating errors, analyzing stack traces, finding root causes of unexpected behavior, troubleshooting crashes, or performing log analysis, error investigation, or root cause analysis.

repo: Jeffallan/claude-skills

热度

GitHub 星标
12k
排名
#11416
许可证
MIT
更新时间
2026/10/30

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能