Pr Review 标志

Pr Review

组织
agentic-community
pr-review

使用多个专家角色评审 GitHub pull request。输入 PR URL 后,分析变更并从不同角度生成全面的评审反馈,包括合并专家、前端、后端、安全、DevOps、AI/Agent、SRE 和首席架构师。

Add to TypingMind

概览

发布者agentic-community
代码仓库mcp-gateway-registry
技能名称pr-review
星标数
969
复刻数
244
附带文件
9
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 9 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 agentic-community 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Pr Review AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/agentic-community/mcp-gateway-registry/tree/main/.claude/skills/pr-review
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/agentic-community/mcp-gateway-registry.git /tmp/mcp-gateway-registry
mkdir -p .claude/skills
cp -r /tmp/mcp-gateway-registry/.claude/skills/pr-review .claude/skills/pr-review
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Pr Review,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Pr Review。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Pr Review 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

PR Review Skill

Use this skill to review GitHub pull requests comprehensively using multiple expert personas. Each persona brings specialized knowledge to identify issues from different perspectives.

Input

The skill takes a GitHub PR URL as input:

  • Format: https://github.com/{owner}/{repo}/pull/{number}
  • Example: https://github.com/agentic-community/mcp-gateway-registry/pull/123

Output

Creates review documentation in .scratchpad/pr-{pr-number}/ containing:

  • review.md - Comprehensive review from all personas

Workflow

Step 1: Parse PR URL and Fetch PR Details

  1. Extract the PR number from the URL
  2. Use gh pr view {number} to get PR details
  3. Use gh pr diff {number} to get the changes
  4. Identify which files are changed and their types (frontend, backend, etc.)

Step 2: Determine Relevant Personas

Based on the files changed, determine which personas should review:

Changed FilesPersonas to Engage
/frontend/**Merge Specialist, Frontend Developer, Chief Architect
/registry/**Merge Specialist, Backend Developer, Security Engineer, SRE, Chief Architect
/registry/core/config.py, /registry/api/config_routes.pyMerge Specialist, Backend Developer, DevOps Engineer, Security Engineer, Chief Architect
/auth_server/**Merge Specialist, Backend Developer, Security Engineer, Chief Architect
/terraform/**, /charts/**, /docker/**Merge Specialist, DevOps Engineer, SRE, Chief Architect
/agents/**, /servers/**Merge Specialist, AI/Agent Developer, Backend Developer, Chief Architect
/metrics-service/**Merge Specialist, SRE Engineer, Backend Developer, Chief Architect
*.md, docs/**Merge Specialist, Chief Architect
pyproject.toml, requirements*.txtMerge Specialist, DevOps Engineer, Security Engineer, Chief Architect
tests/**Merge Specialist, Backend Developer, Chief Architect
.env.exampleMerge Specialist, DevOps Engineer, Chief Architect

Note: Merge Specialist and Chief Architect always participate in every review.

Step 2.5: Detect New or Modified Configuration Parameters (CRITICAL)

Before running any reviews, determine whether this PR introduces or modifies any configuration parameters across the three deployment surfaces. If it does, the unified parameter reference must be updated in the same PR. A missing update is a blocker.

Detection command:

bash
# Any diff that touches one of the canonical parameter-carrying files triggers this check
gh pr diff {pr-number} --name-only | grep -E \
  -e '^\.env\.example$' \
  -e '^docker-compose(\.|$)' \
  -e '^terraform/aws-ecs/terraform\.tfvars\.example$' \
  -e '^terraform/aws-ecs/variables\.tf$' \
  -e '^terraform/aws-ecs/modules/.+/(variables|ecs-services)\.tf$' \
  -e '^charts/.+/values\.yaml$' \
  -e '^charts/.+/templates/(deployment|secret)\.yaml$' \
  -e '^registry/core/config\.py$' \
  -e '^registry/api/config_routes\.py$'

If any files match, every new or renamed parameter must be reflected in docs/unified-parameter-reference.md. Verify with:

bash
# For each new parameter name, confirm the reference file mentions it
for PARAM in $(gh pr diff {pr-number} | grep -E '^\+[A-Z_]{3,}=' | sed 's/^+//;s/=.*//' | sort -u); do
  if ! grep -q "$PARAM" docs/unified-parameter-reference.md; then
    echo "MISSING from unified-parameter-reference.md: $PARAM"
  fi
done

