spec

A specification-writing command that turns a brainstorm into a complete implementation specification. A specification records the decisions and details needed to build a feature.

In plain words
What is it for?
It is for reading a feature brainstorm, asking about open decisions, and creating a spec file for a later test-driven development plan. TDD means designing tests alongside the implementation work.
Why use it?
It helps resolve unanswered questions and gives later planning work a clear, agreed source to follow.

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/pproenca/agent-tui/spec
Clone the repo
git clone --depth 1 https://github.com/pproenca/agent-tui

Made for: Claude Code.

Per session 8 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,472 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.00008 $0.01472
Opus 5 $0.00004 $0.00736
Sonnet 5 $0.00002 $0.00294
Haiku 4.5 $0.00001 $0.00147

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

.claude/commands/spec.md · 318 lines

How it starts

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

Spec Command

Transform a brainstorm artifact into a formal, actionable specification with all decisions made.

Artifact Chain

.claude/specs/<feature-name>/
├── brainstorm.md    ← Input (from /brainstorm)
└── spec.md          ← Output (this command)

Downstream: /plan-tdd <feature-name> reads spec.md to create tasks.

Execution Flow

Step 1: Load Brainstorm

Extract feature name from argument: $ARGUMENTS

Look for brainstorm at: .claude/specs/<feature-name>/brainstorm.md

If not found:

No brainstorm found for '<feature-name>'.

Options:
○ Run `/brainstorm <feature-name>` first (Recommended)
○ Create spec from scratch
○ Point to different brainstorm file

If found, read the entire brainstorm.md file.

Step 2: Resolve Open Questions

Extract all - [ ] items from "Open questions" section.

For each unresolved question, use AskUserQuestion to get a decision:

Open Question: <question from brainstorm>

Context: <relevant context from brainstorm>

○ Option A: <if applicable>
○ Option B: <if applicable>
○ Need more research
○ Out of scope for now

If "Need more research" is selected, optionally use WebSearch or Task(Explore) to gather information, then re-ask.

Step 3: Choose Approach

If multiple approaches were identified in brainstorm:

Which approach should we pursue?

Based on brainstorm, the options are:

○ Approach A: <name>
  <brief description>
  Pros: <key pros>
  Cons: <key cons>

○ Approach B: <name>
  <brief description>
  Pros: <key pros>
  Cons: <key cons>

○ Hybrid: Combine elements
○ Need more analysis

Step 4: Define Scope

Present must-haves and nice-to-haves from brainstorm:

Confirm scope for this specification:

Must-haves (from brainstorm):
☑ <item 1>
☑ <item 2>
☐ <item 3> - move to nice-to-have?

Nice-to-haves:
☐ <item 1> - include in v1?
☐ <item 2>

Add anything missing?

Step 5: Architectural Decisions

Based on chosen approach and codebase context, make architectural decisions:

Read the full file on GitHub · 318 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 · 318 lines · 8 tokens per session scan A d406ad4fbde8

Subscribe to this mod's changes

spec is a command published in the GitHub repository pproenca/agent-tui (113 stars, last pushed 3d ago), licensed MIT. It adds 8 tokens to every session and 1,472 once invoked, about $0.0000 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.