spec

spec is a command for Claude Code from SatoruoGojoo/octopus. It costs 62 tokens per session (1,733 once invoked), scanned A, original, MIT.

A requirements-planning command for OpenSpec, a tool that records software changes as proposals, specification updates, and task lists. It clarifies the request, challenges risky assumptions, and pauses for approval before implementation.

In plain words
What is it for?
Use it to analyse a feature, create an OpenSpec change in Draft status, review decisions with the project owner, and lock the work for a later build step.
Why use it?
It turns an unclear request into an agreed plan and prevents coding from starting before key decisions are settled.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents.

Part of the octopus plugin — 9 commands, 7 agents, 1 hook shipped together

Good fit Use it to analyse a feature, create an OpenSpec change in Draft status, review decisions with the project owner, and lock the work for a later build step.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/satoruogojoo/octopus/spec
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/SatoruoGojoo/octopus

Made for: Claude Code.

Or install octopus, the plugin that ships this one along with the rest of its 9 commands, 7 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 spec

README.md
[![agentmods](https://agentmods.dev/badge/commands/satoruogojoo/octopus/spec/github.svg)](https://agentmods.dev/commands/satoruogojoo/octopus/spec)
Your own site
<a href="https://agentmods.dev/commands/satoruogojoo/octopus/spec"><img src="https://agentmods.dev/badge/commands/satoruogojoo/octopus/spec/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 spec

Your own site · 80×15
<a href="https://agentmods.dev/commands/satoruogojoo/octopus/spec"><img src="https://agentmods.dev/badge/commands/satoruogojoo/octopus/spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 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,733 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.00062 $0.01733
Opus 5 $0.00031 $0.00866
Sonnet 5 $0.00012 $0.00347
Haiku 4.5 $0.00006 $0.00173

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

Security

Grade A, and why

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

commands/spec.md · 63 lines

How it starts

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

這是 Octopus 的 spec 管線(SDD 前半段)。你(主對話)擔任 Core 編排,依序執行。

設計原則:討論集中在這一段,拍板只有一次。TPM 在鎖定點看到的是完整包(proposal+決策卡+tasklist),鎖定之後 /octopus:build 全自主執行,他不需要再被打斷。

拍板停點很輕:呈現完整包後,使用者回「OK」=所有決策卡採建議選項+同意鎖定,一個字放行;有意見才回話逐項處理。沒有跳過此停點的模式——Locked 只有一個意思:TPM 拍板過。

步驟

0. 前置檢查+起跑 run-marker(確定性動作)

  1. openspec CLI:Bash 跑 openspec --version。失敗 → ,請使用者先安裝(npm 全域安裝 OpenSpec CLI,指令以官方 README 為準:github.com/Fission-AI/OpenSpec),裝好回覆再續。
  2. openspec/ 結構:目標 repo 沒有 openspec/,請使用者跑 openspec init;CLI 1.7.0+ 支援非互動參數,經使用者明確點頭後可代跑 openspec init --tools claude --no-animation(互動式版本仍不代跑)。
  3. 把當下 ISO 時間戳寫進 .claude/.octopus-arena/.run(目錄不存在先建立)——守門 hook 只在 marker 有效期間生效(守門跟著管線走,設計文件 §6.2)。

marker 是本管線的責任,任何出口都要清:marker 寫入後,每一條結束路徑都必須先刪除 .run 再回話——步驟 4 的鎖定或保持 Draft、Analyst 打回需求(驗收不可測)、openspec validate 兩輪仍未過而呈報錯誤、或執行中被使用者喊停。漏刪會讓守門殘留到 TTL(4 小時)到期,期間使用者日常的 merge/主幹 commit 會被 branch-guard 誤攔。

1. 需求釐清

先 Read .claude/.octopus-arena/decisions.md(如存在),挑出與本需求相關的舊拍板決策——之後連同需求原文一併轉給 analyst 與 architect(防止與舊決策靜默矛盾;方案確實要翻舊案時,明標「翻 <日期> 決策」並開決策卡)。

用 Agent 工具啟動 analyst,把需求原文(含圖片)完整轉給它。

  • 它若反問(≤3 問 × ≤2 輪),把問題轉給使用者,答案轉回給它(用 SendMessage 延續同一個 analyst,不要重開)
  • 它會做魔鬼代言人挑戰;挑戰結果一併呈現給使用者
  • 產出:結構化需求分析

2. 起草 change

用 Agent 工具啟動 architect(主線:起草 change),把 Analyst 的結構化需求分析全文轉給它。

產出:openspec/changes/<name>/——proposal.md + specs delta + tasks.md + .openspec.yamloctopus.status: Draft)+ 決策卡清單(如有)。一個需求一筆 change——需求大到裝不進一筆時,如實說明並建議使用者拆成兩次 spec,不要自行拆分。

落檔後 Bash 跑 openspec validate <change-name>:沒過就把錯誤轉回同一個 architect 修(SendMessage,上限 2 輪);仍沒過 → 如實呈報錯誤,不硬鎖。

3.【拍板 OK 停點】

向使用者一次呈現完整包:

  • change 路徑與 proposal 摘要(目標 / In-Out / delta Requirement 條數)
  • 所有待拍板決策卡
  • tasklist(相依順序)

請他拍板:回「OK」=所有決策卡採建議選項+同意鎖定,一次完成;有個別意見就逐項處理。結論(含 OK 時採用的建議選項)用 Edit 寫進 proposal.md 的「已拍板決策」表。

4. 鎖定(確定性動作,使用者明確說鎖才執行)

  • 用 Edit 把 changes/<name>/.openspec.yamloctopus.status: Draft 改為 octopus.status: Locked
  • 拍板決策追記目標 repo 的 .claude/.octopus-arena/decisions.md(日期|change 名|決策|結論)。首次建立該目錄時,提醒使用者把 .claude/.octopus-arena/ 加入該 repo 的 .gitignore
  • 告知使用者:/octopus:build <change-name>自主執行到驗收完成(實作→測試→審查→修到乾淨),他只需要等驗收報告與 merge

Read the full file on GitHub · 63 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. 4d ago Changed · +2 lines 0e38ff7d5f16
  2. 8d ago First seen · 61 lines · 62 tokens per session scan A 7b13a2e72808

Subscribe to this mod's changes

spec is a command published in the GitHub repository SatoruoGojoo/octopus (2 stars, last pushed 7d ago), licensed MIT. It adds 62 tokens to every session and 1,733 once invoked, about $0.0003 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-31.