spec

A guided workflow for writing a specification for a change in an existing codebase. It examines the repository, asks questions one at a time, and saves the requirements in a spec.md file.

In plain words
What is it for?
Use it to investigate affected modules, document requirements, and identify project policies related to a planned change.
Why use it?
It helps clarify what a feature should do before coding, while accounting for the system's existing behavior and rules.

Skill for Claude CodeCodex

Part of the brownspec plugin — 5 skills, 4 commands shipped together

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 skills/yknnv/brownspec/spec
Any agent
npx skills add yknnv/brownspec --skill spec
Clone the repo
git clone --depth 1 https://github.com/yknnv/brownspec

Made for: Claude Code, Codex.

Or install brownspec, the plugin that ships this one along with the rest of its 5 skills, 4 commands.

Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,476 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.00070 $0.01476
Opus 5 $0.00035 $0.00738
Sonnet 5 $0.00014 $0.00295
Haiku 4.5 $0.00007 $0.00148

Measured 2d ago against content hash ebcfbf0a8821, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

skills/spec/SKILL.md · 127 lines

How it starts

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

Write a specification for a change

You are specifying a change to an existing system, not a greenfield project. The system already has behavior, contracts, and consumers. Most of what you need is in the repository — go read it before you ask the user anything.

Phase 0 — Locate state

  1. Read .brownspec/conventions.md and .brownspec/project-map.json. If either is missing, say once that /brownspec:init will produce them, then continue without. Rebuild the project map if the dependency manifest has changed since it was cached.
  2. Read .brownspec/policies.md if present. Do not apply it yet — phase 3.
  3. Derive the slug (kebab-case, from the user's description). Working directory is .brownspec/features/<slug>/.
  4. If spec.md already exists there, you are resuming. Read it, find every <!-- OPEN: ... --> marker, and continue from the first one. Do not re-ask anything the file already answers.

Phase 1 — Recon, then a draft

Run levels 1 and 2 of the repo-reading skill. Establish:

  • Which modules the change plausibly touches, and what they currently do
  • The public contracts of those modules — HTTP/RPC, events, tables, config, CLI
  • How similar changes were done before: git log on the touched paths, and any adjacent specs under .brownspec/features/
  • Existing tests covering the affected behavior

Do not run level 3 here. Full blast radius is expensive and belongs in /brownspec:design, once the change actually has a shape. What you need now is a hypothesis about where it lands, not a complete dependency graph.

Then fill ${CLAUDE_PLUGIN_ROOT}/templates/spec.md.tmpl with what you found and what you can reasonably infer, and write it to disk. Inferences go in Assumptions marked (assumed). Anything you genuinely cannot infer gets an <!-- OPEN: ... --> marker in place.

The file on disk is the state of the interview. Do not hold answers in your head.

Phase 2 — Interview

Present the recon summary and your assumptions first. A wrong assumption is cheaper for the user to correct than a question is to answer.

Read the full file on GitHub · 127 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 · 127 lines · 70 tokens per session scan A ebcfbf0a8821

Subscribe to this mod's changes

spec is a skill published in the GitHub repository yknnv/brownspec (2 stars, last pushed 5d ago), licensed MIT. It adds 70 tokens to every session and 1,476 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.

Related

Other skills, from other repositories

prospec-verify

Verify Implementation - Run 5+1 dimension audit (tasks, spec compliance, constitution, knowledge-implementation consistency, tests, design consistency) and assign quality grade (S/A/B/C/D). Triggers: verify, audit, quality check, 驗證, 稽核, 品質檢查, 評級.

benwu95/prospec · 70 tokens

prospec-archive

Archive Changes - Archive completed changes, generate summary, sync requirements to feature specs, and gate archiving on Knowledge sync. Triggers: archive, spec sync, finalize change, 封存, 歸檔, 收尾, 規格同步.

benwu95/prospec · 56 tokens

prospec-knowledge-generate

Generate AI Knowledge - Read raw-scan.md, analyze project structure, autonomously decide module boundaries, and produce Recipe-First module READMEs and index. Triggers: generate knowledge, analyze project, module split, 產生知識, 知識庫, 分析專案, 模組拆分.

benwu95/prospec · 71 tokens

release

Cut a prospec GitHub release — bump version strings, tag, and publish release notes in the established format so the Release Binaries workflow attaches multi-platform binaries. Triggers: release, publish release, cut a release, ship a version, 發布, 發佈, 出版本, 發版, 版本發布, 發布 release.

benwu95/prospec · 71 tokens

submit-pr

Open a prospec pull request in the house format — push the change's two commits, write the Traditional Chinese body, and link it to its issue. Triggers: submit pr, open pr, 開 PR, 送 PR, 發 PR, pull request, 提交 PR.

benwu95/prospec · 59 tokens

submit-issue

Open a prospec GitHub issue in the house format — conventional-commit title, Traditional Chinese body (problem → solutions → acceptance criteria), downstream-compatibility block, series cross-links, and optional model-routing guidance. Triggers: submit issue, open issue, create issue, file issue, 開 issue, 發 issue, 建…

benwu95/prospec · 77 tokens