plan-debug

plan-debug is a skill for Claude Code, Codex from weiyi88/cc-code. It costs 70 tokens per session (6,658 once invoked), scanned A, original, MIT.

A guided bug-diagnosis workflow that investigates a known problem in planning mode before any code changes. It records the confirmed bug, its cause, and affected areas for a later repair step.

In plain words
What is it for?
Use it to clarify a bug, trace its code paths and likely impact, compare expected behaviour with the current implementation, and record a numbered bug for an execution agent.
Why use it?
It prevents guesses about the intended behaviour and separates diagnosis from implementation. It also stops changes when fixing the issue would require changing the documented product rules or API contract.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present. Also seen: mentions subagents.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is 谁在做什么,看分支名:`作者码/debug/问题-年月日`,卡就是这条分支。命名与判定规则唯一出处 = `scripts/team-check.sh branch`,本命令不复述。判断流程、`new / keep / stop` 的做法、中间提交的格式与 `plan-feature` 完全一致,唯一出处 = `../p.

Part of the cc-code plugin — 19 skills, 6 agents, 1 hook shipped together

Good fit Use it to clarify a bug, trace its code paths and likely impact, compare expected behaviour with the current implementation, and record a numbered bug for an execution agent.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/weiyi88/cc-code
agentmods
npx agentmods add skills/weiyi88/cc-code/plan-debug

Made for: Claude Code, Codex.

Or install cc-code, the plugin that ships this one along with the rest of its 19 skills, 6 agents, 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 plan-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/weiyi88/cc-code/plan-debug/github.svg)](https://agentmods.dev/skills/weiyi88/cc-code/plan-debug)
Your own site
<a href="https://agentmods.dev/skills/weiyi88/cc-code/plan-debug"><img src="https://agentmods.dev/badge/skills/weiyi88/cc-code/plan-debug/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 plan-debug

Your own site · 80×15
<a href="https://agentmods.dev/skills/weiyi88/cc-code/plan-debug"><img src="https://agentmods.dev/badge/skills/weiyi88/cc-code/plan-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,658 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00070 $0.06658
Opus 5.5 $0.00028 $0.02663
Sonnet 5.5 $0.00014 $0.01332
Haiku 4.5 $0.00007 $0.00666

Measured 26d ago against content hash a3e696daec31, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-debug 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 26d 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.

skills/plan-debug/SKILL.md · 256 lines

How it starts

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

/cc-code:plan-debug — bug 诊断编排器(不进 plan 模式,bugs.md 自动整理)

⚠️ 暂停(1.17.0 起):本命令依赖旧 qa 的全量验收 / 复现取证职责;qa 已改造为检测员(只比对本次改动),本命令待重新设计,暂勿使用。日常交付走 /cc-code:check-fix。

⭐ 不进 plan 模式,没有「批准方案」这道门。 诊断是收集事实,不是做决定;plan 模式会让 qa 写不了文件,中途一断线记录就丢。所以 qa 复现一成功就写 B-n,诊断每推进一步就地补全,记录不等主人批准。 定位:技术诊断编排器,不是需求规划器。 与 /cc-code:plan-feature 的分界:那个处理「需求模糊」,本命令处理「需求明确但实现错了」—— bug 本身就是需求,期望行为要么主人说了,要么 prd.md 已有断言、ux.md 已有交互判定、design.md 已有设计数值、ui-gates.md 已有视觉规则、.cc-code/test/visual/baseline/ 已有冻结基线。 主控只传话:主控是编排者,不扮演任何角色——不读 src/、不跑 codegraph、不思考根因、不替主人回答、不写 bugs.md。复现取证与 B-n 登记归 qa,根因与方案归 dev(只读,不改任何文件)。 配对:本命令把 B-n 整理到 待修复 后,修复执行走 /cc-code:agent-debug(增量定位 B-n → dev 修 → qa 复测 → affected 精准回归)。视觉规格本身写错 → 先走 /cc-code:plan-uiux(模式二)改规格;页面 / 交互规格(ux.md)要改 → 交回 /cc-code:plan-feature 由 uiux 补,再回 agent-debug。本命令 ⛔ 不直接派 uiux、⛔ 不让 pm 写 ux.md。

⛔ 五条铁律(违反任一即本次诊断无效)

铁律 1:期望行为唯一来源 = 主人原话 + 既有断言 / 判定 / 设计数值 / 视觉规则 / 基线

诊断时最容易犯的错就是拿实现当期望。

期望行为的合法出处:
  ✅ 主人在对话里的原话
  ✅ prd.md §1.5 的既有 A 断言
  ✅ ux.md 的既有 U 判定项(五态矩阵、页面结构与断点声明)
  ✅ design.md 的已锁设计数值与组件长相
  ✅ ui-gates.md 的视觉规则与阈值(规则号唯一出处)
  ✅ .cc-code/test/visual/baseline/ 的已冻结截图基线(只在视觉地基过门或「定了」后冻结)

  ⛔ 绝不许从「代码现状」反推「所以期望应该是 X」
  ⛔ 绝不许从 codegraph / 日志产出反推期望 —— 它们只答「代码 / 运行时现在是什么样」
  ⛔ 绝不许拿「当前页面看起来正常」当期望 —— 视觉期望来自 design.md 与基线,不来自现状

出处由 qa 定位并写进 B-n(写清文件 + 小节 / 规则号 / 基线文件名);dev 诊断时期望行为一律取自 qa 报告里的出处,不自己推。

铁律 2:只有四种情况停下交人(裁决门)

qa 把 B-n 的状态写成 待裁决,并用业务语言写一句要主人回答的问题(写进 B-n 的「待裁决」字段);主控把这句话原样问主人,⛔ 主控不自己判、不自己改。除这四种,一律自动往下走,不问主人。

编号 命中情形 谁发现 主人裁决后,主控派谁
① 根因是契约错(api / data / project 本身错) qa(读 dev 诊断后) architect 改 L3 对应小节
② 根因是需求或视觉规格错(prd / ux 的行为半边 / design.md 本身错) qa(读 dev 诊断后) prd → pm 改对应小节;ux → ⛔ 本命令不改、不派 uiux,交回 /cc-code:plan-feature 由 uiux 补(或主人裁决后走 /cc-code:plan-uiux 模式二);design.md → 先跑 /cc-code:plan-uiux(模式二,锁后只有它能改 design.md),改完回 agent-debug 重判
③ prd / ux / design / api 里找不到期望出处,无法判定是不是 bug qa(复现阶段) 主人说「这是新需求」→ 交回 /cc-code:plan-feature(业务需求由 pm 补,页面 / 交互规格由 uiux 在同一次落盘);主人说「不是 bug」→ qa 把条目原文搬 backup/retired/bugs.md 后从 active 移除
④ 复现不了 qa(复现阶段) 主人补充信息 → 续接原 qa 重新复现

Read the full file on GitHub · 256 lines

Files

What ships with it

1 file 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. 26d ago Changed · +11 lines a3e696daec31
  2. 27d ago Changed · +2 lines · +3 tokens per session c1bd6630b9a9
  3. 1mo ago Changed 31be86c8e936
  4. 1mo ago Changed · +1 lines 8ed7aed968e6
  5. 1mo ago Changed · +17 lines · +3 tokens per session a6c7ac7bb0c8
  6. 1mo ago Changed · +1 lines 8cfb37c38e74
  7. 1mo ago Changed · +3 lines · +40 tokens per session 8ff70f514170
  8. 1mo ago Changed · +2 lines 18f81d294b13
  9. 1mo ago Changed · +5 lines da5f507943ac
  10. 2mo ago First seen · 214 lines · 24 tokens per session scan A 37524a28046a

Subscribe to this mod's changes

plan-debug is a skill published in the GitHub repository weiyi88/cc-code (5 stars, last pushed 27d ago), licensed MIT. It adds 70 tokens to every session and 6,658 once invoked, about $0.0003 per session on Opus 5.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-09-13.

Related

plan-debug compared with skills from other repositories

plan-debug next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
plan-debugweiyi88/cc-codeSkill527d agoMITA70Claude Code, Codex
rethink-unblocktae0y/python-project-templateSkill153mo agononeA45Claude Code
checktae0y/python-project-templateSkill153mo agononeA30Claude Code
n8n-docs-assistantn8n-io/n8nSkill213ktodaynoneA71Claude Code, Codex
dorodangoathola/claude-night-marketSkill358todayMITA31Claude Code
sentry-sdk-upgradegetsentry/sentry-for-aiSkill2835d agoMITA48Claude Code
debugRune-kit/runeSkill96todayMITA76Claude Code