specops: Command for Claude Code

.claude/commands/pre-pr.md

pre-pr is a command for Claude Code from sanmak/specops. It costs 0 tokens per session (1,213 once invoked), scanned A, original, MIT.

A pre-pull-request check that combines code review and automated validation before you ask others to review your changes.

In plain words
What is it for?
Use it before opening a pull request to inspect current changes, validate generated files and configuration, and address serious findings.
Why use it?
It finds common defects and project-specific problems early, reducing avoidable review comments.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions .claude-plugin.

This is sanmak/specops's own configuration. It tells Claude Code how to work on specops 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 specops configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 generator/validate.py.

Part of the specops plugin — 2 skills, 14 commands shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to sanmak/specops. 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/sanmak/specops/main/.claude/commands/pre-pr.md
Clone the repo
git clone --depth 1 https://github.com/sanmak/specops

Made for: Claude Code.

Or install specops, the plugin that ships this one along with the rest of its 2 skills, 14 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 pre-pr

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/sanmak/specops/pre-pr"><img src="https://agentmods.dev/badge/commands/sanmak/specops/pre-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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,213 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.00000 $0.01213
Opus 5.5 $0.00000 $0.00485
Sonnet 5.5 $0.00000 $0.00243
Haiku 4.5 $0.00000 $0.00121

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

Security

Grade A, and why

pre-pr 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.

.claude/commands/pre-pr.md · 138 lines

How it starts

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

Run a comprehensive pre-PR quality gate that chains existing quality tools into a single check. This catches issues that code review bots (CodeRabbit, Copilot, Greptile) would flag, reducing PR review noise by ~62%.

Instructions

Follow these steps precisely. Do not skip any step.


Step 1: Run /core-review on current changes

Run the /core-review command with the current argument to check all uncommitted changes against SpecOps-specific patterns.

This catches ~40% of issues that bots would flag:

  • P0: Raw abstract operations in generated outputs, detached HEAD patterns
  • P1: Generated file edits, cross-platform marker gaps, variable inconsistency, missing checksums
  • P2: Security-sensitive file advisories, spec alignment, step reference errors
  • P3: EARS notation, empty sections, malformed checkboxes

If P0 or P1 findings exist, offer to auto-fix them before continuing.

Save the /core-review result summary (pass/fail, finding counts by severity) as CORE_REVIEW_RESULT.


Step 2: Run automated validation battery

Run these checks sequentially. Record each result.

2a. Platform validation:

python3 generator/validate.py

Save exit code as VALIDATE_RESULT (0 = PASS, non-zero = FAIL).

2b. Spec artifact lint:

bash scripts/lint-specs.sh

Save exit code as LINT_RESULT (0 = PASS, non-zero = FAIL).

2c. Checksum verification:

shasum -a 256 -c CHECKSUMS.sha256

Save exit code as CHECKSUMS_RESULT (0 = PASS, non-zero = FAIL).

2d. Full test suite:

bash scripts/run-tests.sh

Save exit code as TESTS_RESULT (0 = PASS, non-zero = FAIL).

2e. IssueID verification (when taskTracking configured):

Read .specops.json and check team.taskTracking. If taskTracking is not "none":

  1. Resolve specsDir from .specops.json (specsDir, default .specops), then read <specsDir>/index.json (or scan <specsDir>/*/spec.json) to find specs with status implementing or completed
  2. For each such spec, read its tasks.md and find all tasks with **Priority:** High or **Priority:** Medium
  3. Check that each eligible task has **IssueID:** set to a valid identifier (not None, not empty)
  4. If any eligible tasks have missing IssueIDs, set ISSUEID_RESULT to FAIL and list the affected spec + task names

Read the full file on GitHub · 138 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 First seen · 138 lines · 0 tokens per session scan A 77ef3c8c5253

Subscribe to this mod's changes

pre-pr is a command published in the GitHub repository sanmak/specops (49 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,213 tokens. 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.