pr-review-gate

pr-review-gate is a cursor rule for Cursor from Ailian0206/mcp-guardian. It costs 400 tokens per session, scanned A, original, MIT.

A set of rules for controlling when pull requests are opened, reviewed, and merged. A pull request is a proposed code change submitted for review before it is merged into a project.

In plain words
What is it for?
Managing milestone pull requests in the mcp-guardian repository, including review checks, review limits, fixes after comments, and merge requirements.
Why use it?
It prevents unnecessary reviews, duplicate automated reviews, multiple open pull requests, and wasted review costs.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/pr-gate.sh <PR> # 未审过:唯一一次 Claude + 合.

Good fit Managing milestone pull requests in the mcp-guardian repository, including review checks, review limits, fixes after comments, and merge requirements.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Ailian0206/mcp-guardian
agentmods
npx agentmods add rules/ailian0206/mcp-guardian/pr-review-gate

Made for: Cursor.

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 pr-review-gate

README.md
[![agentmods](https://agentmods.dev/badge/rules/ailian0206/mcp-guardian/pr-review-gate/github.svg)](https://agentmods.dev/rules/ailian0206/mcp-guardian/pr-review-gate)
Your own site
<a href="https://agentmods.dev/rules/ailian0206/mcp-guardian/pr-review-gate"><img src="https://agentmods.dev/badge/rules/ailian0206/mcp-guardian/pr-review-gate/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 pr-review-gate

Your own site · 80×15
<a href="https://agentmods.dev/rules/ailian0206/mcp-guardian/pr-review-gate"><img src="https://agentmods.dev/badge/rules/ailian0206/mcp-guardian/pr-review-gate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 400 This file is loaded in full into every session.
When invoked 400 The same file — it is already loaded in full.
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.00400 $0.00400
Opus 5 $0.00200 $0.00200
Sonnet 5 $0.00080 $0.00080
Haiku 4.5 $0.00040 $0.00040

Measured 9d ago against content hash 9256293b7669, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

pr-review-gate 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 9d 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.

.cursor/rules/pr-review-gate.mdc · 33 lines

What it actually says

PR 审核与合并门禁(成本优先)

开 PR 红线

  • 同时最多 1 个开放 PR
  • 只有里程碑才开 PR;禁止没事提 PR、按天/小修/纯文档开 PR。
  • 开 PR 前必须:bash scripts/assert-can-open-pr.sh(里程碑确认后用 ALLOW_OPEN_PR=1)。
  • 日常在功能分支 commit/push,默认不开 PR
  • 只负责本仓库 mcp-guardian;禁止去其他仓库开 PR / 跑审核。

Claude:每个 PR 生涯只审一次

  1. 首次就绪后只触发一次:bash scripts/pr-gate.sh <PR>(内部调用 /pr-review)。
  2. 已有 CLAUDE_REVIEWED_SHA / claude-reviewed / claude-changes-requested禁止再启动 Claude
  3. 有问题:按评论修 → SKIP_PR_REVIEW=1 bash scripts/pr-gate.sh <PR> → merge。
  4. 没问题:同一次 gate 门禁绿后 merge。
  5. 禁止并发跑多个 pr-gate / /pr-review(脚本有 flock)。
  6. 不得手改审核标签、冒充审核评论;不用 Bugbot

合并

bash scripts/pr-gate.sh <PR>                      # 未审过:唯一一次 Claude + 合
SKIP_PR_REVIEW=1 bash scripts/pr-gate.sh <PR>     # 已按评论修好:绝不复审

merge commit only。

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. 9d ago First seen · 33 lines · 400 tokens per session scan A 9256293b7669

Subscribe to this mod's changes

pr-review-gate is a cursor rule published in the GitHub repository Ailian0206/mcp-guardian (1 stars, last pushed 1mo ago), licensed MIT. It adds 400 tokens to every session, about $0.0020 per session on Opus 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-31.