diagnosing-bugs

diagnosing-bugs is a skill for Claude Code, Codex from vinvcn/mattpocock-skills-zh-CN. It costs 50 tokens per session (2,182 once invoked), scanned A, original, MIT.

A structured process for diagnosing difficult software bugs and performance slowdowns. It starts by creating a repeatable pass-or-fail check, such as a failing test, HTTP request, command, or browser script.

In plain words
What is it for?
Use it when code is broken, failing, throwing errors, or becoming slower, especially when the cause is not obvious.
Why use it?
It replaces guesswork with evidence that shows whether a suspected cause really fixes the problem. It also prompts the agent to understand the relevant code and hide secrets in captured output.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the mattpocock-skills plugin — 36 skills shipped together

Good fit Use it when code is broken, failing, throwing errors, or becoming slower, especially when the cause is not obvious.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs
About the project

mattpocock-skills-zh-CN is a Simplified Chinese localization of a collection of reusable instructions for coding agents. Chinese-speaking developers use the translated skills to support engineering workflows while keeping their original commands, paths, identifiers, and behavior. The catalogue contains the localized skills, instructions, and plugin components.

vinvcn/mattpocock-skills-zh-CN · 4,149 stars · on GitHub

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.

Any agent
npx skills add vinvcn/mattpocock-skills-zh-CN --skill diagnosing-bugs
Clone the repo
git clone --depth 1 https://github.com/vinvcn/mattpocock-skills-zh-CN

Made for: Claude Code, Codex.

Or install mattpocock-skills, the plugin that ships this one along with the rest of its 36 skills.

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 diagnosing-bugs

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs/github.svg)](https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs)
Your own site
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnosing-bugs

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/diagnosing-bugs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,182 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 30 Aug 2026
  • Snyk pass 30 Aug 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00050 $0.02182
Opus 5 $0.00025 $0.01091
Sonnet 5 $0.00010 $0.00436
Haiku 4.5 $0.00005 $0.00218

Measured 12d ago against content hash 03561b758ad1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

diagnosing-bugs scanned grade A with 1 finding 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/hitl-loop.template.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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Phase 1 完成条件:loop **tight** 且 **red-capable**。你能指出 **一个 command**(script path、test invocation、curl),并且你已经至少运行过一次(展示 invocation 和 output,已 redact),且它满足:
skills/engineering/diagnosing-bugs/SKILL.md · 141 lines

How it starts

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

Diagnosing Bugs

面向棘手 bugs 的纪律。只有在明确说明理由时才跳过阶段。

探索 codebase 时,先读取 CONTEXT.md(如果存在),建立相关 modules 的清晰 mental model,并检查你将触碰区域的 ADRs。

Redact

这个 skill 会要求你展示 commands、outputs 和捕获的 artifacts。先 redact 掉每个 secret——用 <REDACTED> 替换。Build loops 要针对 env vars 进行,让 credential 留在 environment 里而不是你展示的内容中。捕获的 artifacts 带有 auth headers:只引用携带 signal 的那些行。

如果 redact 后的 output 不足以诊断 bug,就说明情况并询问用户。

Phase 1 - Build a feedback loop

这就是这个 skill 的核心。 其他所有内容都是机械步骤。如果你拥有一个针对该 bug 的 tight pass/fail signal,即它会在 这个 bug 上变红,你就能找到原因;bisection、hypothesis-testing 和 instrumentation 都只是消费这个 signal。没有它,盯着代码看多久都救不了你。

在这里投入不成比例的精力。要强硬、要有创造力、拒绝放弃。

Ways to construct one - try them in roughly this order

  1. Failing test,放在能触达 bug 的 seam 上:unit、integration、e2e 都可以。
  2. Curl / HTTP script,打到运行中的 dev server。
  3. CLI invocation,使用 fixture input,并把 stdout 与 known-good snapshot diff。
  4. Headless browser script(Playwright / Puppeteer),驱动 UI,并断言 DOM/console/network。
  5. Replay a captured trace. 把真实 network request / payload / event log 保存到磁盘,并在隔离环境中 replay 到代码路径。
  6. Throwaway harness. 启动系统的最小子集(一个 service、mocked deps),用一次 function call 触发 bug code path。
  7. Property / fuzz loop. 如果 bug 是 "sometimes wrong output",运行 1000 个 random inputs 并寻找 failure mode。
  8. Bisection harness. 如果 bug 出现在两个已知状态之间(commit、dataset、version),自动化 "boot at state X, check, repeat",这样可以 git bisect run
  9. Differential loop. 用同一 input 跑 old-version vs new-version(或两个 configs),然后 diff outputs。
  10. HITL bash script. 最后手段。如果必须由人点击,就用 scripts/hitl-loop.template.sh 驱动 ,让 loop 仍保持结构化。捕获的输出反馈给你。

构建正确的 feedback loop,bug 就修好了 90%。

Tighten the loop

把 loop 当作产品。只要有了 一个 loop,就继续 tighten 它:

  • 我能让它更快吗?(Cache setup、跳过无关 init、缩小 test scope。)
  • 我能让 signal 更尖锐吗?(断言具体 symptom,而不是 "didn't crash"。)
  • 我能让它更 deterministic 吗?(Pin time、seed RNG、isolate filesystem、freeze network。)

一个 30 秒且 flaky 的 loop 几乎不比没有 loop 好;一个 2 秒 deterministic loop 才是 tight 的调试超能力。

Non-deterministic bugs

Read the full file on GitHub · 141 lines

Files

What ships with it

2 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. 12d ago First seen · 141 lines · 50 tokens per session scan A 03561b758ad1

Subscribe to this mod's changes

diagnosing-bugs is a skill published in the GitHub repository vinvcn/mattpocock-skills-zh-CN (4,149 stars, last pushed 5d ago), licensed MIT. It adds 50 tokens to every session and 2,182 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens