speckit.companion.living-validate

speckit.companion.living-validate is a command for Claude Code from alfredoperez/speckit-companion. It costs 47 tokens per session (897 once invoked), scanned A, original, MIT.

A read-only checker for the structure of living specifications and feature-spec changes. It reports requirements without scenarios, scenarios missing WHEN or THEN steps, duplicate headings, and changes pointing to missing sections.

In plain words
What is it for?
Use it to inspect specification files from a repository root and optionally produce machine-readable JSON for another workflow.
Why use it?
It catches malformed or disconnected specification content before it is folded into the main specification, without editing files or stopping the command itself.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .specify/extensions/companion/scripts/living_validate.py.

Good fit Use it to inspect specification files from a repository root and optionally produce machine-readable JSON for another workflow.

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/alfredoperez/speckit-companion
agentmods
npx agentmods add commands/alfredoperez/speckit-companion/speckit.companion.living-validate

Made for: Claude Code.

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.companion.living-validate

README.md
[![agentmods](https://agentmods.dev/badge/commands/alfredoperez/speckit-companion/speckit.companion.living-validate/github.svg)](https://agentmods.dev/commands/alfredoperez/speckit-companion/speckit.companion.living-validate)
Your own site
<a href="https://agentmods.dev/commands/alfredoperez/speckit-companion/speckit.companion.living-validate"><img src="https://agentmods.dev/badge/commands/alfredoperez/speckit-companion/speckit.companion.living-validate/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.companion.living-validate

Your own site · 80×15
<a href="https://agentmods.dev/commands/alfredoperez/speckit-companion/speckit.companion.living-validate"><img src="https://agentmods.dev/badge/commands/alfredoperez/speckit-companion/speckit.companion.living-validate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 897 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.00047 $0.00897
Opus 5.5 $0.00019 $0.00359
Sonnet 5.5 $0.00009 $0.00179
Haiku 4.5 $0.00005 $0.00090

Measured 1mo ago against content hash 93fc2592e611, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

speckit.companion.living-validate 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 1mo 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.

apps/speckit-extension/commands/speckit.companion.living-validate.md · 52 lines

How it starts

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

Spec Shape

Check that every living spec, and every active feature spec's delta sections, are shaped the way every reader of them assumes. A living spec is only worth keeping if what gets folded into it is trustworthy, and until something checked, a requirement with no scenario or a delta pointing at a heading that does not exist landed silently and was found weeks later by a person reading the file.

Read-only — it never edits anything, and it never fails (always exits success). The fold consumes the same checks and refuses to write on an error; this command only reports. A surrounding workflow may treat findings as a gate; the command itself does not.

This is opt-in. With living specs disabled (or no config), it reports nothing and exits clean.

Prerequisites

  • Verify Python is available by running python3 --version.
  • If python3 is not available, warn the user and skip: [companion] Warning: python3 not detected; skipped the spec shape check.

Execution

Run the checker from the repository root. When the invocation names a capability, add --capability <name> so only that capability's spec is checked:

python3 .specify/extensions/companion/scripts/living_validate.py

Add --json when a caller needs the machine-readable object rather than the list. Each finding carries a severity, a stable code, the path, the line, a sentence saying what is wrong, and a one-line fix.

What it reports

Code Severity Raised when
requirement-without-scenario warning A requirement states a rule and never says how anyone would know it held.
requirement-bundles-rules warning A requirement states more than 4 SHALL, MUST or SHOULD sentences under one heading. Split it: one requirement per rule, each with its own heading and scenario.
requirement-too-wordy warning A requirement takes more than 120 words to state its rule. Cut it to the rule and the one reason that stops someone breaking it.
scenario-missing-half error A scenario has a condition and no outcome, or an outcome and no condition. The keywords are recognised with or without emphasis, so - WHEN … counts exactly as - **WHEN** … does.
duplicate-requirement error Two requirements in one capability share a heading, which is the join key fold-back and coverage use.
unknown-capability error A delta block is marked for a capability the registry does not list.
delta-heading-not-found warning A MODIFIED or REMOVED entry names a heading the target spec does not carry. The fold promotes an unmatched modification into an addition, so this is a defined outcome rather than damage.
unmatched-touches-glob warning A file marker names a pattern matching nothing on disk.
  • requirements-outside-capability — every file marker names code the capability does not claim, so nothing resolves for that behaviour.
  • capability-claims-undescribed-code — the capability claims code no requirement describes, so a change there is briefed with nothing. | unbalanced-fence | warning | A code fence is opened and never closed, so everything after it is invisible to every reader. |

Read the full file on GitHub · 52 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. 1mo ago Changed · +2 lines 93fc2592e611
  2. 1mo ago Changed d2f9338d559d
  3. 1mo ago Changed · +2 lines dfb01ffbeaf2
  4. 1mo ago Changed 7916cf75faf9
  5. 1mo ago First seen · 48 lines · 47 tokens per session scan A e29b4354b823

Subscribe to this mod's changes

speckit.companion.living-validate is a command published in the GitHub repository alfredoperez/speckit-companion (99 stars, last pushed 10d ago), licensed MIT. It adds 47 tokens to every session and 897 once invoked, about $0.0002 per session on Opus 5.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-09-06.