Token导航 LogoToken导航

Agent Skill · 研究检索

pr-code-review(公关代码审查)

pr-code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

pr-code-review 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为可写文件;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,674 个 Skill 里排第 70,834。

总安装 198周安装 8GitHub Stars 2下载 62核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pr-code-review(公关代码审查)
来源仓库:https://github.com/arctuition/skills
仓库路径:skills/pr-code-review
安装命令:
npx skills add https://github.com/arctuition/skills --skill pr-code-review
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/arctuition/skills --skill pr-code-review

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

pr-code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。基于 gh CLI 审查 GitHub PR,支持行内评论、建议块提交及批量评审 verdict。

工作流程包括预检、diff 分析、上下文阅读、结构化检查清单和统一 batched review 输出。安装命令为 npx skills add https://github.com/arctuition/skills --skill pr-code-review。

涉及系统命令执行,安装前需确认权限范围及是否允许网络访问 GitHub。

来源仓库内路径:skills/pr-code-review

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/arctuition/skills --skill pr-code-review;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要可写文件,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pr-code-review 怎么安装?

在终端执行 npx skills add https://github.com/arctuition/skills --skill pr-code-review。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pr-code-review 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pr-code-review 需要什么权限?

权限级别是可写文件。该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

pr-code-review 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pr-code-review 用的人多吗?

公开数据是累计安装 198 次,近一周安装 8 次,下载 62 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pr-code-review 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
pr-code-review

公关代码审查 · 本页

1982可写文件未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

PR Code Review

Review GitHub PRs using the gh CLI. Post inline comments tied to specific code lines, use GitHub suggestion blocks for trivial fixes, and submit everything as a single batched review with a verdict.

Workflow overview

  1. Understand the PR and run pre-checks.
  2. Get the diff and identify high-risk areas.
  3. Read changed files in full context.
  4. Analyze using a structured checklist.
  5. Draft findings with proper tone.
  6. Submit a single batched review with inline comments and verdict.
  7. Output a severity summary.

Step-by-step

1) Understand the PR and run pre-checks

First, auto-detect the repo context so you don't need hardcoded owner/repo values:

OWNER_REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)

Read the PR description and metadata to understand intent before looking at code:

gh pr view <pr> --json number,title,body,headRefOid,baseRefName,headRefName,author,labels,changedFiles,additions,deletions

gh pr view <pr> --json files --jq '.files[] | {path,additions,deletions}'

# Capture the head commit SHA — used throughout the review
COMMIT_SHA=$(gh pr view <pr> --json headRefOid --jq .headRefOid)

Capture:

  • What the PR claims to do (from title and body).
  • Why it exists (linked issue, motivation in the description).
  • Scope — how many files changed, total lines added/removed.

Use this context to calibrate your review: a one-line typo fix needs different scrutiny than a new auth middleware.

Pre-checks — before reading code:

Check CI status. Don't spend time reviewing code that doesn't build:

gh pr checks <pr>

If CI is failing, mention it in the review and focus on the failure cause rather than a full review.

Check for existing reviews to avoid duplicating feedback:

gh api repos/$OWNER_REPO/pulls/<pr>/reviews \
  --jq '.[] | {user: .user.login, state: .state, submitted_at: .submitted_at}'

If other reviewers have already left comments, read them and avoid repeating the same points.

2) Get the diff and prioritize

gh pr diff <pr> --name-only

gh pr diff <pr> --patch --color=never

# For large PRs, save to file to avoid flooding context
gh pr diff <pr> --patch --color=never > /tmp/pr.diff

Prioritize high-risk files first:

  • Business logic, auth, payments, data mutations
  • Files with high churn (many additions/deletions)
  • New files (need full design review)
  • Config changes (infra, CI, permissions)

Deprioritize or skip:

  • Auto-generated files (lock files, snapshots, migrations with no custom SQL)
  • Pure formatting/rename changes
  • Vendor/dependency updates (unless pinning matters)

3) Read changed files in context

Don't review diffs in isolation. For non-trivial changes, read the full file (or at minimum the surrounding function/class) to understand:

  • What the code looked like before the change
  • How the change fits into the broader module
  • Whether the change introduces inconsistencies with nearby code

