Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

review-github-pr审查 GitHub PR

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

416

周安装

17

GitHub Stars

2

下载量

135
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/afollestad/personal-ai-skills --skill review-github-pr

简介

用于审查 GitHub Pull Request,提供优先级排序的代码注释与反馈建议。

  • 适合评估代码变更质量、审计项目安全性和协助团队协作流程优化场景。
  • 通过 npx 命令从 GitHub 安装,仅支持只读操作,禁止修改本地文件内容。
  • 必须预先完成 gh auth login 认证,且不能绕过 GitHub CLI 直接调用 API。
  • review-github-pr 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Read-only: Do not modify any files. Your job is to review, report, and submit feedback on GitHub. Do not to make local changes.

Before proceeding, verify prerequisites:

  • Run gh auth status to confirm GitHub CLI is authenticated. If not, stop and tell the user to run gh auth login.
  • Confirm you have a PR or diff to review. If unclear, ask the user what to review before proceeding.

Instructions

Review a GitHub pull request, generate prioritized inline comments, and submit them as a batch review.

Use when: reviewing, evaluating, critiquing, auditing, or assessing a GitHub PR. Triggers on requests like "review this PR", "review PR #123", or when given a PR URL to review.

All GitHub interactions must use the gh CLI tool. Do not use curl, direct API URLs, or web fetching. Always use gh pr, gh api, or other gh subcommands.

1. Fetch the PR diff

Use gh CLI to get the full diff and PR metadata:

gh pr view <PR> --json number,title,body,baseRefName,headRefName
gh pr diff <PR>

If the user provides a URL, extract the repo and PR number from it. For private repos, always use gh CLI rather than fetching URLs directly.

2. Analyze the entire diff

  • Read the complete diff, not just individual chunks. Understand the full scope of changes.
  • Consider how changes across multiple files relate to each other.
  • Check for correctness, security, performance, readability, and maintainability.
  • Do not include fluff, praise, or "LGTM"-style commentary. Only include actionable findings: critical issues (P0/P1) and nits (P2/P3). Every comment must point to a specific problem or concrete suggestion. Comments that merely note something is "a good change" or compliment the author are not actionable — omit them entirely.

3. Generate prioritized comments

Organize all findings into priority levels:

  • P0 — Blocking: Bugs, security vulnerabilities, data loss risks, broken functionality. These must be fixed before merge.
  • P1 — Important: Logic errors, missing edge cases, poor error handling, test gaps. Strongly recommended to fix.
  • P2 — Suggestion: Code style improvements, better naming, minor refactors, documentation gaps.
  • P3 — Nit: Trivial style preferences, optional improvements, minor observations.

Before finalizing, review all findings — including P3 nits — and deliberately decide whether each is worth including. Do not silently drop nits; either include them or note that they were considered and omitted. Try to frame feedback as questions.

Present the full list of comments to the user, grouped and sorted by priority, before submitting. Each comment should include:

  • An index of the feedback to be used in step 4 below.
  • Priority level (P0/P1/P2/P3).
  • File path and line number.
  • The comment text.

4. Ask for review disposition

Ask the user if they want to submit all feedback, or just some, and how they want to submit the review:

  • Approve — approve the PR with the comments.
  • Request changes — request changes (appropriate when there are P0 or P1 items).
  • Comment — submit comments without approving or requesting changes.

The user may skip submitting certain feedback by index (provided in part 3).

5. Submit as a single batch review

Construct a JSON payload and submit all comments as a single review using gh api with --input.

Always write the JSON to a temp file rather than piping via echo — comment bodies often contain single quotes, backticks, and other characters that break shell quoting:

cat <<'PAYLOAD' > /tmp/pr_review.json
<json_payload>
PAYLOAD
gh api repos/{owner}/{repo}/pulls/{number}/reviews --method POST --input /tmp/pr_review.json

JSON payload format:

{
  "event": "APPROVE|REQUEST_CHANGES|COMMENT",
  "body": "",
  "comments": [
    {
      "path": "relative/file/path.ext",
      "line": 42,
      "side": "RIGHT",
      "body": "**[P0]** Comment text here"
    }
  ]
}

Every comment body must start with the priority as a bold prefix: **[P0]**, **[P1]**, **[P2]**, or **[P3]**.

For the review body/summary, leave it empty ("body": ""). Do not include summaries, priority counts (e.g. "1 P1, 3 P2"), fluff, filler, or praise. All feedback belongs in inline comments only.

Important — use line and side, NOT position:

  • line: The actual file line number in the new version of the file on the PR branch. Do NOT try to calculate this from diff hunk headers — hunk offsets are error-prone. Instead, fetch the real file from the PR branch to confirm each line number before submitting: gh api "repos/{owner}/{repo}/contents/{path}?ref={head_branch}" --jq '.content' | base64 -d | cat -n | sed -n '{start},{end}p'
  • Only fetch files whose paths appear in the diff. Do not guess or infer file paths that are not explicitly listed in the gh pr diff output — they may not exist, leading to 404 errors.
  • side: Always "RIGHT" for comments on new/changed lines.
  • Do not use the deprecated position field — it refers to a line's offset within the diff hunk and is error-prone across multi-hunk files.

Handling lines between diff hunks: If a comment targets a line that falls between diff hunks (i.e. it's unchanged code not shown as context in any hunk), the line-based review comment will be rejected with a 422 error. In this case, submit that comment separately as a file-level comment using the individual comment endpoint:

cat <<'PAYLOAD' > /tmp/pr_file_comment.json
{
  "body": "**[P2]** Comment text here",
  "path": "relative/file/path.ext",
  "subject_type": "file",
  "commit_id": "<head_commit_sha>"
}
PAYLOAD
gh api repos/{owner}/{repo}/pulls/{number}/comments --method POST --input /tmp/pr_file_comment.json

Get the head commit SHA from gh pr view <PR> --json headRefOid --jq '.headRefOid'. Reference the specific line number in the comment body so the author knows where to look. Never combine multiple comments into a single comment body to work around this limitation — always submit each finding as its own comment.

Return the review URL to the user when complete.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

31.78%
按下载量换算43

Claude

30.19%
按下载量换算41

Cursor

20.18%
按下载量换算27

Gemini CLI

8.45%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/afollestad/personal-ai-skills --skill review-github-pr 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills