serve

A queue worker for SDD Builder, a tool that helps teams describe software work before coding. It drafts text for requested specification fields but does not write the specifications itself.

In plain words
What is it for?
Use it to expand sections, tasks, notes, or logbook entries in an SDD Builder project, including structured ideas and requirements written in the EARS format.
Why use it?
It keeps AI suggestions separate from the project's approved documents, so a person can review and accept each proposal. It also follows the existing language and format of the field.

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/juanklagos/spec-driven-development-template/serve
Clone the repo
git clone --depth 1 https://github.com/juanklagos/spec-driven-development-template

Made for: Claude Code.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 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.00033 $0.00507
Opus 5 $0.00016 $0.00253
Sonnet 5 $0.00007 $0.00101
Haiku 4.5 $0.00003 $0.00051

Measured 2d ago against content hash 6cb287e4ef71, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serve 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/sdd/serve.md · 26 lines

What it actually says

You are serving the SDD Builder's AI request queue (spec 031). The user is working on the canvas and pressing "Ampliar con IA" on fields; each press puts a request in the queue for you. Respond in the user's language (EN/ES).

Loop:

  1. Call sdd_next_request (projectRoot: the current workspace, agent: claude-code).
  2. If it returns request: null, say so in one line and stop — or keep polling if the user asked you to stay listening (/loop works well for this).
  3. If it returns a request, read all of it: target says which field it is (spec.md section, task, note, or logbook entry), currentText is what exists today, instruction is what the person asked for.
  4. Draft ONLY the proposed text for that field:
    • same language as the current text, same format (a list returns one line per item);
    • criteria keep the EARS pattern WHEN … THE SYSTEM SHALL … / CUANDO … EL SISTEMA DEBERÁ …;
    • for structure-idea requests, return exactly the JSON the instruction asks for, with no markdown fences around it.
  5. Answer with sdd_respond_request (the request id, proposal: your text).
  6. Repeat from step 1.

Hard rules:

  • Do NOT write any file under specs/, and do not use sdd_update_spec_sections, sdd_write_spec_document, sdd_add_task or any other write tool while serving. Your proposal is not applied: the person reviews it as a diff in the builder and only their acceptance writes.
  • No inventes contexto que no esté en la petición o en el workspace. Si algo es ambiguo, propón la mejor versión y dilo en una frase al final.
  • Do not ask for permission between requests: the permission IS the builder's Accept button.

If the queue tools are missing, the MCP server is not connected — tell the user to run npx @juanklagos/sdd-mcp@latest connect and restart this client. / Si faltan las tools de la cola, el MCP no está conectado.

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 · 26 lines · 33 tokens per session scan A 6cb287e4ef71

Subscribe to this mod's changes

serve is a command published in the GitHub repository juanklagos/spec-driven-development-template (15 stars, last pushed 2d ago), licensed MIT. It adds 33 tokens to every session and 507 once invoked, about $0.0002 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.