Agent skill

Systematic Debugging

by jnMetaCode in jnMetaCode/superpowers-zh

“遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行”

— description from SKILL.md by jnMetaCode
MITAuto-check passedDevelopment

Install Systematic Debugging

skills CLI
$ npx skills add jnMetaCode/superpowers-zh --skill systematic-debugging -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jnMetaCode/superpowers-zh systematic-debugging --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jnMetaCode/superpowers-zh.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/systematic-debugging .claude/skills/systematic-debugging && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
systematic-debugging
GitHub stars
8.3k
Token cost
~1.1k tokens
SKILL.md length
284 words
Files
11
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 5 steps: 仔细阅读错误信息 → 稳定复现 → 检查近期变更 → …
  • SKILL.md covers 概述, 铁律, 何时使用 and 四个阶段, plus 6 more sections
  • Runs TypeScript and Shell scripts from its folder

About this skill

Systematic Debugging is a skill in jnMetaCode/superpowers-zh (8.3k stars). Its SKILL.md is about 1.1k tokens, with 10 other files in the folder. Licence: MIT.

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 仔细阅读错误信息
  2. 稳定复现
  3. 检查近期变更
  4. 在多组件系统中收集证据
  5. 跟踪数据流

What it can do on your machine

Read from SKILL.md and the folder at commit fe34019. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript and Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Systematic Debugging loads about 1.1k tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 284 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jnMetaCode/superpowers-zh at commit fe34019, republished under its MIT licence (© jnMetaCode). 284 words, ~1,139 tokens.

Download SKILL.mdSave it as .claude/skills/systematic-debugging/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
systematic-debugging
description
遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行
version
1.0.0
license
MIT

系统化调试

概述

核心原则: 在尝试修复之前,务必先找到根本原因。只修症状就是失败。

敷衍走流程等于违背调试的精神。

铁律

不做根因调查,不许提修复方案

如果你还没完成第一阶段,就不能提出修复方案。

何时使用

用于任何技术问题:

  • 测试失败
  • 生产环境 bug
  • 异常行为
  • 性能问题
  • 构建失败
  • 集成问题

尤其在以下情况必须使用:

  • 时间紧迫(紧急情况最容易让人猜测式修复)
  • 觉得"一个小修改"就能搞定
  • 已经尝试了多种修复
  • 上一次修复没有生效
  • 你没有完全理解问题

以下情况也不要跳过:

  • 问题看起来很简单(简单的 bug 也有根本原因)
  • 你很赶时间(越急越容易返工)
  • 领导要求立刻修好(系统化调试比反复尝试更快)

四个阶段

你必须完成每个阶段后才能进入下一个。

第一阶段:根因调查

在尝试任何修复之前:

  1. 仔细阅读错误信息

    • 不要跳过错误或警告
    • 它们往往直接包含解决方案
    • 完整阅读堆栈跟踪
    • 记下行号、文件路径、错误码
  2. 稳定复现

    • 你能可靠地触发它吗?
    • 具体的复现步骤是什么?
    • 每次都能复现吗?
    • 如果无法复现 → 收集更多数据,不要猜测
  3. 检查近期变更

    • 什么变更可能导致了这个问题?
    • git diff、最近的提交
    • 新依赖、配置变更
    • 环境差异
  4. 在多组件系统中收集证据

    当系统有多个组件时(CI → 构建 → 签名,API → 服务 → 数据库):

    在提出修复方案之前,先添加诊断埋点:

    对每个组件边界:
      - 记录进入组件的数据
      - 记录离开组件的数据
      - 验证环境/配置的传递
      - 检查每一层的状态
    
    执行一次以收集证据,确定断裂点在哪里
    然后分析证据,定位故障组件
    然后针对该组件深入调查

    示例(多层系统):

    bash
    # 第 1 层:工作流
    echo "=== Secrets available in workflow: ==="
    echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
    
    # 第 2 层:构建脚本
    echo "=== Env vars in build script: ==="
    env | grep IDENTITY || echo "IDENTITY not in environment"
    
    # 第 3 层:签名脚本
    echo "=== Keychain state: ==="
    security list-keychains
    security find-identity -v
    
    # 第 4 层:实际签名
    codesign --sign "$IDENTITY" --verbose=4 "$APP"

    由此可以看出: 哪一层出了问题(secrets → workflow ✓, workflow → build ✗)

  5. 跟踪数据流

    当错误发生在调用栈深处时:

    参见本目录下的 root-cause-tracing.md,了解完整的反向追踪技术。

    简要版本:

    • 错误值从哪里产生的?
    • 谁用错误值调用了这里?
    • 持续向上追踪直到找到源头
    • 在源头修复,而不是在症状处修复
第二阶段:模式分析

