spec

spec is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 14 tokens per session (11,146 once invoked), scanned A, original, MIT.

A `/spec` command for writing a specification before implementing a feature. It produces user stories, acceptance criteria, and, for products with a user interface, ASCII wireframes; an option can also produce a clickable HTML prototype.

In plain words
What is it for?
Use it to plan a new feature with `/spec <requirements>`, optionally adding `--prototype`; in a reverse-engineering project, use its wireframe option to document the existing interface.
Why use it?
It turns loosely described requirements into a written agreement about what the feature must do and how it will be accepted. This gives coding work a clear target before implementation begins.

Command for Claude Code

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/dinhnguyenngoc/spec-driven-claude-code/spec
Clone the repo
git clone --depth 1 https://github.com/dinhnguyenngoc/spec-driven-claude-code

Made for: Claude Code.

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/dinhnguyenngoc/spec-driven-claude-code/spec.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/spec)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/spec"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 11,146 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.00014 $0.11146
Opus 5 $0.00007 $0.05573
Sonnet 5 $0.00003 $0.02229
Haiku 4.5 $0.00001 $0.01115

Measured 4d ago against content hash eca70efa5902, 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 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.

.claude/commands/spec.md · 274 lines

How it starts

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

/spec — Specification-Driven Development

"Plan the work, then work the plan."

Purpose

Create a comprehensive specification document before writing any code — defining WHAT to build and WHY, not HOW. This ensures alignment on requirements, constraints, and acceptance criteria.

Usage

How to invoke Result
/spec <requirements> Generate SPEC.md + (if the product has a UI) ASCII wireframes. This is the default — does NOT generate an HTML prototype.
/spec <requirements> --prototype As above, plus a clickable HTML prototype. Can also be triggered in plain language: add "with prototype" / "include prototype" to the request.
/spec --wireframes (brownfield REVERSE only) Opt-in as-is wireframes for the REVERSE baseline (default: waived) — either during the REVERSE run, or post-hoc over an existing baseline (documentation supplement; see §Brownfield Mode → Wireframe supplement). Plain language works too: "kèm wireframe". No-op outside REVERSE — wireframes are already always-produced for UI products. --prototype is NOT accepted in REVERSE (the running app is the click-through truth).
/spec --propose-goals (brownfield REVERSE only) Opt-in labeled goal proposals when the repo has no goals evidence: the BA drafts Business/Product goals + Business Need/Expected Outcomes inferred from observed product behavior, each marked 📝P-nn + provenance + an Open Questions row for the PO to confirm (see §Brownfield Mode → Goals proposal). Numbers (KPI values, baselines, timeframes) are NEVER invented — those cells stay [NEEDS PO]. Default without the flag: the orchestrator asks at run time (propose vs plain N/A); works post-hoc over an approved baseline too.
/spec --scope <selector> (brownfield REVERSE only) Scoped REVERSE — reverse-engineer only the named feature group / endpoints instead of the whole repo: for a large legacy system onboarded incrementally, or when only part of a system is being taken over / ported. Selectors are comma-separated, matched (case-insensitive substring) against the CODEBASE_MAP.md endpoint-inventory columns — route, handler, or module: --scope "/api/v1/bookmarks,/api/v1/tags" · --scope BookmarksController · --scope module:Billing. No match, or a match that would select everything → STOP and print what matched: silently reversing nothing (or the whole repo) is worse than stopping. See §Brownfield Mode → Scoped REVERSE.
/spec (no arguments) See Phase 0: repo already has code → brownfield (needs /discover first); nothing there → ask the user to provide requirements.

Read the full file on GitHub · 274 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 First seen · 274 lines · 14 tokens per session scan A eca70efa5902

Subscribe to this mod's changes

spec is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 5d ago), licensed MIT. It adds 14 tokens to every session and 11,146 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.