Debugging Wizard

作者 jeffallan1be15d8064f8MIT11K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库5天前更新

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.

AI 生成的概览

以系统化、假设驱动的流程指导代码错误、堆栈跟踪、崩溃与日志的调试。

功能
该技能提供结构化的调试方法:复现问题、缩小到最小失败用例、每次只提出并验证一个假设、实施修复并加入防回归措施。它还提供参考资料,涵盖各语言的调试器、常见缺陷模式、二分查找与 git bisect 等策略、常见错误速修以及系统化根因分析。输出按根因、支撑证据、修复方案和预防措施呈现。
适用场景
适用于排查错误、分析堆栈跟踪、诊断崩溃,或进行日志分析与根因分析。也适合需要先隔离再修复的异常行为,包括多次修复未果的复杂缺陷。
运行要求
不附带脚本,仅为指令与参考用 Markdown 文件。需要能访问代码库及其错误输出,并提及 pdb、Node.js 检查器、delve 和 git bisect 等语言调试工具。

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 -->
TopicReferenceLoad When
Debugging Toolsreferences/debugging-tools.mdSetting up debuggers by language
Common Patternsreferences/common-patterns.mdRecognizing bug patterns
Strategiesreferences/strategies.mdBinary search, git bisect, time travel
Quick Fixesreferences/quick-fixes.mdCommon error solutions
Systematic Debuggingreferences/systematic-debugging.mdComplex 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)

bash
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)

bash
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)

bash
git bisect startgit bisect bad                   # current commit is brokengit 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 commitgit bisect reset

Go (delve)

bash
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

来源与署名

来源:jeffallan/claude-skills位于skills/debugging-wizard提交1be15d8

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架