Token导航 LogoToken导航

Agent Skill · 开发

gh-pr-review(GH 公关评论)

gh-pr-review 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

gh-pr-review 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 21,366。

总安装 190周安装 8GitHub Stars 3下载 67核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

gh-pr-review 提供 GitHub PR 内联评论的完整终端访问能力,输出 LLM 友好 JSON。适用于自动化审查流程、回复评论线程或集成 CI/CD 流水线。支持预览待提交评论、解析代码上下文后再正式提交。需具备对应仓库的写权限方可执行创建与修改操作。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

gh-pr-review 怎么安装?

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

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

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

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

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

gh-pr-review 是免费的吗?

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

gh-pr-review 用的人多吗?

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

gh-pr-review 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
gh-pr-review

GH 公关评论 · 本页

1903执行命令未明确有提醒

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

SKILL.md 原文

gh-pr-review

A GitHub CLI extension that provides complete inline PR review comment access from the terminal with LLM-friendly JSON output.

When to Use

Use this skill when you need to:

  • View inline review comments and threads on a pull request
  • Reply to review comments programmatically
  • Resolve or unresolve review threads
  • Create and submit PR reviews with inline comments
  • Edit comments in pending reviews
  • Delete comments from pending reviews
  • Preview pending review comments with code context before submitting
  • Access PR review context for automated workflows
  • Filter reviews by state, reviewer, or resolution status

This tool is particularly useful for:

  • Automated PR review workflows
  • LLM-based code review agents
  • Terminal-based PR review processes
  • Getting structured review data without multiple API calls

Installation

Install the latest release directly from GitHub:

gh extension install EurFelux/gh-pr-review

Or download the pre-built binary for your platform from the releases page and install manually.

Core Commands

1. View All Reviews and Threads

Get complete review context with inline comments and thread replies:

gh pr-review review view -R owner/repo --pr <number>

Useful filters:

  • --unresolved - Only show unresolved threads
  • --reviewer <login> - Filter by specific reviewer
  • --states <APPROVED|CHANGES_REQUESTED|COMMENTED|DISMISSED|PENDING> - Filter by review state
  • --tail <n> - Keep only last n replies per thread
  • --not_outdated - Exclude outdated threads

Output: Structured JSON with reviews, comments, thread_ids, and resolution status.

2. Reply to Review Threads

Reply to an existing inline comment thread:

gh pr-review comments reply <pr-number> -R owner/repo \
  --thread-id <PRRT_...> \
  --body "Your reply message"

3. List Review Threads

Get a filtered list of review threads:

gh pr-review threads list -R owner/repo <pr-number> --unresolved --mine

4. Resolve/Unresolve Threads

Mark threads as resolved:

gh pr-review threads resolve -R owner/repo <pr-number> --thread-id <PRRT_...>

5. Create and Submit Reviews

Start a pending review:

gh pr-review review start -R owner/repo <pr-number>

Add inline comment (recommended - explicit single line):

gh pr-review review add-comment \
  --review-id <PRR_...> \
  --path <file-path> \
  --start-line <line-number> \
  --line <line-number> \
  --body "Your comment" \
  -R owner/repo <pr-number>

Add multi-line comment (range):

gh pr-review review add-comment \
  --review-id <PRR_...> \
  --path <file-path> \
  --start-line <start-line> \
  --line <end-line> \
  --start-side <LEFT|RIGHT> \
  --side <LEFT|RIGHT> \
  --body "Your comment" \
  -R owner/repo <pr-number>
Note: While --line alone works for single-line comments, using both --start-line and --line with the same value is recommended for clarity.

Tip: Using heredoc for multi-line comments with code blocks

When your comment contains code blocks or special characters, use a heredoc to avoid shell escaping issues:

gh pr-review review add-comment \
  --review-id <PRR_...> \
  --path <file-path> \
  --line <line-number> \
  --body "$(cat <<'EOF'
**Issue: Unstable React key**

Using `index` as React key is problematic:

// Before todos.map((todo, index) => <Todo key={index} />)

// After todos.map((todo) => <Todo key={todo.id} />)


This causes unnecessary re-renders when list reorders. EOF)" -R owner/repo

The <<'EOF' syntax prevents variable expansion, preserving $ and backticks literally.

Comment positioning parameters:

  • --line (required) - The absolute line number in the file where the comment ends. For RIGHT side, this is the line number in the modified file. For LEFT side, this is the line number in the original file. The line must fall within a diff hunk range.
  • --side (optional) - Which version of the code to comment on: LEFT (original) or RIGHT (modified). Default: RIGHT
  • --start-line (optional) - The starting line number for multi-line comments. When specified, --line becomes the end line

- Best practice: Even for single-line comments, consider using --start-line with the same value as --line. This makes your intent explicit and avoids confusion about whether you're targeting a single line or a range.

  • --start-side (optional) - Which side the start line is on. Use when --start-line is specified

