跳到正文
cccskills
免费在 GitHub 公开

debug

Root cause analysis for bugs and errors. Use when something is broken and the cause is not obvious. Applies the 5-step investigation method — observe, hypothesize, trace backwards, binary search, prove.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md2.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Debug Skill

Systematic root cause analysis.

When to use

  • An error is happening and the cause is not obvious
  • A test is failing unexpectedly
  • Behavior changed after a refactor
  • Production incident requiring root cause identification

5-Step Investigation Method

Step 1 — OBSERVE: Gather exact evidence

Do NOT guess. Collect all available evidence first:

  • Exact error message (full stack trace, not summary)
  • Exact input that triggers the failure
  • Exact expected vs. actual output
  • When it started failing (which commit? which change?)
  • Environment where it fails (dev? CI? prod? all?)

Step 2 — HYPOTHESIZE: Form concrete hypotheses

Based on the evidence, generate 2-3 specific hypotheses:

  • Each hypothesis must be falsifiable (testable)
  • Rank by probability based on evidence
  • Do NOT assume the most complex explanation — prefer simple causes

Step 3 — TRACE BACKWARDS: Follow the execution path

From the failure point, trace backwards:

grep -rn --color=never '<error_symbol_or_message>' . | head -20
  • Find the function that threw the error
  • Find its caller
  • Find the caller's caller
  • Keep tracing until you reach user input or a boundary

Step 4 — BINARY SEARCH: Narrow the scope

If the trace is long, use bisection:

  • Does it fail with the same input after reverting X? (git bisect or manual)
  • Does it fail with minimal input? (reduce the test case)
  • Does it fail in isolation? (extract the failing unit)

Step 5 — PROVE: Verify the root cause

Before fixing, prove you found the right root cause:

  • Write a test that reproduces the bug exactly
  • Verify the test fails (red) with the current code
  • Apply the fix
  • Verify the test passes (green)
  • Run the full test suite — no regressions

Rules

  • NEVER fix before proving the root cause
  • NEVER submit a fix without a reproducing test
  • If two hypotheses remain after Step 4, test the simpler one first
  • Document the root cause in claude/tasks/lessons.md if it's a non-obvious pattern

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

ask

免费

Route a codebase question to the right tool — structural graph, semantic search, or risk analysis. Use when you need to find or understand code without knowing exact file names.

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

bootstrap

免费

Auto-configure CLAUDE.md and claude/ knowledge docs for a new project. Use when setting up Brain Bootstrap in a new repository. Discovers the codebase, fills in templates, and writes project-specific configuration.

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

Use before any new feature, component, or behavioral change — when you need to explore requirements and design before writing code

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

careful

免费

Activate safety guards for the session. Use /careful before critical operations — blocks rm -rf, DROP TABLE, git push --force, kubectl delete namespace, docker system prune via PreToolUse hook.

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

changelog

免费

Generate a user-facing changelog from git commits — categorize, filter noise, translate to user language. Runs in isolated fork context.

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

Save session state before context gets full or before ending. Writes current task state, branch, and loaded docs to claude/tasks/todo.md so the next session can resume cleanly.

中文简介正在准备中。当前显示原文说明。

brain-bootstrap/claude-code-brain-bootstrap112026年4月25日 更新

查看 brain-bootstrap 的全部技能

报告此技能的问题