先找到模式,再修复:

  1. 找到可正常工作的示例

    • 在同一代码库中找到类似的正常代码
    • 有什么正常的代码与出问题的代码相似?
  2. 与参考实现对比

    • 如果是实现某个模式,完整阅读参考实现
    • 不要略读——逐行阅读
    • 在应用之前彻底理解该模式
  3. 识别差异

    • 正常代码和出问题的代码之间有什么不同?
    • 列出每一个差异,无论多小
    • 不要假设"那不可能有影响"
  4. 理解依赖关系

    • 这个功能需要哪些其他组件?
    • 需要哪些设置、配置、环境?
    • 它有哪些隐含假设?
第三阶段:假设与验证

科学方法:

  1. 提出单一假设

    • 清晰地陈述:"我认为 X 是根本原因,因为 Y"
    • 写下来
    • 要具体,不要含糊
  2. 最小化测试

    • 做出最小的改动来验证假设
    • 每次只改一个变量
    • 不要同时修复多个问题
  3. 继续之前先验证

    • 生效了?是 → 进入第四阶段
    • 没生效?提出新假设
    • 不要在上面叠加更多修复
  4. 当你不确定时

    • 说"我不理解 X"
    • 不要假装自己知道
    • 寻求帮助
    • 做更多调研
第四阶段:实施

修复根本原因,而非症状:

  1. 创建失败的测试用例

    • 最简化的复现
    • 尽可能用自动化测试
    • 没有测试框架就写一次性测试脚本
    • 修复前必须先有测试
    • 使用 test-driven-development 技能来编写规范的失败测试
  2. 实施单一修复

    • 修复已定位的根本原因
    • 每次只改一处
    • 不做"顺便改改"的优化
    • 不捆绑重构
  3. 验证修复

    • 测试现在通过了吗?
    • 其他测试没有被破坏吧?
    • 问题真的解决了吗?
    • 宣称成功之前,使用 verification-before-completion 技能
  4. 如果修复不起作用

    • 停下来
    • 数一数:你已经尝试了几次修复?
    • 少于 3 次:回到第一阶段,用新信息重新分析
    • 3 次或以上:停下来质疑架构(见下方第 5 步)
    • 没有经过架构讨论,不要尝试第 4 次修复
  5. 如果 3 次以上修复都失败了:质疑架构

    以下模式表明存在架构问题:

    • 每次修复都暴露出新的共享状态/耦合/其他位置的问题
    • 修复需要"大规模重构"才能实现
    • 每次修复都在其他地方产生新的症状

    停下来质疑根本性问题:

    • 这个模式从根本上合理吗?
    • 我们是不是在"惯性驱动"下坚持了错误方案?
    • 应该重构架构还是继续修补症状?

    在尝试更多修复之前,和你的搭档讨论

    这不是假设失败——这是架构有误。

红线——停下来,按流程走

如果你发现自己在想:

  • "先临时修一下,以后再排查"
  • "试着改改 X 看看行不行"
  • "一次性改多个地方,跑测试看看"
  • "跳过测试,我手动验证"
  • "大概是 X 的问题,让我修一下"
  • "我不完全理解,但这应该能行"
  • "模式说的是 X,但我换个方式用"
  • "主要问题有这些:[未经调查就列出修复方案]"
  • 没有追踪数据流就提出解决方案
  • "再试一次修复"(已经尝试了 2 次以上)
  • 每次修复都暴露出不同地方的新问题

以上这些都意味着:停下来。回到第一阶段。

如果 3 次以上修复都失败了: 质疑架构(见第四阶段第 5 步)

搭档发出的信号——说明你的方法不对

留意这些提醒:

  • "难道不是这样吗?"——你在没有验证的情况下做了假设
  • "它能告诉我们……吗?"——你应该先收集证据
  • "别猜了"——你在没有理解的情况下提出修复
  • "深入想想"——要质疑根本性问题,而不只是症状
  • "我们卡住了?"(沮丧的语气)——你的方法没有奏效

当你看到这些信号时: 停下来。回到第一阶段。

常见借口

借口现实
"问题很简单,不需要走流程"简单问题也有根本原因。对于简单 bug,流程很快就能走完。
"紧急情况,没时间走流程"系统化调试比反复猜测式修复更快。
"先试一下,再排查"第一次修复就定下了基调。从一开始就做对。
"确认修复有效后再写测试"没有测试的修复留不住。先写测试才能证明修复有效。
"一次修多个问题省时间"无法隔离哪个生效了。还会引入新 bug。
"参考实现太长了,我自己改改"一知半解必然出 bug。完整阅读。
"我看出问题了,让我修一下"看到症状 ≠ 理解根因。
"再试一次"(在 2 次以上失败后)3 次以上失败 = 架构问题。质疑模式,不要继续修。

速查表

阶段关键活动通过标准
1. 根因阅读错误、复现、检查变更、收集证据理解了什么出了问题以及为什么
2. 模式找到正常示例、对比识别出差异
3. 假设提出理论、最小化验证假设被验证或产生新假设
4. 实施创建测试、修复、验证bug 已修复,测试通过

当流程显示"找不到根因"

