bug-diagnosis

GitHub

系统化诊断Bug的技能,通过可靠复现、隔离范围、排序假设并低成本验证来定位根因。避免盲目改码,输出包含最小复现步骤、隔离位置、 ranked 假设表、根因证据及回归测试,确保修复有效且可追溯。

skills/bug-diagnosis/SKILL.md mohitagw15856/pm-claude-skills

Trigger Scenarios

调试代码缺陷 排查间歇性失败 分析'为什么发生'的问题

Install

npx skills add mohitagw15856/pm-claude-skills --skill bug-diagnosis -g -y
More Options

Use without installing

npx skills use mohitagw15856/pm-claude-skills@bug-diagnosis

指定 Agent (Claude Code)

npx skills add mohitagw15856/pm-claude-skills --skill bug-diagnosis -a claude-code -g -y

安装 repo 全部 skill

npx skills add mohitagw15856/pm-claude-skills --all -g -y

预览 repo 内 skill

npx skills add mohitagw15856/pm-claude-skills --list

SKILL.md

Frontmatter
{
    "name": "bug-diagnosis",
    "description": "Diagnose a bug systematically instead of guessing — reproduce, isolate, form hypotheses, and test them to root cause. Use when debugging, chasing a defect, an intermittent failure, or 'why is this happening?'. Produces a structured diagnosis: a reliable repro, the narrowed-down location, ranked hypotheses with how to test each, and the root cause + fix once found."
}

Bug Diagnosis Skill

The slowest way to fix a bug is to start changing code and hope. This skill runs a disciplined diagnostic loop: reproduce it reliably, isolate where it happens, hypothesize why, and test the cheapest hypothesis first — narrowing until the root cause is proven, not guessed. It produces a fix and an explanation of why the bug existed.

Required Inputs

Ask for these only if they aren't already provided:

  • The symptom — what's wrong: expected vs. actual behavior, error/stack trace, when it started.
  • Repro steps — how to trigger it (or "can't reliably reproduce yet").
  • Context — recent changes, environment, frequency (always / intermittent / specific inputs).
  • What's been tried — so we don't repeat dead ends.

Output Format

Diagnosis: [bug]

1. Reproduce — the minimal, reliable steps to trigger it. If it's intermittent, the plan to make it deterministic (fixed input/seed, added logging, narrowed conditions). No fixing until it reproduces.

2. Isolate — narrow where it happens: bisect (git bisect / comment-out / binary search the input), check the boundaries (what's the last known-good point vs. first bad). State the smallest scope that still shows the bug.

3. Hypotheses (ranked) — likely causes, most-probable-and-cheapest-to-test first:

Hypothesis Why plausible How to test it (the cheap check) Verdict

Test them in order; record what each rules in or out.

4. Root cause — the proven cause (not a symptom), with the evidence that confirms it.

5. Fix & guard — the fix, a test that fails before it and passes after (lock the bug out), and any nearby instances of the same mistake.

Quality Checks

  • A reliable reproduction exists before any fix is attempted
  • The location is isolated by bisection/narrowing, not guessed
  • Hypotheses are ranked by likelihood × cheapness and tested in order
  • The stated cause is the root cause with evidence — not just the surface symptom
  • A regression test is added that fails before the fix and passes after

Anti-Patterns

  • Do not start changing code before the bug reliably reproduces
  • Do not fix the symptom and stop — trace to the underlying cause
  • Do not change several things at once — you won't know what fixed it (or hid it)
  • Do not skip the regression test — an unguarded bug comes back
  • Do not ignore "what's been tried" — re-running dead ends wastes the loop

Based On

Systematic debugging method (reproduce → isolate → hypothesize → verify) — Zeller's Why Programs Fail / scientific-method debugging.

Version History

  • a38bc30 Current 2026-07-05 11:30

Same Skill Collection

exports/openclaw/360-feedback-template/SKILL.md
exports/openclaw/401k-plan-decoder/SKILL.md
exports/openclaw/ab-test-planner/SKILL.md
exports/openclaw/ab-test-readout/SKILL.md
exports/openclaw/accessibility-audit/SKILL.md
exports/openclaw/account-plan/SKILL.md
exports/openclaw/acquirer-red-team/SKILL.md
exports/openclaw/ad-copy/SKILL.md
exports/openclaw/aeo-optimizer/SKILL.md
exports/openclaw/agenda-or-cancel/SKILL.md
exports/openclaw/agent-design-review/SKILL.md
exports/openclaw/agent-observability-spec/SKILL.md
exports/openclaw/agent-spec/SKILL.md
exports/openclaw/ai-ethics-review/SKILL.md
exports/openclaw/ai-eval-plan/SKILL.md
exports/openclaw/ai-feature-prd/SKILL.md
exports/openclaw/ai-product-canvas/SKILL.md
exports/openclaw/air-quality/SKILL.md
exports/openclaw/altitude-shifter/SKILL.md
exports/openclaw/ambiguity-resolver/SKILL.md
exports/openclaw/analyst-relations-brief/SKILL.md
exports/openclaw/announcement-card/SKILL.md
exports/openclaw/api-docs-writer/SKILL.md
exports/openclaw/api-test-plan/SKILL.md
exports/openclaw/api-versioning-strategy/SKILL.md
exports/openclaw/apology-letter/SKILL.md
exports/openclaw/architecture-decision-record/SKILL.md
exports/openclaw/architecture-diagram/SKILL.md
exports/openclaw/archive-strategy/SKILL.md
exports/openclaw/assumption-bounty/SKILL.md
exports/openclaw/assumption-mapper/SKILL.md
exports/openclaw/async-update-format/SKILL.md
exports/openclaw/auto-repair-estimate-decoder/SKILL.md
exports/openclaw/autopilot-charter/SKILL.md
exports/openclaw/benefits-decoder/SKILL.md
exports/openclaw/bid-tender-review/SKILL.md
exports/openclaw/board-deck-narrative/SKILL.md
exports/openclaw/board-minutes/SKILL.md
exports/openclaw/board-pre-read/SKILL.md
exports/openclaw/bom-cost-review/SKILL.md
exports/openclaw/bookkeeping-categorization/SKILL.md
exports/openclaw/boolean-search-builder/SKILL.md
exports/openclaw/brag-doc/SKILL.md
exports/openclaw/brainstorming/SKILL.md
exports/openclaw/brief-builder/SKILL.md
exports/openclaw/briefing-note/SKILL.md
exports/openclaw/budget-builder/SKILL.md
exports/openclaw/budget-variance-analysis/SKILL.md
exports/openclaw/bug-diagnosis/SKILL.md
exports/openclaw/bug-report/SKILL.md

Metadata

Files
0
Version
471c606
Hash
fa14879f
Indexed
2026-07-05 11:30

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-29 19:06
浙ICP备14020137号-1 $방문자$