Line Number Rules:

--line takes the absolute line number in the file — the same number you see in your editor or in the diff gutter on GitHub. The line must fall within a diff hunk range (GitHub rejects lines outside the diff).

How to verify a line is within a diff hunk

Step 1: Get the patch for the file

gh api repos/OWNER/REPO/pulls/PR/files --jq '.[] | select(.filename == "path/to/file.ts") | .patch'

Step 2: Read the diff hunk header

@@ -oldStart,oldCount +newStart,newCount @@
  • For RIGHT side: valid range is newStart to newStart + newCount - 1
  • For LEFT side: valid range is oldStart to oldStart + oldCount - 1
  • For new files (-0,0 +1,N): valid range is 1 to N

Examples

Example 1: New file

@@ -0,0 +1,10 @@
+line 1
+line 2
+line 3

To comment on "line 3": Use --line 3 (absolute line number in the new file)

Example 2: Modified file (RIGHT side)

@@ -100,5 +100,15 @@
 existing code line 100    <- RIGHT line 100
 existing code line 101    <- RIGHT line 101
+new code A                <- RIGHT line 102
+new code B                <- RIGHT line 103 (comment here: --line 103)
+new code C                <- RIGHT line 104
 existing code line 105    <- RIGHT line 105

To comment on "new code B": Use --line 103 --side RIGHT

Example 3: Modified file (LEFT side)

@@ -50,7 +50,7 @@
 import { isJSON, parseJSON } from '@renderer/utils'
-import { defaultTimeout } from '@shared/config/constant'    <- LEFT line 53
+import { DEFAULT_TIMEOUT } from '@shared/config/constant'

To comment on the deleted import: Use --line 53 --side LEFT

Quick Reference Table

Diff HeaderSideTo comment on...Use
@@ -0,0 +1,173 @@RIGHTLine 80 of new file--line 80
@@ -224,6 +224,112 @@RIGHTLine 280 in the modified file--line 280
@@ -50,7 +50,7 @@LEFTDeleted line at old file line 53--line 53 --side LEFT

Common Mistakes

❌ Wrong: Using a line number that falls outside any diff hunk range ❌ Wrong: Confusing LEFT/RIGHT side — LEFT uses old file line numbers, RIGHT uses new file line numbers

✅ Correct: Use the absolute line number as shown in the diff gutter ✅ Correct: Verify the line falls within a hunk range using the @@ header

Note on LEFT side ranges: When using --start-line / --line with --side LEFT, the GitHub diff view will include any interleaved RIGHT side additions that fall between your start and end lines. This is a GitHub rendering behavior, not a tool issue.

Debug tip: If you get a "line number is invalid" error, verify the line falls within a hunk range. Use gh api repos/OWNER/REPO/pulls/PR/files to inspect the patch.

Edit a submitted review body (requires review node ID PRR_...):

gh pr-review review edit \
  --review-id <PRR_...> \
  --body "Updated review body" \
  -R owner/repo <pr-number>

Edit a review comment (requires comment node ID PRRC_...):

gh pr-review review edit-comment \
  --comment-id <PRRC_...> \
  --body "Updated comment text" \
  -R owner/repo <pr-number>

Delete a comment from pending review (requires comment node ID PRRC_...):

gh pr-review review delete-comment \
  --comment-id <PRRC_...> \
  -R owner/repo <pr-number>

Preview pending review comments before submitting:

# Preview all pending comments
gh pr-review review preview -R owner/repo <pr-number>

# Preview a single thread's comment by thread ID
gh pr-review review preview --thread-id <PRRT_...> -R owner/repo <pr-number>

Output: Shows pending comments with code context (diff lines each comment is attached to), including accurate LEFT/RIGHT side identification. The code_context field contains the actual diff lines.

Critical: Always verify code_context content matches your intended target code. A successful API response doesn't guarantee correct positioning — only the code_context lines confirm where your comment will actually appear.

Submit the review:

gh pr-review review submit \
  --review-id <PRR_...> \
  --event <APPROVE|REQUEST_CHANGES|COMMENT> \
  --body "Overall review summary" \
  -R owner/repo <pr-number>

Output Format

All commands return structured JSON optimized for programmatic use:

  • Consistent field names
  • Stable ordering
  • Omitted fields instead of null values
  • Essential data only (no URLs or metadata noise)
  • Pre-joined thread replies

Example output structure:

{
  "reviews": [
    {
      "id": "PRR_...",
      "state": "CHANGES_REQUESTED",
      "author_login": "reviewer",
      "comments": [
        {
          "thread_id": "PRRT_...",
          "path": "src/file.go",
          "author_login": "reviewer",
          "body": "Consider refactoring this",
          "created_at": "2024-01-15T10:30:00Z",
          "is_resolved": false,
          "is_outdated": false,
          "thread_comments": [
            {
              "author_login": "author",
              "body": "Good point, will fix",
              "created_at": "2024-01-15T11:00:00Z"
            }
          ]
        }
      ]
    }
  ]
}