If already on the PR branch, use the Read tool directly. Otherwise, either check out the branch first:

gh pr checkout <pr>

Or fetch a specific file via the API without switching branches:

gh api repos/$OWNER_REPO/contents/<path>?ref=$COMMIT_SHA --jq '.content' | base64 -d

4) Analyze using the review checklist

Before flagging an issue, apply the "should I flag this?" test:

  1. It meaningfully impacts correctness, performance, security, or maintainability.
  2. It is discrete and actionable — not a vague concern or multiple issues bundled together.
  3. It was introduced in this PR — do not flag pre-existing issues (mention them in the review body if important).
  4. The fix does not demand a level of rigor absent from the rest of the codebase.
  5. The original author would likely fix it if they were aware of it.
  6. It does not rely on unstated assumptions about the codebase or author's intent.
  7. It is provably a problem — speculation that a change *may* break something else is not enough; you must identify the affected code.
  8. It is clearly not an intentional choice by the author.

If a potential finding fails any of these tests, do not post it. If there are no findings that a person would definitely want to see and fix, prefer outputting zero findings over forcing low-value comments.

For each changed file, systematically check:

Correctness

  • Does the logic match the stated intent from the PR description?
  • Are edge cases handled (nulls, empty collections, boundary values)?
  • Are error paths correct (not swallowed, not leaking internals)?

Security

  • Input validation on trust boundaries (user input, API params)
  • No secrets, credentials, or PII in code
  • Safe handling of auth tokens, sessions, permissions
  • No injection vulnerabilities (SQL, XSS, command, path traversal)

Reliability

  • Concurrency safety (race conditions, shared mutable state)
  • Resource cleanup (connections, file handles, subscriptions)
  • Retry/timeout behavior (infinite loops, missing backoff)
  • Failure modes (what happens when a dependency is down?)

Performance

  • N+1 queries, missing indexes for new query patterns
  • Unnecessary allocations in hot paths
  • Missing pagination for unbounded result sets

API design & contracts

  • Breaking changes to public APIs
  • Consistent naming and parameter ordering
  • Backward compatibility where expected

Tests

  • Are new code paths covered by tests?
  • Do tests assert meaningful behavior (not just "no crash")?
  • Are edge cases from the correctness check tested?

Clarity

  • Could a team member understand this in 6 months?
  • Are names descriptive? Is the abstraction level consistent?
  • Only flag naming/style if it causes genuine confusion — don't nitpick.

5) Draft findings

For each issue, record:

  • Priority: P0 / P1 / P2 / P3
  • File path and line number (see line number mapping below)
  • Title: imperative, ≤80 chars, prefixed with priority tag (e.g. [P1] Add max-attempts guard to retry loop)
  • Body: one paragraph explaining *why* this is a problem and the scenarios/inputs that trigger it
  • Suggestion: recommended fix (use a suggestion block for concrete replacements)

Priority definitions:

  • P0 — Drop everything. Blocking release or operations. Only use for universal issues that do not depend on assumptions about inputs.
  • P1 — Urgent. Correctness bugs, security vulnerabilities, data loss risk. Should be addressed in the next cycle.
  • P2 — Normal. Reliability concerns, performance issues, missing error handling, API design problems. To be fixed eventually.
  • P3 — Low. Clarity improvements, minor style issues, optional refactors. Nice to have.

Comment writing rules:

  1. The body must be at most one paragraph. No unnecessary line breaks.
  2. Clearly state the scenarios, environments, or inputs required for the issue to manifest. Communicate that severity depends on these factors.
  3. Do not include code chunks longer than 3 lines in the body. Use suggestion blocks for concrete fixes instead.
  4. Use suggestion blocks ONLY for concrete replacement code — no commentary inside the block.
  5. In suggestion blocks, preserve the exact leading whitespace of the replaced lines.
  6. Keep line ranges as short as possible (≤5–10 lines). Pick the subrange that pinpoints the problem.
  7. Tone should be matter-of-fact — not accusatory, not flattering. Avoid "Great job...", "Thanks for...".
  8. The author should be able to immediately grasp the issue without close reading.

