systematic-debugging

systematic-debugging is a skill for Claude Code, Codex from jnMetaCode/superpowers-zh. It costs 24 tokens per session (2,753 once invoked), scanned A, original, MIT.

A step-by-step method for finding the underlying cause of technical problems before changing code. It covers reading errors, reproducing failures, checking recent changes, and tracing data across system components.

In plain words
What is it for?
Use it for failed tests, production bugs, unusual behavior, slow systems, build failures, and integration problems. It guides investigation before proposing or applying a fix.
Why use it?
It prevents guesswork and fixes aimed only at visible symptoms. Evidence from a reliable reproduction and system boundaries makes the actual failing component easier to identify.

Skill for Claude CodeCodex

Part of the superpowers-zh plugin — 20 skills, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jnmetacode/superpowers-zh/systematic-debugging
Any agent
npx skills add jnMetaCode/superpowers-zh --skill systematic-debugging
Clone the repo
git clone --depth 1 https://github.com/jnMetaCode/superpowers-zh

Made for: Claude Code, Codex.

Or install superpowers-zh, the plugin that ships this one along with the rest of its 20 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for systematic-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/jnmetacode/superpowers-zh/systematic-debugging.svg)](https://agentmods.dev/skills/jnmetacode/superpowers-zh/systematic-debugging)
Your own site
<a href="https://agentmods.dev/skills/jnmetacode/superpowers-zh/systematic-debugging"><img src="https://agentmods.dev/badge/skills/jnmetacode/superpowers-zh/systematic-debugging.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,753 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.02753
Opus 5 $0.00012 $0.01376
Sonnet 5 $0.00005 $0.00551
Haiku 4.5 $0.00002 $0.00275

Measured 4d ago against content hash f0e3e21f0d81, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

systematic-debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (condition-based-waiting-example.ts, find-polluter.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/systematic-debugging/SKILL.md · 290 lines

How it starts

The opening of the file, as written. The whole thing — 290 lines — stays where its author put it; the contents beside it link to each section on GitHub.

系统化调试

概述

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

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

铁律

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

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

何时使用

用于任何技术问题:

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

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

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

以下情况也不要跳过:

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

四个阶段

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

第一阶段:根因调查

在尝试任何修复之前:

  1. 仔细阅读错误信息

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

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

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

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

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

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

    示例(多层系统):

    # 第 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"
    • 写下来
    • 要具体,不要含糊

Read the full file on GitHub · 290 lines

Files

What ships with it

10 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 290 lines · 24 tokens per session scan A f0e3e21f0d81

Subscribe to this mod's changes

systematic-debugging is a skill published in the GitHub repository jnMetaCode/superpowers-zh (7,965 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 2,753 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.