如果系统化排查后发现问题确实是环境相关、时序相关或外部因素导致的:

  1. 你已经完成了流程
  2. 记录你排查了什么
  3. 实施适当的处理措施(重试、超时、错误提示)
  4. 添加监控/日志以便后续排查

但是: 95% 的"找不到根因"其实是排查不充分。

辅助技术

以下技术是系统化调试的组成部分,可在本目录中找到:

  • root-cause-tracing.md - 沿调用栈反向追踪 bug,找到最初的触发点
  • defense-in-depth.md - 找到根因后,在多个层级添加校验
  • condition-based-waiting.md - 用条件轮询替代硬编码等待时间

© jnMetaCode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files in skills/systematic-debugging of jnMetaCode/superpowers-zh.

  • SKILL.md
  • CREATION-LOG.md
  • condition-based-waiting-example.ts
  • condition-based-waiting.md
  • defense-in-depth.md
  • find-polluter.sh
  • root-cause-tracing.md
  • test-academic.md
  • test-pressure-1.md
  • test-pressure-2.md
  • test-pressure-3.md

Open the folder on GitHubat commit fe34019

Compare with similar skills

Systematic Debugging next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Systematic Debugging compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Systematic Debugging this skilljnMetaCode/superpowers-zh8.3k—~1.1kAutomated safety check: PassMIT
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Debugging Executionsn8n-io/n8n207k—~2.6kAutomated safety check: PassCustom licence
Aoti Debugpytorch/pytorch104k1 repos~1.7kAutomated safety check: PassCustom licence
Herdr Throwaway Reproductionherdrdev/herdr43k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Runs a disposable, uniquely named Herdr session inside an existing one so runtime, pane, terminal or API bugs can be reproduced without touching the main session.

    43k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Systematic Debugging

    ultralisp/ultralisp

    A skill your agent uses when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    258 GitHub starsUsed in 51 repos~2.4k tokens
    DevelopmentAuto-check passed

More from jnMetaCode/superpowers-zh

All 21 skills in this repo
  • Brainstorming Before Building

    jnMetaCode/superpowers-zh

    Turns a rough idea into an approved design before any code is written, sorting the request into spike, bounded or architectural and enforcing an approval gate.

    8.3k GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check passed
  • Chinese Commit Conventions

    jnMetaCode/superpowers-zh

    Reference for Chinese-language git commits and changelogs: Conventional Commits adapted for Chinese teams, with templates, breaking-change notes and issue links for several platforms.

    8.3k GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Inline Plan Execution

    jnMetaCode/superpowers-zh

    Executes a written implementation plan task by task in the current session, with a progress ledger, test-first gates and one fresh-context review at the end.

    8.3k GitHub stars~2.5k tokensUpdated 3 days ago
    Auto-check passed
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    Auto-check passed
  • Agency Orchestrator Workflow Runner

    jnMetaCode/superpowers-zh

    Runs agency-orchestrator YAML workflows inside the current agent session, with the session's own model playing each role in turn and no API key needed.

    8.3k GitHub starsUsed in 1 repo~885 tokens
    Auto-check passed
  • Chinese Code Review Etiquette

    jnMetaCode/superpowers-zh

    Gives Chinese-language templates and priority labels for code review feedback, plus guidance on bilingual comments, commit messages and common team anti-patterns.

    8.3k GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Systematic Debugging

How do I install Systematic Debugging in Claude Code?

Run `npx skills add jnMetaCode/superpowers-zh --skill systematic-debugging -a claude-code`. Or copy the skill folder (skills/systematic-debugging in jnMetaCode/superpowers-zh) into .claude/skills/systematic-debugging in your project. Claude Code loads it when a task matches its description.

How do I install Systematic Debugging in Codex?

Run `npx skills add jnMetaCode/superpowers-zh --skill systematic-debugging -a codex`. Or copy the skill folder (skills/systematic-debugging in jnMetaCode/superpowers-zh) into .agents/skills/systematic-debugging in your project. Codex loads it when a task matches its description.

Can I use Systematic Debugging in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jnMetaCode/superpowers-zh --skill systematic-debugging -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/systematic-debugging, .gemini/skills/systematic-debugging, .github/skills/systematic-debugging and .opencode/skills/systematic-debugging in your project.

What does Systematic Debugging need to run?

Going by SKILL.md and its folder, Systematic Debugging needs TypeScript and a shell for the scripts in its folder.

Does Systematic Debugging access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Systematic Debugging safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Systematic Debugging use?

Systematic Debugging is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Systematic Debugging use?

About 1.1k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Systematic Debugging?

Skills that share tags, products or a category with Systematic Debugging: Trellis Session Insight (mindfold-ai/Trellis, 15k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Debugging Executions (n8n-io/n8n, 207k stars) and Aoti Debug (pytorch/pytorch, 104k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Systematic Debugging?

jnMetaCode (a GitHub user) maintains it in jnMetaCode/superpowers-zh, which has 8,270 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 4, 2026.

Source: jnMetaCode/superpowers-zh on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.