plan-before-code

plan-before-code is a skill for Claude Code, Codex from pingfanfan/hello-dsh. It costs 56 tokens per session (1,035 once invoked), scanned A, original, MIT.

A Chinese-language guide for planning substantial software changes before writing code. It asks you to clarify the goal, boundaries, constraints, existing code, implementation steps, risks, and how success will be tested.

In plain words
What is it for?
Use it for multi-file changes, unfamiliar libraries or APIs, refactors, and tasks expected to take more than a short session; it also recommends testing the most uncertain part first.
Why use it?
It reduces rework when a task affects several parts of a project or contains uncertainty, by exposing wrong assumptions early.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for multi-file changes, unfamiliar libraries or APIs, refactors, and tasks expected to take more than a short session; it also recommends testing the most uncertain part first.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pingfanfan/hello-dsh/plan-before-code
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 pingfanfan/hello-dsh --skill plan-before-code
Clone the repo
git clone --depth 1 https://github.com/pingfanfan/hello-dsh

Made for: Claude Code, Codex.

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-before-code

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/pingfanfan/hello-dsh/plan-before-code"><img src="https://agentmods.dev/badge/skills/pingfanfan/hello-dsh/plan-before-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,035 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. Third-party audits
  • 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.00056 $0.01035
Opus 5.5 $0.00022 $0.00414
Sonnet 5.5 $0.00011 $0.00207
Haiku 4.5 $0.00006 $0.00103

Measured 1mo ago against content hash 100635bf010c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-before-code 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 1mo 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/plan-before-code/SKILL.md · 96 lines

What it actually says

动手前先想清楚

判断标准:你能不能一句话说清"做完之后怎么验证它对了"? 说不清就还不能开始写。

小改动不需要这一套。改一个文件、十分钟能完成、出错能立刻回退的事,直接做。 这个技能针对的是改多处、有不确定性、或者做错了要返工半天的任务。

先问清楚需求

在设计方案之前,确认你理解的和对方要的是同一件事:

  • 真正要解决的问题是什么? 对方说的经常是方案,不是问题。「加个导出按钮」背后可能是「我要把数据给财务」,而后者也许有更好的解法。
  • 边界在哪? 什么算完成,什么明确不做。
  • 有没有约束? 兼容性、时间、不能动的部分。

理解有歧义时问,不要猜。 猜错的成本是整个实现返工,问一句的成本是一分钟。

但也别把所有事都问出去。能从代码、文档、现有惯例里找到答案的,自己找。只问那些「不同答案会导致不同做法」的问题。

摸清现状

动手前至少确认:

  • 有没有现成的东西能用? 这个项目里是不是已经有类似的实现、工具函数、模式
  • 相关代码现在是怎么组织的? 新东西应该按什么模式加进来
  • 谁会受影响? 改的这个接口有哪些调用方

先找再造。 项目里已有的模式即使不完美,一致性通常比局部最优更有价值。

写下方案

不需要正式文档,但要写下来。写的过程会暴露没想清楚的地方。

至少包含:

做什么:要改哪些地方,每处大概做什么。

为什么是这个方案:如果有别的选择,为什么不选它们。这一段在被质疑时能省很多口舌。

怎么验证:做完之后跑什么能证明它对了。这一条必须具体到命令或步骤。

风险:哪部分你没把握,哪部分可能踩到未知。

拆步骤

拆的标准:每一步做完都是一个可验证、可提交的状态。

好的拆法:

1. 加新的数据结构和类型(不改行为,可单独提交)
2. 实现新逻辑,暂不接入(有测试,可单独提交)
3. 切换调用方(行为在这一步改变)
4. 删除旧实现

坏的拆法:

1. 改后端
2. 改前端
3. 联调

区别在于:前者每一步结束时系统都是可用的,后者中间状态是坏的。

中间状态不可用的拆法,等于没拆。

先做最不确定的

如果方案里有一部分你没把握(新的库、没用过的 API、不确定性能够不够),先做那一块。

原因很实际:如果它行不通,你要重新设计方案。放在最后做,前面的工作可能全废。

这一步可以写个最小验证脚本,跑通就扔掉,目的只是消除不确定性。

什么时候该停下来重新想

  • 改动范围开始扩散到计划之外
  • 发现需要改一个当初以为不用动的东西
  • 写了一半发现有个更简单的做法
  • 卡在同一个地方超过半小时

这些都是方案有问题的信号,不是「再坚持一下」的信号。 停下来重新想的成本,远低于沿着错的方向继续写。

不要做的事

  • 不要在需求有歧义时开始写
  • 不要把「先写起来再说」当成方案
  • 不要一次动超过你能一眼看完的范围
  • 不要把不确定的部分留到最后
  • 不要为小改动做这一整套(判断标准在开头)
  • 不要写完方案就不改了,发现更好的做法就换
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. 1mo ago First seen · 96 lines · 56 tokens per session scan A 100635bf010c

Subscribe to this mod's changes

plan-before-code is a skill published in the GitHub repository pingfanfan/hello-dsh (101 stars, last pushed 1mo ago), licensed MIT. It adds 56 tokens to every session and 1,035 once invoked, about $0.0002 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-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

skill

Ten native DSH tools give a text-only agent eyes. Use these structured tools directly; do not shell out to the bundled Python scripts or reproduce their implementation. Vision API credentials and model settings are managed by the plugin, so tool calls do not receive credentials.

Anionex/dsh-vision-toolkit · 0 tokens

modsearch

Plug-in web search, X (Twitter) search, and page fetch for models without native web access. Use whenever the task needs current information, external facts, source links, posts from X, or the content of a specific URL, and the active model/harness has no native search or fetch tool. Runs the modsearch CLI to return…

liustack/modsearch · 99 tokens

submit-dsh-plugin

A submission checklist and workflow for adding a DeepSeek Harness plugin to the community’s public catalogue. It prepares the catalogue entry and checks the plugin’s repository, metadata, tests, and required files.

imsai-sh/awesome-deepseek-harness-plugins · 103 tokens

manage-taskboard

Manage work in the native DeepSeek Harness Taskboard with exact task ids and optimistic versions. Use when an Agent must inspect project work, claim an eligible todo, record progress or blockers, verify an implementation, submit it for human review, or release its own claim; also use when a human asks how to accept…

shengsheng90/DSH-taskboard · 88 tokens

industry-research-method

A Chinese-language method for researching an industry by mapping its supply chain, tracking policies and news, and writing sourced reports. It separates the chain into upstream inputs, midstream production, and downstream distribution or use.

PerryLink/dsh-industry-research · 96 tokens