mcp-guardian: Skill for Claude Code

.claude/skills/pr-review/SKILL.md

pr-review is a skill for Claude Code from Ailian0206/mcp-guardian. It costs 46 tokens per session (901 once invoked), scanned A, original, MIT.

A read-only process for independently reviewing one open GitHub pull request, which is a proposed code change awaiting review.

In plain words
What is it for?
Use it to inspect a specified pull request, report concrete code problems, and mark the review status when the one-time review is complete.
Why use it?
It avoids repeated or duplicate reviews and keeps the reviewer from changing code or the pull request itself.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

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

Reuse

Borrowing it

Nothing to install: this file belongs to Ailian0206/mcp-guardian. 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/Ailian0206/mcp-guardian/main/.claude/skills/pr-review/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Ailian0206/mcp-guardian

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ailian0206/mcp-guardian/pr-review"><img src="https://agentmods.dev/badge/skills/ailian0206/mcp-guardian/pr-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 901 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.00046 $0.00901
Opus 5 $0.00023 $0.00451
Sonnet 5 $0.00009 $0.00180
Haiku 4.5 $0.00005 $0.00090

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

Security

Grade A, and why

pr-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 11d 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/skills/pr-review/SKILL.md · 82 lines

What it actually says

PR 独立只读审核(MCP Guardian)

替代 Cursor Bugbot。只发现和报告问题;修复由开发 agent 完成。

成本红线(最高优先级)

  1. 每个 PR 只审一次。评论里已有任意 CLAUDE_REVIEWED_SHA,或已有 claude-reviewed / claude-changes-requested立即退出,不发新评论、不改标签、不读 diff。
  2. 禁止因 head 前进、修复 push、pr-gate 重跑而复审。
  3. 禁止并行启动第二个 /pr-review(同一 PR)。
  4. 禁止扫描「所有缺 marker 的 PR」并批量审核;一次调用只处理用户指定的那一个开放 PR(普通模式若有多个开放 PR,只审编号最小的一个,且若它已审过则退出)。
  5. 优先 gh pr diff;高风险文件按需用 Contents API,禁止无目的整仓拉取。

调用模式

/pr-review
/pr-review --trusted-base <PR编号>
  • 普通:当前工作区;未改审核协议 skill/规则时用这个。
  • 可信基线:仅当 diff 命中 .claude/skills/pr-review/**.cursor/rules/pr-review-gate.mdc 时使用。

代码只读硬边界

允许:gh pr list/view/diffgh api、Read、Grep、只读验证。

禁止:改 tracked 文件、commit/push、开/关/合 PR、checkout 目标 head、在 trusted-base 执行目标分支代码、直接修 finding。

审核状态协议

Summary 结尾:

<!-- CLAUDE_REVIEWED_SHA: <head-sha> -->
  • claude-reviewed:本次(也是本 PR 唯一一次)审核完成。
  • claude-changes-requested:存在未解决 CRITICAL/HIGH。

幂等:本 PR 任意历史 marker / 上述标签已存在 → 跳过(不要求 marker 等于当前 head)。

只有本审核器可维护这两个标签。

审核协议路径(才强制 trusted-base)

  • .claude/skills/pr-review/**
  • .cursor/rules/pr-review-gate.mdc

普通模式若命中上述路径:零 GitHub 写入退出,提示开发 agent 用 trusted-base。
注意:改 AGENT.md / playbook 文案 再强制 trusted-base(避免无意义烧额度)。

普通模式

  1. gh pr list --state open ...;取编号最小的一个开放 PR。
  2. 若已审过(marker 或标签)→ 退出。
  3. 命中协议路径 → 退出并要求 trusted-base。
  4. 否则进入共同审核过程(一次)。

可信基线模式

只审参数指定的一个 PR。校验 OPEN、baseRefOid、detached HEAD=baseRefOid
已审过 → 立即退出。
读目标:只用 gh pr diff + 必要的 Contents API。

共同审核过程

  1. 读完整 gh pr diff
  2. 策略/Gateway/审批等高风险点按需读全文。
  3. 等级:CRITICAL/HIGH 阻塞;MEDIUM/LOW 记录。
  4. 必查:密钥、路径穿越、fail-open、审批绕过、审计、ownership、吞错、无界查询、缺测。
  5. inline + 一条 summary + marker;设标签;立即退出,不轮询、不复审。

项目约束

  • Draft 也审(仍只一次)。
  • 忽略无关 .worktrees/
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. 11d ago First seen · 82 lines · 46 tokens per session scan A abf3c6617c82

Subscribe to this mod's changes

pr-review is a skill published in the GitHub repository Ailian0206/mcp-guardian (1 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 901 once invoked, about $0.0002 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.