opencode-simple: Command for Claude Code

.opencode/commands/spec.md

spec is a command for Claude Code, OpenCode from zhmxiaowo/opencode-simple. It costs 23 tokens per session (421 once invoked), scanned A, original, MIT.

A shortcut that creates a technical specification for a proposed feature without creating the full implementation plan.

In plain words
What is it for?
Use it for a small feature or a single-file change when you need an agreed design first. The workflow researches documentation, writes the specification, and waits for confirmation before coding.
Why use it?
It lets you settle the design before coding, including interfaces, data structures, dependencies, validation commands, and known limitations.

Command for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code command (commands/*.md). Also seen: agent in frontmatter.

This is zhmxiaowo/opencode-simple's own configuration. It tells Claude Code and OpenCode how to work on opencode-simple itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opencode-simple configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zhmxiaowo/opencode-simple. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zhmxiaowo/opencode-simple/main/.opencode/commands/spec.md
Clone the repo
git clone --depth 1 https://github.com/zhmxiaowo/opencode-simple

Made for: Claude Code, OpenCode.

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/zhmxiaowo/opencode-simple/spec/github.svg)](https://agentmods.dev/commands/zhmxiaowo/opencode-simple/spec)
Your own site
<a href="https://agentmods.dev/commands/zhmxiaowo/opencode-simple/spec"><img src="https://agentmods.dev/badge/commands/zhmxiaowo/opencode-simple/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/zhmxiaowo/opencode-simple/spec"><img src="https://agentmods.dev/badge/commands/zhmxiaowo/opencode-simple/spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 421 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.00023 $0.00421
Opus 5.5 $0.00009 $0.00168
Sonnet 5.5 $0.00005 $0.00084
Haiku 4.5 $0.00002 $0.00042

Measured 1mo ago against content hash 2e518d3a52a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

.opencode/commands/spec.md · 43 lines

What it actually says

/spec — Spec-First 快捷方式

/plan 的轻量版本 — 只输出 SPEC 部分,跳过实施步骤分解。

说明

/spec 与 /plan 共享同一个 planner agent 和同一套 Spec-First 流程(MCP 文档研究 → SPEC 输出 → 等待确认),区别仅在于:

命令 输出内容
/plan SPEC + 实施步骤 + 风险评估(完整)
/spec 仅 SPEC(API 设计、数据模型、依赖、编译计划)

工作流程

  1. 需求确认 — 提取功能名称、技术栈、核心需求
  2. MCP 文档研究 — 并行调用 context7(官方文档)+ exa-web-search(社区实践)
  3. 输出 SPEC — 生成包含以下章节的规范文档:
    • API / 接口设计(精确到可直接复制到代码)
    • 数据模型
    • 依赖项及版本
    • 编译验证计划(具体命令)
    • 已知限制 & 兼容性
    • 参考文档链接
  4. 等待确认 — 必须等用户明确确认后方可编码

参数

  • /spec Unity PlayerController
  • /spec Cocos 2D骨骼动画
  • /spec UE5 Gameplay Ability System
  • /spec React Dashboard

何时用 /spec,何时用 /plan

  • 小功能 / 单文件改动 → /spec 足够
  • 多文件 / 跨模块 / 需要分阶段实施 → 用 /plan(包含 SPEC + 完整步骤)
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 · 43 lines · 23 tokens per session scan A 2e518d3a52a5

Subscribe to this mod's changes

spec is a command published in the GitHub repository zhmxiaowo/opencode-simple (2 stars, last pushed 7mo ago), licensed MIT. It adds 23 tokens to every session and 421 once invoked, about $0.0001 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-31.