Best Practices

  1. Always use -R owner/repo to specify the repository explicitly
  2. Use --unresolved and --not_outdated to focus on actionable comments
  3. Save thread_id values from review view output for replying
  4. Filter by reviewer when dealing with specific review feedback
  5. Use --tail 1 to reduce output size by keeping only latest replies
  6. Parse JSON output instead of trying to scrape text
  7. Verify line numbers fall within a diff hunk range before adding inline comments

- Use gh api repos/OWNER/REPO/pulls/PR/files to get patches - Check the @@ -oldStart,oldCount +newStart,newCount @@ header for valid ranges - Use absolute file line numbers (RIGHT = new file, LEFT = old file)

  1. Preview each comment immediately after adding — After each add-comment, run review preview --thread-id <PRRT_...> and verify the code_context matches your intended target code. If there's a mismatch, delete and re-add the comment on the correct line before proceeding to the next comment.

Per-Comment Verification Checklist (MANDATORY)

After each review add-comment, you MUST immediately verify the comment by running review preview --thread-id <PRRT_...>.

Verification Steps (per comment)

  1. Code Context Check (Critical):

- The code_context contains the actual code you intended to comment on (NOT comments, NOT empty lines, NOT JSDoc) - If commenting on a function call, code_context shows the call, not the comment above it - If commenting on an assignment, code_context shows x = y, not } or /**

  1. Intent Alignment Check:

- The comment body matches the code shown in code_context - If the comment says "this line does X", code_context actually shows that line

  1. On mismatch: Delete the misplaced comment (review delete-comment --comment-id <PRRC_...>) and re-add it on the correct line. Do NOT proceed to the next comment until the current one passes verification.

Example - Wrong vs Correct:

// ❌ WRONG - Comment attached to JSDoc
{
  "code_context": ["366:    * @param level - The log level to set"]
}

// ✅ CORRECT - Comment attached to implementation
{
  "code_context": ["369: +    this.consoleLevel = level", "370:     this.logger.level = level"]
}

WARNING: DO NOT submit if any comment has code_context pointing to JSDoc, empty lines, or incorrect code.

Common Workflows

Get Unresolved Comments for Current PR

gh pr-review review view --unresolved --not_outdated -R owner/repo --pr $(gh pr view --json number -q .number)

Reply to All Unresolved Comments

  1. Get unresolved threads: gh pr-review threads list --unresolved -R owner/repo <pr>
  2. For each thread_id, reply: gh pr-review comments reply <pr> -R owner/repo --thread-id <id> --body "..."
  3. Optionally resolve: gh pr-review threads resolve <pr> -R owner/repo --thread-id <id>

Create Review with Inline Comments

Line numbers are absolute file line numbers (the same numbers shown in the diff gutter). They must fall within a diff hunk range.

  1. Start: gh pr-review review start -R owner/repo <pr>
  2. Verify line is within a diff hunk: gh api repos/OWNER/REPO/pulls/PR/files --jq '.[] | select(.filename == "target/file.ts") | {filename, patch}' Check the @@ +newStart,newCount @@ header — valid range for RIGHT side is newStart to newStart + newCount - 1.
  3. Add a comment: gh pr-review review add-comment -R owner/repo <pr> --review-id <PRR_...> --path <file> --line <num> --body "..."
  4. Immediately preview the comment just added: gh pr-review review preview --thread-id <PRRT_...> -R owner/repo <pr> — verify code_context matches the intended target code. If mismatched, delete and re-add on the correct line.
  5. Repeat steps 3–4 for each comment.
  6. Edit comments (if needed): gh pr-review review edit-comment -R owner/repo <pr> --comment-id <PRRC_...> --body "Updated text"
  7. Delete comments (if needed): gh pr-review review delete-comment -R owner/repo <pr> --comment-id <PRRC_...>
  8. Submit: gh pr-review review submit -R owner/repo <pr> --review-id <PRR_...> --event REQUEST_CHANGES --body "Summary"

Important Notes

  • All IDs use GraphQL format (PRR_... for reviews, PRRT_... for threads)
  • Commands use pure GraphQL (no REST API fallbacks)
  • Empty arrays [] are returned when no data matches filters
  • The --include-comment-node-id flag adds PRRC_... IDs when needed
  • Thread replies are sorted by created_at ascending
  • Use --start-line and --start-side for multi-line comments; --line becomes the end line

Documentation Links

平台分布

Codex

33.08%
按下载量换算22

Claude

29.84%
按下载量换算20

Cursor

19.88%
按下载量换算13

Gemini CLI

10.35%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

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

安装前确认

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

继续浏览同类 Skills