spec

spec is a command for coding agents from dwarvesf/dwarves-kit. It costs 21 tokens per session (3,785 once invoked), scanned C, original, MIT.

Generate a development spec from a feature idea or decision brief. Creates docs/specs/ with structured requirements.

Command

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/dwarvesf/dwarves-kit/spec
Clone the repo
git clone --depth 1 https://github.com/dwarvesf/dwarves-kit

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/dwarvesf/dwarves-kit/spec.svg)](https://agentmods.dev/commands/dwarvesf/dwarves-kit/spec)
Your own site
<a href="https://agentmods.dev/commands/dwarvesf/dwarves-kit/spec"><img src="https://agentmods.dev/badge/commands/dwarvesf/dwarves-kit/spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,785 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin unknown 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.00021 $0.03785
Opus 5 $0.00010 $0.01893
Sonnet 5 $0.00004 $0.00757
Haiku 4.5 $0.00002 $0.00379

Measured today against content hash b65a16c5178d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

spec scanned grade C with 1 finding 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 today.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- ID-454, the PRE-build twin of ID-395's post-build visual proof. A ticket that carries a picture (a diagram or a prototype) builds better than prose alone. Required (non-empty) for a `full`-lane spec; encouraged, not
commands/spec.md · 284 lines

How it starts

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

You are a senior technical architect producing a development specification. The spec must be detailed enough for a contractor with no prior context to implement the feature correctly using Claude Code.

Process

Bracket the phase for timing (SPEC-129) before starting: bash lib/gate/gate-ledger.sh outcome <rid> Spec start.

Step 1: Gather intent

If a docs/briefs/DECISION-BRIEF.md exists, read it first (it may include a Solution design appended by /kit:design; fold that into the spec's ## Solution. It may also include a ## Design section, from the same command, with a diagram + ADR link(s); fold that into the spec's own ## Design , ADR-0031 §1). Otherwise, ask the user:

  • What are you building? (one paragraph)
  • Is this greenfield or modifying existing code?
  • What's the tech stack? (or read from CLAUDE.md / package.json / go.mod)
  • Who implements? (you, a contractor, a team)

Step 2: Research (if brownfield)

If modifying existing code, run codebase research before generating the spec. This keeps the main session's context clean.

Create docs/research/ directory first.

Mode A: Formal agents (preferred)

If the research agents are installed (check: do .claude/agents/research-stack.md etc. exist?), dispatch all 4 via the Task tool in parallel:

  1. research-stack agent: "Map the technology stack. Write to docs/research/stack.md."
  2. research-context agent: "Map existing features related to [user's feature area]. Write to docs/research/features.md."
  3. research-architecture agent: "Map architecture patterns and conventions. Write to docs/research/architecture.md."
  4. research-pitfalls agent: "Find landmines in [target area / target files]. Write to docs/research/pitfalls.md."
Mode B: Inline fallback

If the formal agents are NOT installed, dispatch 4 Task tool subagents with these inline prompts:

Stack research:

Map the technology stack. Read package.json / go.mod / Cargo.toml / pyproject.toml and config files. Report: languages, frameworks, versions, key dependencies (top 5-10), build/test/deploy commands. If codebase-memory-mcp is available, use get_architecture(). Max 50 lines. Write to docs/research/stack.md.

Read the full file on GitHub · 284 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. today First seen · 284 lines · 21 tokens per session scan C b65a16c5178d

Subscribe to this mod's changes

spec is a command published in the GitHub repository dwarvesf/dwarves-kit (11 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 3,785 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.