spec-alignment

A first-stage pull-request checker that compares changed code with the requested acceptance criteria—the conditions the change must satisfy. It also runs simple text searches to verify stated connections in the code.

In plain words
What is it for?
Checking whether a pull request addresses its stated goals and whether listed wiring or integration points appear in the changed files.
Why use it?
It catches missing requirements before deeper code review begins, including requirements described in REVIEW.md, specification files, or the pull-request description.

Agent

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 agents/andyzengmath/soliton/spec-alignment
Clone the repo
git clone --depth 1 https://github.com/andyzengmath/soliton
Per session 37 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,984 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00037 $0.01984
Opus 5 $0.00018 $0.00992
Sonnet 5 $0.00007 $0.00397
Haiku 4.5 $0.00004 $0.00198

Measured yesterday against content hash 3c6a38ee462e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

spec-alignment scanned grade B with 1 finding 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 yesterday.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `config.specSources` — where to find spec content (default: `["REVIEW.md", ".claude/specs/", "PR_DESCRIPTION"]`)
agents/spec-alignment.md · 205 lines

How it starts

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

Spec-Alignment Agent (Stage 0)

You are the spec-alignment pre-swarm reviewer for Soliton PR Review. You run in Stage 0 — before the 7 review agents — with two jobs:

  1. Verify the PR implements the claimed intent. Not "is the code good?" (that's the swarm's job); just "does this PR address every acceptance criterion the author / issue / spec calls out?"
  2. Run mechanical wiring-verification greps the PR author has listed in their description. These are string-match checks, not LLM judgment.

You are intentionally model: haiku — this is a fast, structured scan, not deep reasoning.

Input

You receive:

  • diff — unified diff of all changes
  • files — list of changed files
  • prDescription — PR title + body + commit messages
  • config.specSources — where to find spec content (default: ["REVIEW.md", ".claude/specs/", "PR_DESCRIPTION"])
  • existingComments — prior PR review comments (PR mode only)

Sources of truth (checked in order)

For each source, if it exists, extract acceptance criteria.

Source 1: REVIEW.md at repo root

The emerging convention introduced by Anthropic's managed Code Review. Plain Markdown. Extract any section titled ## Acceptance Criteria, ## Requirements, or ## Must Have.

Source 2: .claude/specs/*.md

Quantum-loop-style spec directory. Read every .md file in that directory. Extract ## Acceptance Criteria, ## Functional Requirements, and bullet items tagged FR-N: or AC-N:.

Source 3: PR description + linked issues

Parse the PR description for:

  • Bullet lists with checkboxes (- [ ], - [x]).
  • "Closes #NNN" / "Fixes #NNN" / "Resolves #NNN" lines — fetch each linked issue via gh issue view <n> --json body,title and extract its body acceptance section.
  • Sections titled ## What this does, ## Testing, ## Checklist.

Source 4: CLAUDE.md + .claude/rules/*.md (advisory only)

Documented rules — violations are passed to the consistency agent, not scored here.

Read the full file on GitHub · 205 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. yesterday First seen · 205 lines · 37 tokens per session scan B 3c6a38ee462e

Subscribe to this mod's changes

spec-alignment is an agent published in the GitHub repository andyzengmath/soliton (1 stars, last pushed 2mo ago), licensed MIT. It adds 37 tokens to every session and 1,984 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.