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

github-pr-reviewGitHub PR 审查

Agent Skill

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

总安装

973

周安装

39

GitHub Stars

93

下载量

315
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

github-pr-review 用于围绕仓库、Issue 和 PR 提供协作支持,适合在 Codex、Claude、Cursor、Gemini CLI 中查询或管理项目状态。

  • 适用于整理提交差异、创建工单或汇总 CI 结果的代码协作场景。
  • 使用时需区分只读查询与写入操作,避免误改生产环境。
  • 涉及推送分支或访问私有仓库时,应确认 token 权限和用户授权。
  • 建议预览变更影响后再执行合并或修改操作。

SKILL.md

GitHub PR Review

Post structured code review feedback using the GitHub API with inline comments on specific lines.

Key Rule: One API Call

Bundle ALL comments into a single review API call. Do not post comments individually.

Posting a Review

Use the GitHub CLI (gh) with a JSON input file. The GITHUB_TOKEN is automatically available.

Important: Always use --input with a JSON file instead of -F flags. This avoids shell quoting issues with special characters in comment bodies (quotes, backticks, newlines, etc.) and eliminates the need for complex heredoc scripts.

Step 1: Create a JSON file

cat > /tmp/review.json << 'EOF'
{
  "commit_id": "{commit_sha}",
  "event": "COMMENT",
  "body": "Brief 1-3 sentence summary.",
  "comments": [
    {
      "path": "path/to/file.py",
      "line": 42,
      "side": "RIGHT",
      "body": "🟠 Important: Your comment here."
    },
    {
      "path": "another/file.js",
      "line": 15,
      "side": "RIGHT",
      "body": "🟡 Suggestion: Another comment."
    }
  ]
}
EOF

Step 2: Post the review

gh api -X POST repos/{owner}/{repo}/pulls/{pr_number}/reviews --input /tmp/review.json

Parameters

ParameterDescription
commit_idCommit SHA to comment on (use git rev-parse HEAD)
eventCOMMENT, APPROVE, or REQUEST_CHANGES
pathFile path as shown in the diff
lineLine number in the NEW version (right side of diff)
sideRIGHT for new/added lines, LEFT for deleted lines
bodyComment text with priority label

Multi-Line Comments

For comments spanning multiple lines, add start_line to specify the range:

{
  "path": "path/to/file.py",
  "start_line": 10,
  "line": 12,
  "side": "RIGHT",
  "body": "🟡 Suggestion: Refactor this block:\n\n```suggestion\nline_one = \"new\"\nline_two = \"code\"\nline_three = \"here\"\n```"
}

Important: The suggestion must have the same number of lines as the range (e.g., lines 10-12 = 3 lines).

Priority Labels

Start each comment with a priority label. Minimize nits - leave minor style issues to linters.

LabelWhen to Use
🔴 CriticalMust fix: security vulnerabilities, bugs, data loss risks
🟠 ImportantShould fix: logic errors, performance issues, missing error handling
🟡 SuggestionWorth considering: significant improvements to clarity or maintainability

Do NOT post 🟢 Nit or 🟢 Acceptable comments. If code is fine, simply don't comment on it. Inline comments that say "this looks good" or "acceptable trade-off" are noise — they create review threads that must be resolved without providing actionable value.

Example:

🟠 Important: This function doesn't handle None, which could cause an AttributeError.

if user is None: raise ValueError("User cannot be None")

GitHub Suggestions

For small code changes, use the suggestion syntax for one-click apply:

~~~

improved_code_here()
Use suggestions for: renaming, typos, small refactors (1-5 lines), type hints, docstrings.

Avoid for: large refactors, architectural changes, ambiguous improvements.

## Finding Line Numbers

From diff header: @@ -old_start,old_count +new_start,new_count @@

Count from new_start for added/modified lines

grep -n "pattern" filename # Find line number head -n 42 filename | tail -1 # Verify line content


## Fallback: curl

If `gh` is unavailable, use curl with the JSON file:

curl -X POST \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ "https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}/reviews" \ -d @/tmp/review.json


## Summary

1. Analyze the code and identify important issues (minimize nits)
2. Write review data to a JSON file (e.g., `/tmp/review.json`)
3. Post **ONE** review using `gh api --input /tmp/review.json`
4. Use priority labels (🔴🟠🟡) on every comment
5. Do NOT post comments for code that is acceptable — only comment when action is needed
6. Use suggestion syntax for concrete code changes
7. Keep the review body brief (details go in inline comments)
8. If no issues: post a short approval message with no inline comments

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.56%
按下载量换算121

Claude

27.19%
按下载量换算86

Cursor

17.89%
按下载量换算56

Gemini CLI

9.74%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

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

安装前确认

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

来源信息

继续浏览同类 Skills