spec-plan

spec-plan is a command for Claude Code from fengshao1227/ccg-workflow. It costs 17 tokens per session (1,944 once invoked), scanned A, original, MIT.

A planning command that examines a specification, resolves unclear points, and produces a step-by-step implementation plan. It uses more than one analysis model and requires each requirement to have property-based tests, which check general rules rather than only fixed examples.

In plain words
What is it for?
Use it after research to settle ambiguities, define requirements and tests, and create an executable plan.
Why use it?
It aims to remove decisions and hidden assumptions before coding begins, so implementation can follow an explicit plan.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; names the AskUserQuestion tool.

Part of the ccg plugin — 58 skills, 12 commands, 7 agents shipped together

Good fit Use it after research to settle ambiguities, define requirements and tests, and…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fengshao1227/ccg-workflow/spec-plan
About the project

CCG is a command-line workflow engine that coordinates Claude, Codex, Gemini, and other models as specialized collaborators on coding tasks. It is used to analyze requests, choose a strategy, delegate work to model-specific roles, and combine their results. The catalogue entries provide the skills, commands, agents, and plugin that implement this workflow.

fengshao1227/ccg-workflow · 5,874 stars · on GitHub · ccg.fengshao1227.com

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.

Clone the repo
git clone --depth 1 https://github.com/fengshao1227/ccg-workflow

Made for: Claude Code.

Or install ccg, the plugin that ships this one along with the rest of its 58 skills, 12 commands, 7 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/fengshao1227/ccg-workflow/spec-plan.svg)](https://agentmods.dev/commands/fengshao1227/ccg-workflow/spec-plan)
Your own site
<a href="https://agentmods.dev/commands/fengshao1227/ccg-workflow/spec-plan"><img src="https://agentmods.dev/badge/commands/fengshao1227/ccg-workflow/spec-plan.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 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,944 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.00017 $0.01944
Opus 5 $0.00009 $0.00972
Sonnet 5 $0.00003 $0.00389
Haiku 4.5 $0.00002 $0.00194

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

Security

Grade A, and why

spec-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 7d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • spec-plan — 100% identical, 4 lines differ
templates/commands/spec-plan.md · 143 lines

How it starts

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

Core Philosophy

  • The goal is to eliminate ALL decision points—implementation should be pure mechanical execution.
  • Every ambiguity must be resolved into explicit constraints before proceeding.
  • Multi-model collaboration surfaces blind spots and conflicting assumptions.
  • Every requirement must have Property-Based Testing (PBT) properties—focus on invariants.

Guardrails

  • Do not proceed to implementation until every ambiguity is resolved.
  • Multi-model collaboration is mandatory: use both {{BACKEND_PRIMARY}} and {{FRONTEND_PRIMARY}}.
  • If constraints cannot be fully specified, escalate to user or return to research phase.
  • Refer to openspec/config.yaml for project conventions.
  • USER GUIDANCE RULE: When suggesting next steps to the user, ALWAYS use CCG commands (/ccg:spec-research, /ccg:spec-plan, /ccg:spec-impl, /ccg:spec-review). NEVER suggest /opsx:* commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents.
  • TASKS FORMAT RULE: When generating or modifying tasks.md, ALL tasks MUST use checkbox format (- [ ] X.Y description). Heading+bullet format will cause OpenSpec CLI to parse 0 tasks and block the workflow.
  • PHASE BOUNDARY: This phase ONLY generates OPSX artifacts (specs.md, design.md, tasks.md). Do NOT modify any source code. Do NOT proceed to implementation. After artifacts are generated, STOP and inform the user: "Plan complete. Run /ccg:spec-impl to start implementation."

Steps

  1. Select Change

    • Run openspec list --json to display Active Changes.
    • Confirm with user which change ID to refine.
    • Run openspec status --change "<change_id>" --json to review current state.
  2. Multi-Model Implementation Analysis (PARALLEL)

    • CRITICAL: You MUST launch BOTH {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} in a SINGLE message with TWO Bash tool calls.
    • DO NOT call one model first and wait. Launch BOTH simultaneously with run_in_background: true.
    • 工作目录{{WORKDIR}} 必须通过 Bash 执行 pwd(Unix)或 cd(Windows CMD)获取当前工作目录的绝对路径,禁止从 $HOME 或环境变量推断。如果用户通过 /add-dir 添加了多个工作区,先确定任务相关的工作区。

    Step 2.1: In ONE message, make TWO parallel Bash calls:

    FIRST Bash call ({{BACKEND_PRIMARY}}):

    Bash({
      command: "~/.claude/bin/codeagent-wrapper --progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}{{KIMI_MODEL_FLAG}}{{OPENCODE_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from backend perspective:\n- Implementation approach\n- Technical risks\n- Alternative architectures\n- Edge cases and failure modes\nOUTPUT: JSON with analysis\nEOF",
      run_in_background: true,
      timeout: 300000,
      description: "{{BACKEND_PRIMARY}}: backend analysis"
    })
    

    SECOND Bash call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE:

    Bash({
      command: "~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}{{KIMI_MODEL_FLAG}}{{OPENCODE_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from frontend/integration perspective:\n- Maintainability assessment\n- Scalability considerations\n- Integration conflicts\nOUTPUT: JSON with analysis\nEOF",
      run_in_background: true,
      timeout: 300000,
      description: "{{FRONTEND_PRIMARY}}: frontend analysis"
    })
    

    Step 2.2: After BOTH Bash calls return task IDs, wait for results with TWO TaskOutput calls:

    TaskOutput({ task_id: "<codex_task_id>", block: true, timeout: 600000 })
    TaskOutput({ task_id: "<gemini_task_id>", block: true, timeout: 600000 })
    

    前端模型失败必须重试:若前端模型调用失败,最多重试 2 次(间隔 5 秒)。3 次全败才跳过。 ⛔ 后端模型结果必须等待:后端模型执行 5-15 分钟属正常,超时后继续轮询,禁止跳过。

    • Synthesize responses and present consolidated options to user.
  3. Uncertainty Elimination Audit

    • {{BACKEND_PRIMARY}}: "Review proposal for unspecified decision points. List each as: [AMBIGUITY] → [REQUIRED CONSTRAINT]"
    • {{FRONTEND_PRIMARY}}: "Identify implicit assumptions. Specify: [ASSUMPTION] → [EXPLICIT CONSTRAINT NEEDED]"

Read the full file on GitHub · 143 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. 7d ago First seen · 143 lines · 17 tokens per session scan A c22bd03232ac

Subscribe to this mod's changes

spec-plan is a command published in the GitHub repository fengshao1227/ccg-workflow (5,874 stars, last pushed 3d ago), licensed MIT. It adds 17 tokens to every session and 1,944 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.