Also note things done well — good patterns, thorough edge-case handling, clean abstractions. Keep it brief: one sentence, no flattery, just acknowledgment.

Follow the comment tone guidelines and noise control rules below.

6) Submit as a single batched review

Always use the Reviews API to submit all comments as one review. This creates a single notification and a proper review record with a verdict.

Build the JSON payload as a temp file to avoid shell escaping issues (backticks in suggestion blocks break heredocs).

Write the review payload to a temp file using the Write tool (use the $COMMIT_SHA captured in step 1):

{
  "commit_id": "<COMMIT_SHA value>",
  "event": "REQUEST_CHANGES",
  "body": "## Review summary\n\nPatch is incorrect. 1 P1, 1 P2 found.\n\n### Positive\n- Clean separation of retry logic into its own module.",
  "comments": [
    {
      "path": "src/service/retry.ts",
      "line": 42,
      "side": "RIGHT",
      "body": "**[P1]** Add max-attempts guard to retry loop\n\nIf the upstream service is down, this retries indefinitely, exhausting the connection pool and cascading to all other requests. This triggers whenever the service returns a transient error for longer than a few seconds.\n\n```suggestion\nfor (let attempt = 0; attempt < MAX_RETRIES; attempt++) {\n```"
    },
    {
      "path": "src/api/handler.ts",
      "line": 15,
      "side": "RIGHT",
      "body": "**[P2]** Validate `userId` parameter before use\n\nIf a caller passes a non-numeric string, `parseInt` returns `NaN` which propagates silently through the query, returning an empty result instead of a 400 error."
    }
  ]
}

Then submit:

gh api -X POST repos/$OWNER_REPO/pulls/<pr>/reviews --input /tmp/review-payload.json

Review verdicts:

  • APPROVE — no P0/P1 issues, the patch is correct
  • REQUEST_CHANGES — has P0 or P1 issues that must be fixed before merge
  • COMMENT — only P2/P3 issues, or you want discussion without blocking

Permission requirement — submitting a review requires write/collaborator access to the repo. If you get a 403/422 error, you lack the necessary permissions.

Fallback — if the Reviews API fails, degrade gracefully:

  1. Post each inline comment individually (preserves line-level feedback):
gh api -X POST repos/$OWNER_REPO/pulls/<pr>/comments \
  -f body='...' \
  -f commit_id="$COMMIT_SHA" \
  -f path='src/handler.ts' \
  -f line=15 \
  -f side='RIGHT'
  1. Last resort — if inline comments are also unavailable, post a general comment summarizing all findings:
gh pr review <pr> --comment -b "..."

See references/gh-cli.md for multi-line comments, suggestion syntax, and API details.

7) Output summary

End with a summary for the user (not posted to GitHub). Include an overall correctness verdict — a binary assessment of whether the patch is correct (existing code and tests will not break, no bugs or blocking issues; ignore style, formatting, and nits).

## Review posted

**Verdict**: REQUEST_CHANGES
**Overall correctness**: patch is incorrect — the unbounded retry loop will exhaust the connection pool under sustained upstream failures.
**Findings**: 1 P1, 2 P2, 1 P3

### P1
- retry.ts:42 — Unbounded retry loop exhausts connection pool

### P2
- handler.ts:15 — Missing userId validation returns empty result instead of 400
- auth.ts:88 — Token expiry not checked before downstream call

### P3
- utils.ts:7 — Ambiguous variable name `d` could be `durationMs`

### Positive
- Clean separation of retry logic into its own module

### Not reviewed
- package-lock.json (auto-generated)

Comment tone

Matter-of-fact, not adversarial. Read as a helpful assistant — not a human reviewer trying to prove a point. Avoid excessive flattery ("Great job...") and vague negativity ("This is wrong.").

Lead with the scenario. State the conditions under which the issue manifests so the author can immediately assess severity:

  • Good: "[P1] If the upstream service returns transient errors for >5s, this retries indefinitely, exhausting the connection pool and cascading to all other requests."
  • Bad: "[P1] Infinite retry."

