specmanager-build

A command for building one approved phase of a SpecManager feature plan through a builder agent. A phase is a defined group of implementation tasks.

In plain words
What is it for?
Use it to build the next phase or a named phase, either task by task or as one explicitly selected batch.
Why use it?
It keeps feature work aligned with the approved plan and stops at the selected phase boundary. It can also prevent phases from being built out of order unless forced.

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/joanseg/specmanager/specmanager-build
Clone the repo
git clone --depth 1 https://github.com/joanseg/specmanager
Per session 25 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,990 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.00025 $0.03990
Opus 5 $0.00013 $0.01995
Sonnet 5 $0.00005 $0.00798
Haiku 4.5 $0.00003 $0.00399

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

Security

Grade A, and why

specmanager-build 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.

plugins/specmanager/commands/specmanager-build.md · 92 lines

How it starts

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

Build one phase of the plan for $ARGUMENTS.

$ARGUMENTS is <feature> <phaseName | "next"> [--force] [--bulk].

  • next resolves to the first phase whose tasks aren't all done (get_next_phase).
  • Otherwise <phaseName> must match a ## Phase <name> heading from plan.md exactly.
  • --force allows building out of order. Off by default.
  • --bulk dispatches the whole phase in one builder Task (max tier of its tasks) instead of the default per-task loop. Off by default — it re-accepts a single 529's blast radius across the phase, so it's an explicit opt-in for tiny, tightly-coupled phases only.

Steps

  1. Parse the arguments. Split into <feature>, <phaseName>, optional --force, optional --bulk. If <phaseName> is missing, ask the user (offer list_phases({ featureId })). Default dispatch is per-task (step 7); --bulk switches to one whole-phase builder Task.

  2. Resolve the feature. list_features → match by id/slug. Stop if not found.

  3. Check the Plan is approved. check_gate({ featureId, stage: "plan" }) must be ok: true AND an approved plan doc must exist (list_documents({ featureId, stage: "plan" })). If not, report and stop — the builder needs a stable plan.

  4. Resolve the target phase. nextget_next_phase({ featureId }); null means "All phases done — nothing to build", stop. Otherwise find <phaseName> in list_phases({ featureId }); if absent, list available phases and stop. 4c. Mark the build active (arms the Stop-gate). set_active_build({ featureId, phase: <resolvedPhaseName> }) — use the concrete resolved phase name, never "next". This writes the .cache/active-build.json marker that pins the Stop-gate to this exact phase; without it the gate is a no-op. Pair this with clear_active_build() on every terminal path (steps 8 and 9 below).

  5. Order check (unless --force). If any phase with a lower order than the target has status !== "done", refuse: "Phase X has open tasks — build it first, or pass --force."

  6. Idempotency. If the target phase is already done, report and stop — suggest /specmanager-walkthrough <feature> <phaseName> instead. 6b. Confirm the session tier→model table (R2). Once per build session, AskUserQuestion to confirm or remap which Claude Code model alias each complexity tier dispatches at. Pre-fill the defaults from core/tiers.ts: cheap → haiku (complexity 1), standard → sonnet (complexity 2), strong → opus (complexity 3, and anything >3 / unscored). Offer the defaults as the recommended option plus an "all opus" / custom alternative. Hold the chosen table in session state for the rest of this build. Always use aliases, never dated model ids. If the user declines, keep the defaults.

  7. Invoke the builder (per-task tier dispatch is the enforced default; --bulk is the opt-in). Work the phase's tasks in dependsOn order.

    Default — per task (N=1, no flag). For each task: read its complexity (list_tasks), map complexity → tier → alias via the session table (default 1→cheap/haiku, 2→standard/sonnet, 3→strong/opus, >3 or null → strong), and dispatch Task({ subagent_type: "builder", model: <alias>, prompt: ... }) with: feature id/title/slug, the resolved phase name (not next), the single task id + title, the Plan doc id, and the phase's exit-test line lifted from plan.md. If the resolved alias is unknown/unavailable, omit model: so the builder runs at the session default (inherit) — never error or block (AC4). The builder marks that task in_progressdone with artifacts; on its return move to the next task. Per-task is the default because it isolates a 529 to a single card and spends the cheapest adequate model on each.

    Opt-in — --bulk. When --bulk was passed (step 1), dispatch all the phase's tasks in one builder Task at the max tier of its tasks (resolve each task's alias, pick the strongest). This trades per-task isolation/tier savings for one builder context — use only on tiny, tightly-coupled phases. Then fall through to step 8's re-resolve exactly as the per-task path does.

Read the full file on GitHub · 92 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 · 92 lines · 25 tokens per session scan A 5afc6e0fe663

Subscribe to this mod's changes

specmanager-build is a command published in the GitHub repository joanseg/specmanager (19 stars, last pushed 18d ago), licensed MIT. It adds 25 tokens to every session and 3,990 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.