pre-pr

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

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 commands/sanmak/specops/pre-pr
Clone the repo
git clone --depth 1 https://github.com/sanmak/specops

Made for: Claude Code.

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. 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.00000 $0.01213
Opus 5 $0.00000 $0.00607
Sonnet 5 $0.00000 $0.00243
Haiku 4.5 $0.00000 $0.00121

Measured 2d ago against content hash 77ef3c8c5253, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 1mo 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.