spec-review

spec-review is a command for Claude Code from qinye6/pi-ccg. It costs 16 tokens per session (1,890 once invoked), scanned A, a copy of spec-review, MIT.

A code-review command that asks two AI models to independently inspect the same proposed changes. It compares their findings against the proposal’s requirements and code-quality rules.

In plain words
What is it for?
Use it to review an OpenSpec proposal, its changed files, requirements, tasks, and property-based testing rules before continuing.
Why use it?
Independent reviews can reveal problems that one review may miss. It keeps the review focused on the selected proposal instead of expanding the work.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths.

Good fit Use it to review an OpenSpec proposal, its changed files, requirements, tasks, and property-based testing rules before continuing.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/qinye6/pi-ccg/spec-review
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.

Clone the repo
git clone --depth 1 https://github.com/qinye6/pi-ccg

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 spec-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/qinye6/pi-ccg/spec-review.svg)](https://agentmods.dev/commands/qinye6/pi-ccg/spec-review)
Your own site
<a href="https://agentmods.dev/commands/qinye6/pi-ccg/spec-review"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/spec-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 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,890 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 100% copy Near-identical to another mod 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.00016 $0.01890
Opus 5 $0.00008 $0.00945
Sonnet 5 $0.00003 $0.00378
Haiku 4.5 $0.00002 $0.00189

Measured 8d ago against content hash 39547c8fd78e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

spec-review 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 8d 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.

Origin

This is a copy

100% identical to spec-review — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

templates/commands/spec-review.md · 125 lines

How it starts

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

Core Philosophy

  • Dual-model cross-validation catches blind spots single-model review would miss.
  • Critical findings SHOULD be addressed before proceeding.
  • Review validates implementation against spec constraints and code quality.
  • This is an independent review tool—can be used anytime, not tied to archive workflow.

Guardrails

  • MANDATORY: Both {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} must complete review before synthesis.
  • Review scope is strictly limited to the proposal's changes—no scope creep.
  • Refer to openspec/config.yaml for project conventions when reviewing OpenSpec proposals.

Steps

  1. Select Proposal

    • Run openspec list --json to display Active Changes.
    • Confirm with user which proposal ID to review.
    • Run openspec status --change "<proposal_id>" --json to load spec and tasks.
  2. Collect Implementation Artifacts

    • Identify all files modified by this proposal.
    • Use git diff to get change summary.
    • Load relevant spec constraints and PBT properties from openspec/changes/<id>/specs/.
  3. Multi-Model Review (PARALLEL)

    • CRITICAL: You MUST launch BOTH {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} in a SINGLE message with TWO Bash tool calls.
    • DO NOT call one model first and wait. Launch BOTH simultaneously with run_in_background: true.
    • 工作目录{{WORKDIR}} 必须通过 Bash 执行 pwd(Unix)或 cd(Windows CMD)获取当前工作目录的绝对路径,禁止从 $HOME 或环境变量推断。如果用户通过 /add-dir 添加了多个工作区,先确定任务相关的工作区。

    Step 3.1: In ONE message, make TWO parallel Bash calls:

    FIRST Bash call ({{BACKEND_PRIMARY}}):

    Bash({
      command: "~/.claude/bin/codeagent-wrapper --progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## {{BACKEND_PRIMARY}} Review Dimensions\n1. **Spec Compliance**: Verify ALL constraints from spec are satisfied\n2. **PBT Properties**: Check invariants, idempotency, bounds are correctly implemented\n3. **Logic Correctness**: Edge cases, error handling, algorithm correctness\n4. **Backend Security**: Injection vulnerabilities, auth checks, input validation\n5. **Regression Risk**: Interface compatibility, type safety, breaking changes\n\n## Output Format (JSON)\n{\n  \"findings\": [\n    {\n      \"severity\": \"Critical|Warning|Info\",\n      \"dimension\": \"spec_compliance|pbt|logic|security|regression\",\n      \"file\": \"path/to/file.ts\",\n      \"line\": 42,\n      \"description\": \"What is wrong\",\n      \"constraint_violated\": \"Constraint ID from spec (if applicable)\",\n      \"fix_suggestion\": \"How to fix\"\n    }\n  ],\n  \"passed_checks\": [\"List of verified constraints/properties\"],\n  \"summary\": \"Overall assessment\"\n}\nEOF",
      run_in_background: true,
      timeout: 300000,
      description: "{{BACKEND_PRIMARY}}: backend/logic review"
    })
    

    SECOND Bash call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE:

    Bash({
      command: "~/.claude/bin/codeagent-wrapper --progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## {{FRONTEND_PRIMARY}} Review Dimensions\n1. **Pattern Consistency**: Naming conventions, code style, project patterns\n2. **Maintainability**: Readability, complexity, documentation adequacy\n3. **Integration Risk**: Dependency changes, cross-module impacts\n4. **Frontend Security**: XSS, CSRF, sensitive data exposure\n5. **Spec Alignment**: Implementation matches spec intent (not just letter)\n\n## Output Format (JSON)\n{\n  \"findings\": [\n    {\n      \"severity\": \"Critical|Warning|Info\",\n      \"dimension\": \"patterns|maintainability|integration|security|alignment\",\n      \"file\": \"path/to/file.ts\",\n      \"line\": 42,\n      \"description\": \"What is wrong\",\n      \"spec_reference\": \"Spec section (if applicable)\",\n      \"fix_suggestion\": \"How to fix\"\n    }\n  ],\n  \"passed_checks\": [\"List of verified aspects\"],\n  \"summary\": \"Overall assessment\"\n}\nEOF",
      run_in_background: true,
      timeout: 300000,
      description: "{{FRONTEND_PRIMARY}}: patterns/integration review"
    })
    

Read the full file on GitHub · 125 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. 8d ago First seen · 125 lines · 16 tokens per session scan A 39547c8fd78e

Subscribe to this mod's changes

spec-review is a command published in the GitHub repository qinye6/pi-ccg (10 stars, last pushed 13d ago), licensed MIT. It adds 16 tokens to every session and 1,890 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to spec-review, differing in 4 lines, and is treated as a copy.