Merge-blocking checks (add to the Merge Specialist review section):

  • docs/unified-parameter-reference.md is included in the diff whenever any parameter-carrying file is touched.
  • Every new .env variable has a row, with Docker / Terraform / Helm columns filled (or explicitly blank with a justification in the PR description).
  • Every new Terraform variable appears in the reference.
  • Every new Helm value appears in the reference.
  • Secrets are flagged with (secret).
  • New rows live in an existing logical group, or the PR adds a new group with a clear rationale.
  • Renamed parameters have the old row updated in place (not a duplicate).
  • Deleted parameters have their row removed (not left stale).
  • registry/api/config_routes.py CONFIG_GROUPS is updated so the parameter surfaces in GET /api/config/full and the System Config UI.

If any of the above is missing, the review verdict is REQUEST CHANGES with a blocker titled "Unified parameter reference not updated".

Step 2.6: Detect New or Changed API Endpoints (CRITICAL)

api/openapi.json is the published API contract, and it is hand-refreshed: no script generates it and no CI job checks it. A PR that adds a route therefore passes every gate while leaving the new endpoint invisible to API consumers. This has already happened, more than once in a row, so the spec shipped missing endpoints from several merged PRs at the same time.

Detection: does the diff add or change a route decorator?

bash
# Matches ANY router object, not just `router`/`app`: real routes are declared on
# names like `cimd_router`, `wellknown_router`, and a narrower pattern misses them
# (verified: it missed #1711's `@cimd_router.get(...)` entirely).
gh pr diff {pr-number} | grep -E '^\+\s*@[A-Za-z_][A-Za-z0-9_]*\.(get|post|put|patch|delete)\('

If that matches, check whether the spec was refreshed:

bash
gh pr diff {pr-number} --name-only | grep -q '^api/openapi\.json$' \
  && echo "spec refreshed" || echo "SPEC NOT REFRESHED"

And confirm the new path actually landed in it, rather than the file being touched for an unrelated reason:

bash
git show {pr-branch}:api/openapi.json | python3 -c "
import json, sys
print(sorted(json.load(sys.stdin)['paths']))
" | tr ',' '\n' | grep -i '<the new path>'

Merge-blocking checks:

  • Every route the diff adds appears in api/openapi.json.
  • Every route the diff removes is gone from it.
  • info.version is a clean release semver, not the app's git-describe development string (1.30.0-46-g...).
  • The diff to api/openapi.json is confined to the affected paths. A wholesale reformat usually means it was regenerated with ensure_ascii=False, which rewrites every non-ASCII character and hides the real change.
  • Nothing was removed unexpectedly. Unexplained removals usually mean the container was built with a feature flag off or the wrong DEPLOYMENT_MODE, so a whole router never registered.

A route added behind a default-off feature flag still belongs in the spec: FastAPI registers the route regardless, and the flag only changes the response at request time.

If a route was added and the spec was not refreshed, the verdict is REQUEST CHANGES with a blocker titled "OpenAPI spec not refreshed for new endpoint". The procedure is in AGENTS.md; refreshing it can also be offered as a follow-up PR when the author would rather not rebuild locally.

Step 3: Run Tests and Quality Checks

Before reviewing, run the test suite to verify the PR doesn't break anything:

bash
# Checkout the PR
gh pr checkout {pr-number}

# Run tests
uv run pytest tests/ -n 8 --tb=short

# Run linting
uv run ruff check . && uv run ruff format --check .

# Run security scan (if applicable)
uv run bandit -r registry/ auth_server/ -q

# Return to main branch when done
git checkout main

Step 4: Create Review Folder

Create the folder structure:

.scratchpad/pr-{pr-number}/
└── review.md

Step 5: Conduct Multi-Persona Review

For each relevant persona, adopt that perspective and review the changes. Reference the persona definition files:

Theory check (always): the Chief Architect persona must read Theory of the System and walk the diff against its "how to change this system without breaking its theory" checklist. If the PR violates a core invariant (control-plane/data-plane split, generic gateway, A2A peer-to-peer, mode axes, config parity, fail-closed admission, IdP-agnosticism, MCP spec compliance) without explicitly arguing for the change, flag it to the user as a blocker.

Step 6: Write Comprehensive Review (review.md)

Generate the review document using this structure:

markdown
# PR Review: #{pr-number} - {pr-title}

*Review Date: {date}*
*PR URL: {pr-url}*
*Author: {author}*

## PR Summary

{Brief description of what the PR does based on PR description and changes}

### Files Changed

| File | Type | Lines Added | Lines Removed |
|------|------|-------------|---------------|
| {file} | {type} | +{n} | -{n} |

### Test Results

| Check | Status | Details |
|-------|--------|---------|
| Unit Tests | {PASS/FAIL} | {summary} |
| Integration Tests | {PASS/FAIL} | {summary} |
| Linting | {PASS/FAIL} | {summary} |
| Security Scan | {PASS/FAIL} | {summary} |