Ask when the intent is ambiguous. If the code might be intentional, frame as a question:

  • "Is this intentionally unbounded? If a caller passes a large dataset, this could OOM."

Distinguish blocking from non-blocking. Use priority tags consistently. Prefix optional suggestions with nit: so the author knows they can skip them.

One comment per issue. Don't pile multiple unrelated concerns into a single comment. Each comment should be independently addressable.

When NOT to comment

Noisy reviews dilute the important feedback. Every finding must pass the should-I-flag-this test. Beyond that, avoid commenting on:

  • Style that a linter/formatter should catch — indentation, trailing whitespace, import order. If it's not enforced by tooling, it's not worth a review comment.
  • Pre-existing issues — do not flag bugs that were not introduced in this PR. Mention them in the review body if critical, never as inline comments.
  • Speculative breakage — "this *might* break X" is not a finding. You must identify the specific code path that is provably affected.
  • Pure preference disagreements — "I would have used X instead of Y" is not a finding unless Y has a concrete, demonstrable downside.
  • Obvious or trivial code — don't add "this looks fine" comments. Silence means approval.
  • Things another reviewer already flagged — don't pile on. At most, "+1" if you think it's critical.

Rule of thumb: if the original author would not fix the issue upon reading your comment, don't post it. If you have zero qualifying findings, output zero findings — an empty review is better than a noisy one.

Diff line number mapping

Getting line numbers right is critical for inline comments. The GitHub API line field refers to absolute line numbers in the file, not positions within the diff hunk.

From unified diff output:

@@ -10,5 +12,6 @@ function example() {
  context line        ← line 12 in new file
  context line        ← line 13
+ added line          ← line 14 (this is a RIGHT side line)
+ added line          ← line 15
  context line        ← line 16
- deleted line        ← (LEFT side only, line 13 in old file)
  context line        ← line 17
  • The +12,6 means this hunk starts at line 12 in the new file and spans 6 lines.
  • Count from the start through context lines (`) and added lines (+`) to get the absolute line number for RIGHT side comments.
  • Lines starting with - exist only in the old file (LEFT side) — skip them when counting new-file line numbers.

When in doubt, use the Read tool to open the file and verify the line number matches the code you want to comment on.

Re-review workflow

When the author pushes fixes and requests a re-review:

  1. Check what changed since your last review:
# Compare the old review commit to the current HEAD
gh pr view <pr> --json headRefOid --jq .headRefOid
# Then diff between the old and new HEAD
git diff <old-commit-sha>..<new-commit-sha>
  1. Verify each previous issue was addressed. Go through your prior comments and check if the fix is correct — not just that the code changed, but that the fix actually resolves the concern.
  2. Check for regressions. Sometimes fixes introduce new problems. Scan the new changes with the same checklist.
  3. Submit a follow-up review with the appropriate verdict:

- APPROVE if all P0/P1 issues are resolved and the patch is correct - REQUEST_CHANGES if P0/P1 issues remain or new ones were introduced - COMMENT if you want to acknowledge progress but aren't ready to approve

  1. Dismiss your stale review if it's no longer relevant:
REVIEW_ID=$(gh api repos/$OWNER_REPO/pulls/<pr>/reviews \
  --jq '[.[] | select(.state == "CHANGES_REQUESTED")][0].id')
gh api -X PUT repos/$OWNER_REPO/pulls/<pr>/reviews/$REVIEW_ID/dismissals \
  -f message="Issues addressed in latest push"

Handling large PRs (>500 lines changed)

  1. Classify each file by risk tier using the prioritization criteria from step 2.
  2. Review high-risk files thoroughly (full context, full checklist).
  3. Scan medium-risk files for high-severity issues only.
  4. Skip low-risk files (generated, lock files, etc.) — list them as "not reviewed."
  5. If the PR is too large to review effectively, say so and suggest the author split it.

References

平台分布

Codex

34.11%
按下载量换算21

Claude

27.14%
按下载量换算17

Cursor

20.06%
按下载量换算12

Gemini CLI

9.4%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills