speckit.product-forge.spec-merge

speckit.product-forge.spec-merge is a command for Claude Code from VaiYav/speckit-product-forge. It costs 100 tokens per session (1,502 once invoked), scanned A, original, MIT.

A command that merges a finished feature’s requirement changes into the project’s canonical specifications—the main documents describing how the system should behave now. It then archives the feature’s change records and audit history.

In plain words
What is it for?
Use it after shipping a feature to add its new, changed, or removed requirements to the appropriate canonical specification. It also helps archive the feature and retain traceability information.
Why use it?
If completed feature requirements stay only in temporary work files, the project’s main specifications become outdated. Merging them preserves one current source of truth and the history of the change.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Background: [docs/improvements/2026-05-sdd-flow-improvements.md](../docs/improvements/2026-05-sdd-flow-improvements.md).

Part of the speckit-product-forge plugin — 31 commands shipped together

Good fit Use it after shipping a feature to add its new, changed, or removed requirements to the appropriate canonical specification. It also helps archive the feature and retain traceability information.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/VaiYav/speckit-product-forge
agentmods
npx agentmods add commands/vaiyav/speckit-product-forge/spec-merge

Made for: Claude Code.

Or install speckit-product-forge, the plugin that ships this one along with the rest of its 31 commands.

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 speckit.product-forge.spec-merge

README.md
[![agentmods](https://agentmods.dev/badge/commands/vaiyav/speckit-product-forge/spec-merge/github.svg)](https://agentmods.dev/commands/vaiyav/speckit-product-forge/spec-merge)
Your own site
<a href="https://agentmods.dev/commands/vaiyav/speckit-product-forge/spec-merge"><img src="https://agentmods.dev/badge/commands/vaiyav/speckit-product-forge/spec-merge/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for speckit.product-forge.spec-merge

Your own site · 80×15
<a href="https://agentmods.dev/commands/vaiyav/speckit-product-forge/spec-merge"><img src="https://agentmods.dev/badge/commands/vaiyav/speckit-product-forge/spec-merge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 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,502 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00100 $0.01502
Opus 5 $0.00050 $0.00751
Sonnet 5 $0.00020 $0.00300
Haiku 4.5 $0.00010 $0.00150

Measured 10d ago against content hash 595c22c01536, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

speckit.product-forge.spec-merge 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 10d 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.

commands/spec-merge.md · 141 lines

How it starts

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

Product Forge — Spec Merge (living spec)

You are the Canonical Spec Keeper. When a feature ships, you merge its delta specs into the project's canonical specs/ source of truth and archive the change with full history — adopting the OpenSpec model so the spec stays a living artifact (spec-anchored), not a throwaway per-change document.

Background: docs/improvements/2026-05-sdd-flow-improvements.md Theme B. ID system: docs/templates/traceability-matrix.md.

User Input

$ARGUMENTS

Inputs: FEATURE_DIR, features_dir, the feature's delta specs, traceability.yml, verify-report.md (its "Suggested canonical-spec updates" section), and code-review.md.


Canonical layout

specs/                                  ← source of truth: how the system behaves NOW
└── {domain}/                           ← organized by domain/capability (e.g. auth, billing)
    └── spec.md                         ← canonical requirements (stable FR-* ids)

features/
└── {slug}/
    ├── spec.md                         ← per-change spec (working)
    └── specs/                          ← DELTA specs for this change (per domain)
        └── {domain}/spec.md            ← ## ADDED / ## MODIFIED / ## REMOVED Requirements

specs/ is the living source of truth; features/{slug}/ is the working area for one change. Deltas key on FR-* ids (minted by bridge/change-request). REQ-* is the V-Model-pack / backfill canonical id only — the forward flow does not mint REQ-*.


Step 0: Idempotency & abort/defer guard

Run before touching any canonical spec — this command must be safe to re-run.

  1. Already merged? Read .forge-status.yml. If phases.spec_merge.status == completed or archived: true, report "already merged — nothing to do" and exit without mutating canonical specs/.
  2. Aborted feature? If the feature ended in an aborted state (e.g. a gate decision of aborted, or .forge-status.yml marks it aborted): do not merge. Archive the working folder to features/_archived/{date}-{slug}-aborted/ (preserving the gate audit trail) and exit. No deltas are folded.
  3. Deferred/rejected change-request? A DEFERRED or REJECTED change-request emits no delta — there is nothing to merge. If a stray delta exists for such a change, skip it (do not fold) and note it in the results.
  4. Otherwise proceed. When applying ## ADDED Requirements in Step 2, treat each as an upsert by FR-id: if the FR-* already exists in the canonical spec, update it in place rather than appending a duplicate.

Read the full file on GitHub · 141 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. 10d ago First seen · 141 lines · 100 tokens per session scan A 595c22c01536

Subscribe to this mod's changes

speckit.product-forge.spec-merge is a command published in the GitHub repository VaiYav/speckit-product-forge (23 stars, last pushed 16d ago), licensed MIT. It adds 100 tokens to every session and 1,502 once invoked, about $0.0005 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.