### API Spec Check

*Only required when the diff adds or changes a route decorator (see Step 2.6). Mark "Not Applicable" otherwise.*

| Check | Status | Details |
|-------|--------|---------|
| Every added route appears in `api/openapi.json` | {PASS/FAIL/N/A} | {the paths} |
| Every removed route is gone from it | {PASS/FAIL/N/A} | n/a |
| `info.version` is a release semver, not a dev string | {PASS/FAIL/N/A} | n/a |
| Spec diff confined to the affected paths | {PASS/FAIL/N/A} | n/a |

### Configuration Parameter Surface Check

*Only required when the PR touches any parameter-carrying file (see Step 2.5). Mark "Not Applicable" if the detection command returned no matches.*

| Check | Status | Details |
|-------|--------|---------|
| Unified parameter reference updated (`docs/unified-parameter-reference.md`) | {PASS/FAIL/N/A} | {list of new/renamed/removed parameter names and which rows were added} |
| Docker column populated (`.env.example`, `docker-compose*.yml`) | {PASS/FAIL/N/A} |, |
| Terraform column populated (`variables.tf`, `terraform.tfvars.example`, module wiring) | {PASS/FAIL/N/A} |, |
| Helm column populated (`charts/.../values.yaml`, stack values, templates) | {PASS/FAIL/N/A} |, |
| `registry/api/config_routes.py` `CONFIG_GROUPS` updated | {PASS/FAIL/N/A} |, |
| Secrets flagged with **(secret)** and wired through Secrets Manager / `secretKeyRef` | {PASS/FAIL/N/A} |, |

---

## Review Panel

| Role | Reviewer | Verdict |
|------|----------|---------|
| Merge Specialist | Gatekeeper | {verdict} |
| {Role} | {Name} | {verdict} |
| Chief Architect | Atlas | {verdict} |

---

