SpecPilot: Command for Claude Code

.claude/commands/specpilot-validate.md

specpilot-validate is a command for Claude Code from girishr/SpecPilot. It costs 22 tokens per session (725 once invoked), scanned A, original, MIT.

A command that checks a project's .specs/ files for the required structure, metadata fields, and links between files.

In plain words
What is it for?
Use it to validate project specifications, including requirements, architecture, tests, plans, development context, and security documents.
Why use it?
It finds missing files and documentation errors before they cause confusion, and suggests fixes without applying them automatically.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is girishr/SpecPilot's own configuration. It tells Claude Code how to work on SpecPilot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything SpecPilot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to girishr/SpecPilot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/girishr/SpecPilot/main/.claude/commands/specpilot-validate.md
Clone the repo
git clone --depth 1 https://github.com/girishr/SpecPilot

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 specpilot-validate

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/girishr/specpilot/specpilot-validate"><img src="https://agentmods.dev/badge/commands/girishr/specpilot/specpilot-validate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 725 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.00022 $0.00725
Opus 5.5 $0.00009 $0.00290
Sonnet 5.5 $0.00004 $0.00145
Haiku 4.5 $0.00002 $0.00072

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

Security

Grade A, and why

specpilot-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 15d 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.

.claude/commands/specpilot-validate.md · 70 lines

What it actually says

Validate the project's .specs/ files. Run the script below, then summarize the results in plain language.

cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"

REQUIRED_FILES=(
  ".specs/project/project.yaml"
  ".specs/architecture/architecture.md"
  ".specs/project/requirements.md"
  ".specs/quality/tests.md"
  ".specs/planning/tasks.md"
  ".specs/development/context.md"
  ".specs/development/prompts.md"
  ".specs/security/threat-model.md"
  ".specs/security/security-decisions.md"
)

echo "== Missing required files =="
missing=0
for f in "${REQUIRED_FILES[@]}"; do
  if [ ! -f "$f" ]; then echo "MISSING: $f"; missing=1; fi
done
[ "$missing" -eq 0 ] && echo "none"

echo
echo "== Front-matter field checks (fileID, lastUpdated, version, contributors, relatedFiles) =="
clean=1
for f in "${REQUIRED_FILES[@]}"; do
  [[ "$f" == *.md ]] || continue
  [ -f "$f" ] || continue
  fm=$(sed -n '2,/^---$/p' "$f")
  for field in fileID lastUpdated version contributors relatedFiles; do
    if ! echo "$fm" | grep -q "^${field}:"; then
      echo "MISSING $field in $f"
      clean=0
    fi
  done
done
[ "$clean" -eq 1 ] && echo "all fields present"

echo
echo "== relatedFiles cross-reference check =="
clean=1
for f in "${REQUIRED_FILES[@]}"; do
  [[ "$f" == *.md ]] || continue
  [ -f "$f" ] || continue
  refs=$(sed -n '2,/^---$/p' "$f" | sed -n '/^relatedFiles:/,/^[a-zA-Z]/p' | grep -oE '[A-Za-z0-9_.-]+\.(md|yaml)')
  for ref in $refs; do
    if ! find .specs -name "$ref" | grep -q .; then
      echo "BROKEN REF in $f -> $ref (not found anywhere under .specs/)"
      clean=0
    fi
  done
done
[ "$clean" -eq 1 ] && echo "all cross-references resolve"

Never eyeball line counts or fingerprints by hand where this script already computes them exactly.

After running it:

  1. Summarize each of the three sections in plain language (what's missing, what's wrong, what's broken).
  2. For every issue found, suggest a specific fix — but never apply it automatically. Wait for the user to ask before editing any file.
  3. If everything passes, say so plainly; do not manufacture issues.

Known platform limitation: GitHub Copilot only executes terminal commands in "agent mode." Outside agent mode, this command degrades to prose-only — read the files yourself and reason about the same three checks without the script, which carries a higher error rate than the scripted version.

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. 15d ago Changed · -1 lines bc05b32520d3
  2. 2mo ago First seen · 71 lines · 22 tokens per session scan A c4bc7798f2ee

Subscribe to this mod's changes

specpilot-validate is a command published in the GitHub repository girishr/SpecPilot (39 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 725 once invoked, about $0.0001 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-08-30.