plan

A planning command for turning a requested software feature into a structured implementation plan, including research and project checks.

In plain words
What is it for?
Use it to review a feature request, check project guidance, identify unknowns, research solutions, and divide the work into stages.
Why use it?
It gives the agent a defined planning process before coding and can run configured checks or setup steps first.

Command

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 commands/linfee/spec-kit-cn/plan
Clone the repo
git clone --depth 1 https://github.com/Linfee/spec-kit-cn
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,774 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.00015 $0.01774
Opus 5 $0.00008 $0.00887
Sonnet 5 $0.00003 $0.00355
Haiku 4.5 $0.00002 $0.00177

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

Security

Grade A, and why

plan 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.

templates/commands/plan.md · 160 lines

How it starts

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

用户输入

$ARGUMENTS

在继续之前, 你必须考虑用户输入(如果不为空)。

执行前检查

检查扩展钩子(规划前):

  • 检查项目根目录是否存在 .specify/extensions.yml 文件。
  • 如果存在, 读取该文件并查找 hooks.before_plan 键下的条目
  • 如果 YAML 无法解析或无效, 静默跳过钩子检查并正常继续
  • 过滤掉 enabled 显式为 false 的钩子。将没有 enabled 字段的钩子视为默认启用。
  • 对于每个剩余的钩子, 不要尝试解释或评估钩子的 condition 表达式:
    • 如果钩子没有 condition 字段, 或者为 null/空, 则将钩子视为可执行
    • 如果钩子定义了非空的 condition, 则跳过该钩子并将条件评估留给 HookExecutor 实现
  • 对于每个可执行的钩子, 根据其 optional 标志输出以下内容:
    • 可选钩子 (optional: true):
      ## 扩展钩子
      
      **可选前置钩子**: {extension}
      命令: `/{command}`
      描述: {description}
      
      提示: {prompt}
      执行方式: `/{command}`
      
    • 必需钩子 (optional: false):
      ## 扩展钩子
      
      **自动前置钩子**: {extension}
      正在执行: `/{command}`
      EXECUTE_COMMAND: {command}
      
      等待钩子命令的结果后再继续执行大纲。
      
  • 如果没有注册钩子或 .specify/extensions.yml 不存在, 静默跳过

大纲

  1. 设置: 从仓库根目录运行 {SCRIPT} 并解析 JSON 获取 FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH。对于参数中的单引号如 "I'm Groot", 使用转义语法: 例如 'I'''m Groot' (或尽可能使用双引号: "I'm Groot")。

  2. 加载上下文: 读取 FEATURE_SPEC 和 /memory/constitution.md。加载 IMPL_PLAN 模板(已复制)。

  3. 执行规划工作流: 按照 IMPL_PLAN 模板中的结构:

    • 填写技术上下文(将未知项标记为 "NEEDS CLARIFICATION")
    • 从章程填写章程检查部分
    • 评估门控条件(如果违规且无正当理由则报 ERROR)
    • 阶段 0: 生成 research.md(解决所有 NEEDS CLARIFICATION)
    • 阶段 1: 生成 data-model.md, contracts/, quickstart.md
    • 阶段 1: 通过运行代理脚本更新代理上下文
    • 设计后重新评估章程检查
  4. 停止并报告: 命令在阶段 2 规划后结束。报告分支, IMPL_PLAN 路径和生成的制品。

  5. 检查扩展钩子: 报告后, 检查项目根目录是否存在 .specify/extensions.yml 文件。

    • 如果存在, 读取该文件并查找 hooks.after_plan 键下的条目
    • 如果 YAML 无法解析或无效, 静默跳过钩子检查并正常继续
    • 过滤掉 enabled 显式为 false 的钩子。将没有 enabled 字段的钩子视为默认启用。
    • 对于每个剩余的钩子, 不要尝试解释或评估钩子的 condition 表达式:
      • 如果钩子没有 condition 字段, 或者为 null/空, 则将钩子视为可执行
      • 如果钩子定义了非空的 condition, 则跳过该钩子并将条件评估留给 HookExecutor 实现
    • 对于每个可执行的钩子, 根据其 optional 标志输出以下内容:
      • 可选钩子 (optional: true):
        ## 扩展钩子
        
        **可选钩子**: {extension}
        命令: `/{command}`
        描述: {description}
        
        提示: {prompt}
        执行方式: `/{command}`
        
      • 必需钩子 (optional: false):
        ## 扩展钩子
        
        **自动钩子**: {extension}
        正在执行: `/{command}`
        EXECUTE_COMMAND: {command}
        
    • 如果没有注册钩子或 .specify/extensions.yml 不存在, 静默跳过

Read the full file on GitHub · 160 lines

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 · 160 lines · 15 tokens per session scan A 4b91f5b000d5

Subscribe to this mod's changes

plan is a command published in the GitHub repository Linfee/spec-kit-cn (695 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 1,774 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.