{Include each relevant persona's review section using the format from their persona file}

---

## Review Summary

| Reviewer | Verdict | Blockers | Key Concerns |
|----------|---------|----------|--------------|
| {Reviewer} | {verdict} | {count} | {summary} |

### Blockers (Must Fix)

1. {Blocker description}
   - Raised by: {persona}
   - File: `{file:line}`
   - Fix: {suggested fix}

### Should Fix (Important)

1. {Issue description}
   - Raised by: {persona}
   - File: `{file:line}`
   - Recommendation: {suggestion}

### Consider (Nice to Have)

1. {Suggestion}
   - Raised by: {persona}

---

## Final Recommendation

**Overall Verdict: {APPROVE / APPROVE WITH CHANGES / REQUEST CHANGES}**

### Required Actions Before Merge

- [ ] {Action 1}
- [ ] {Action 2}
- [ ] (If config params changed) `docs/unified-parameter-reference.md` updated and all three surface columns consistent with the diff

### Post-Merge Actions

- [ ] {Action 1}

Step 7: Render the review as HTML

A review document is long and heavily tabular, which reads badly as raw markdown in a terminal. Render it so the reader can open a formatted page instead:

bash
uv run python scripts/render-doc-html.py .scratchpad/pr-NNNN/review.md

That writes review.html beside the markdown, self-contained (all CSS inline, no CDN, no JavaScript, renders from file://), using the same stylesheet as the explainer skill so every generated document looks the same. Title and byline come from the document's H1 and the italic lines under it, and a section nav is built from the H2 headings.

Useful flags:

  • --footer-html '...' for provenance, such as the commit the review was performed against.
  • --diagrams DIR to inline SVG from DIR/<key>.svg wherever the markdown fences a block as ```svg:<key> Optional caption. Keep the ASCII inside the fence: it is what a terminal reader sees, and a missing .svg file falls back to it rather than losing the diagram. A review rarely needs this; a design document often does.
  • --code-style invert for the template's dark code blocks. The default (match) makes code blocks follow the page surface, which suits a document that is mostly code.

Then check the output, because an unparsed HTML file is worse than none:

bash
uv run python scripts/prose-scan.py --strict .scratchpad/pr-NNNN/review.md .scratchpad/pr-NNNN/review.html

The renderer already warns about unfilled placeholders, broken in-page anchors, and svg: fences with no matching file. Fix anything it reports and re-run.

Re-render after every edit to the markdown. The markdown is the source; the HTML is a build artifact, and the two drift the moment you hand-edit the HTML.

Open it for the reader rather than starting a server:

bash
code -r .scratchpad/pr-NNNN/review.html

Do not start a server. The HTML is self-contained, so the editor's preview or a downloaded copy is enough, and a process the user did not ask for is one they have to hunt down later. If they want HTTP, offer this and let them run it in a VS Code integrated terminal, which is what makes VS Code forward the port:

bash
python3 -m http.server 8112 --bind 127.0.0.1 --directory /abs/path/to/.scratchpad/pr-NNNN

Then the URL is http://127.0.0.1:8112/review.html, or drop the filename for a directory listing. Point --directory at the single document's folder, never at .scratchpad/ itself: that folder holds credential files and http.server serves everything below its root.

Trust model for the generated HTML

The renderer treats the markdown body, the byline derived from it, and any inlined SVG as untrusted, because this skill summarizes GitHub-fetched content into that markdown. Raw HTML in the markdown is disabled, the byline is escaped with an href scheme allowlist, and an SVG carrying a script, an event handler, or an external reference aborts the render. A <script> in a PR body therefore renders as visible, inert text.

--byline-html and --footer-html are the two exceptions: both are inserted verbatim. Use them only for first-party provenance text you wrote. Never pass a PR title, an issue body, an author name, or any other fetched metadata through either one.

Step 8: Present Review Summary

After creating the review document, present a summary to the user:

  1. Display the overall verdict
  2. List any blockers that must be addressed
  3. Provide the path to the full review document
  4. Offer to explain any specific findings in detail
  5. End the response with a clickable link to the PR (see below)
Always end with a clickable PR link

The last line of every review response must be a full markdown link to the PR, so the reader can open it without copying a number into a URL bar:

markdown
[#1711, feat: CIMD client metadata document](https://github.com/agentic-community/mcp-gateway-registry/pull/1711)

Rules:

  • Use the full https://github.com/{owner}/{repo}/pull/{number} URL. A bare #1711 renders as plain text in the terminal and is not clickable.
  • Include the PR title after the number, so the link says what it points at.
  • This applies to every response about the PR, not just the first one: follow-up answers, "pushed the fixes", and status updates all end with the link.
  • If the response covers more than one PR, link each of them.

Review Principles

From CLAUDE.md

  • Simplicity: Code should be maintainable by entry-level developers
  • No Over-engineering: Only make changes that are directly requested
  • Security First: Check for OWASP vulnerabilities, proper input validation
  • Test Coverage: Verify tests exist for new functionality
  • Documentation: Ensure docstrings and comments are appropriate

Severity Levels

  • Blocker: Must be fixed before merge (security vulnerabilities, failing tests, breaking changes)
  • Major: Should be fixed before merge (code quality issues, missing tests)
  • Minor: Nice to fix (style issues, documentation improvements)

Verdict Criteria

APPROVE:

  • All tests pass
  • No security vulnerabilities
  • Code quality meets standards
  • No breaking changes (or justified)

APPROVE WITH CHANGES:

  • Minor issues that should be addressed
  • No blockers
  • Author can address and merge

REQUEST CHANGES:

  • Failing tests
  • Security vulnerabilities
  • Breaking changes without justification
  • Significant code quality issues

Example Usage

User: "/pr-review https://github.com/agentic-community/mcp-gateway-registry/pull/456"

  1. Parse URL: PR #456
  2. Fetch PR details and diff
  3. Identify changed files: registry/routes/auth.py, tests/unit/test_auth.py
  4. Determine personas: Merge Specialist, Backend Developer, Security Engineer, Chief Architect
  5. Run tests: All pass
  6. Create .scratchpad/pr-456/review.md
  7. Conduct reviews from each persona
  8. Render review.html with scripts/render-doc-html.py
  9. Present summary with verdict

Notes

  • Always run tests before reviewing to ensure baseline quality
  • Focus review effort on areas most relevant to the changed files
  • Be constructive and specific - provide file/line references
  • Acknowledge good practices, not just problems
  • Consider the author's experience level when phrasing feedback
  • The markdown is the source of truth and the HTML is a build artifact. Re-render after any edit rather than hand-editing review.html

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Pr Review AI 技能有什么作用?

使用多个专家角色评审 GitHub pull request。输入 PR URL 后,分析变更并从不同角度生成全面的评审反馈,包括合并专家、前端、后端、安全、DevOps、AI/Agent、SRE 和首席架构师。

为什么在 TypingMind 中使用 Pr Review?

因为您只需安装一次,就能搭配任何模型使用。Pr Review 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Pr Review?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/agentic-community/mcp-gateway-registry/tree/main/.claude/skills/pr-review。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Pr Review?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Pr Review 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Pr Review 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Pr Review AI 技能免费吗?

是的。agentic-community 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