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 從公開儲存庫中收錄這些內容。

檢舉或申請下架