debug-systematically

A structured method for finding the underlying cause of a software problem. It moves from reproducing the problem, to locating the responsible code, to testing a specific explanation, and then to fixing it with a regression test.

In plain words
What is it for?
Investigating bugs, collecting exact reproduction steps and errors, narrowing down code changes, testing root-cause explanations, and verifying fixes.
Why use it?
It reduces guesswork and helps ensure that a symptom is not merely hidden while the real defect remains.

Skill for Claude CodeCodex

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/pingfanfan/hello-dsh/debug-systematically
Any agent
npx skills add pingfanfan/hello-dsh --skill debug-systematically
Clone the repo
git clone --depth 1 https://github.com/pingfanfan/hello-dsh

Made for: Claude Code, Codex.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,016 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.00051 $0.01016
Opus 5 $0.00026 $0.00508
Sonnet 5 $0.00010 $0.00203
Haiku 4.5 $0.00005 $0.00102

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

Security

Grade A, and why

debug-systematically 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 2d ago.

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.

examples/skills/debug-systematically/SKILL.md · 82 lines

What it actually says

系统化排查

铁律:没有定位到根因之前,不允许修改代码。

绕过这条铁律的典型说法是"先试试这样改会不会好"。那不是排查,那是碰运气:它可能让症状消失而根因还在,然后在别处以更难查的形式复现。

四个阶段

阶段之间不可跳跃。当前阶段的产出不满足,就不能进入下一阶段。

一、复现

产出:一条能稳定触发问题的命令或步骤。

  • 拿到确切的报错全文,不是转述
  • 确认触发条件:什么输入、什么环境、什么时序
  • 确认边界:什么情况下发生——这条经常比"什么时候发生"信息量更大
  • 如果无法稳定复现,先解决这个问题:找出是并发、缓存、时序还是环境差异

无法复现就无法验证修复。这个阶段偷懒,后面全是猜。

二、定位

产出:指出具体的文件和行,并能解释它为什么产生了观察到的现象。

  • 从报错栈的最深处往外读,不是最外层
  • 在怀疑点打印实际值,不要假设它是什么
  • 二分缩小范围:注释掉一半、回退一半提交、禁用一半配置
  • 对比正常与异常两条路径的差异

判断标准:你能不能预测"如果我改动 X,现象会变成 Y"? 能,说明定位到了;不能,说明还在猜。

三、假设与验证

产出:一个被证据支持的根因陈述。

写成这个形式:

因为 <具体代码><具体条件> 下会 <具体行为>,所以出现 <观察到的现象>

然后主动证伪:如果这个假设成立,还应该能观察到什么?去验证那件事。只找支持证据是确认偏误。

常见的假根因:

  • "可能是缓存问题" —— 哪个缓存?哪一行读的?
  • "时序问题" —— 哪两个操作的顺序?怎么证明?
  • "环境不一致" —— 具体哪个变量不同?

这些说法不含信息量,不能作为根因。

四、修复

产出:改动 + 能捕获这个回归的测试。

  • 修根因,不修症状
  • 先写一个当前会失败的测试,再修,看它变绿——顺序反了就无法证明测试有效
  • 检查同类问题:同样的模式在别处是否也存在
  • 确认没有引入新问题:跑完整测试,不是只跑相关的那个

常见陷阱

陷阱 表现 纠正
改了就好了 不知道为什么好了 回退改动确认它确实会复现,再改回来
加日志加到忘了目的 日志越来越多,问题没近 每加一条日志都要说清想验证什么假设
相信注释和文档 按文档说的推理 以代码实际行为为准,文档可能过期
相信测试全绿 测试通过就认为没问题 测试可能根本没覆盖这条路径
一次改多处 好了但不知道哪个起作用 一次只改一个变量
跳过复现 直接开始读代码找可疑点 先复现,否则无法验证

什么时候该停下来求助

  • 同一个假设方向试了三次都不对 —— 换方向,或者说出来让别人看
  • 定位到了但改不动(涉及不熟悉的子系统)—— 带着定位结论去问,比带着现象去问有效十倍
  • 复现不了 —— 优先解决复现,而不是硬猜

求助时给出:复现步骤、已排除的可能、当前假设、卡住的具体点。

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. 2d ago First seen · 82 lines · 51 tokens per session scan A 34934d4bfcaa

Subscribe to this mod's changes

debug-systematically is a skill published in the GitHub repository pingfanfan/hello-dsh (86 stars, last pushed 18d ago), licensed MIT. It adds 51 tokens to every session and 1,016 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

dsh-plugin-guide

Use when developing, reviewing, packaging, debugging, or answering questions about DeepSeek Harness (DSH) plugins — the plugin-based agent harness on vendored Cordis. Applies the official plugin-development constraints (plugin contract, cordis.yml layers, services/events/effects, tool DSL, bundles/profiles) backed by…

PerryLink/dsh-plugin-guide · 76 tokens

wayfinder

把一个巨大的工作块(超过单个 agent 会话所能承载)规划为 issue tracker 上的一张共享决策 ticket 地图,并逐个解决这些 tickets,直到通往目的地的路线清晰可见。.

gongyijie85/mattpocock-skills-dsh-zh · 54 tokens

teach

在当前工作区内教会用户一项新技能或一个新概念。.

gongyijie85/mattpocock-skills-dsh-zh · 20 tokens

dsh-doc-standards

Use when writing, moving, reviewing, or auditing documentation in the deepseek-harness repo — choosing hierarchy and detail, separating tutorials from references, checking tutorial progression, trimming doc slop, responding to a verify-doc-budgets failure, or requests like "improve the docs", "audit the docs", "where…

WZZNNE/DSH-CyberWorkStation · 84 tokens

teach

Teach the user a new skill or concept, within this workspace.

gongyijie85/mattpocock-skills-dsh · 15 tokens

dsh-web-release

Release and publish the dsh-web monorepo (DSH Web GUI plugin family + skin collection) — bump all packages to one unified version, commit and tag (tags are cut from main after dev integration; dev is the integration branch), push the vX.Y.Z tag that triggers the GitHub Actions publish pipeline, and verify the npm…

zhu1090093659/dsh-web · 151 tokens