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

github-pr-review-workflowGitHub PR 审查工作流

Agent Skill

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

总安装

989

周安装

40

GitHub Stars

公开资料未说明

下载量

310
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/uwe-schwarz/skills --skill github-pr-review-workflow

简介

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。

  • 适合查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库信息转为可执行下一步。
  • 使用时需区分只读查询与写入操作,涉及创建 PR、修改 Issue 等需确认 token 权限和授权范围。
  • 安装方式:通过 npx skills add 命令从指定 GitHub 仓库安装。
  • 涉及私有仓库或敏感操作时,应确保用户已配置正确的访问令牌和仓库权限。

SKILL.md

GitHub PR Review Workflow

Complete workflow for reviewing, addressing feedback, and resolving threads in GitHub pull requests using the gh-pr-review extension from agynio/gh-pr-review.

For gh-pr-review documentation, see: https://github.com/agynio/gh-pr-review


Installation

Install gh-pr-review extension (if not already installed):

gh extension install agynio/gh-pr-review

Verify installation:

gh pr-review --help

Workflow Overview

PR Review Request
  ├─ Get PR number/repo context
  ├─ List all review threads
  ├─ Analyze feedback and comments
  ├─ Validate whether each comment applies and explain decisions
  ├─ Implement fixes in code
  ├─ Run tests (unit + lint + typecheck)
  ├─ Reply to all open review threads with explanations
  ├─ Wait up to 5 minutes for follow-up
  ├─ Resolve review threads (or address follow-ups)
  └─ Commit and push changes

Step-by-Step Process

1. Get PR Context

Get current PR details:

# Get PR number
gh pr view --json number

# Get PR title and status
gh pr view --json title,author,state,reviews

# Get repository info (for gh pr-review)
git remote get-url origin

Output: PR number (e.g., <PR_NUMBER>) and repo (e.g., <OWNER/REPO>)


2. List Review Threads

List all review threads (active and outdated):

# From PR root directory
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>

# Example:
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>

Response format:

[
  {
    "threadId": "<THREAD_ID>",
    "isResolved": false,
    "updatedAt": "2026-01-17T22:48:36Z",
    "path": "path/to/file.ts",
    "line": 42,
    "isOutdated": false
  }
]

Key fields:

  • threadId: GraphQL node ID for resolving/replying
  • isResolved: Current status
  • isOutdated: Whether code has changed since comment
  • path + line: File location

If all review threads are resolved or none are present, search for normal comments and analyse them:

gh pr view <PR_NUMBER> --comments --json author,comments,reviews

3. Read and Analyze Feedback

Get review comments via GitHub API:

# Get all review comments for PR
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments

# With jq for cleaner output
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
  --jq '.[] | {id,body,author,created_at,line,path}'

Read the specific files mentioned:

# Read the file context to understand feedback
cat <path>
# or use Read tool

Categorize feedback:

  • High priority: Security issues, bugs, breaking changes
  • Medium priority: Code quality, maintainability, test coverage
  • Low priority: Style, documentation, nice-to-haves

Validate applicability before changing code (required):

  • Confirm each comment is accurate and relevant to the current code.
  • If a suggestion is incorrect, outdated, or doesn’t make sense in this codebase, reply with a detailed explanation of why it was not implemented.
  • Do not skip a change simply because it is time-consuming—either implement it or explain clearly why it should not be done.

4. Implement Fixes

Edit the files mentioned in review:

# Use Edit tool or bash
edit <file_path> <oldString> <newString>

Follow repository conventions:

  • Check existing patterns in similar files
  • Follow AGENTS.md guidelines
  • Maintain code style consistency
  • Add/update tests for new logic

5. Verify Changes (CRITICAL)

Always run tests before replying:

# Run project tests
bun run test

# Or specific test suites
bun run test:unit
bun run test:unit:watch
bun run test:e2e

Run type checking:

bun run typecheck
# or
tsc --noEmit

Run linting:

bun run lint
# or
eslint

Verify all pass:

  • ✓ No TypeScript errors
  • ✓ No ESLint warnings/errors
  • ✓ All unit tests pass
  • ✓ E2E tests pass (if relevant)

6. Commit and Push Changes

Stage and commit changes:

# Check status
git status

# Stage modified files
git add <files>

# Commit with clear message
git commit -m "<type>(<scope>): <description>

# Example:
git commit -m "refactor(emails): centralize from name logic and improve sanitization

- Extract RESEND_FROM_NAME constant to lib/emails/from-address.ts
- Replace duplicated logic in lib/auth.ts and app/actions/contact.ts
- Improve formatFromAddress sanitization (RFC 5322 chars)
- Add test cases for additional sanitization patterns"

Push to remote:

git push

Verify working tree:

git status
# Should show: "nothing to commit, working tree clean"

7. Reply to Review Threads

Reply with explanation of fixes:

gh pr-review comments reply \
  --pr <PR_NUMBER> \
  --repo <OWNER/REPO> \
  --thread-id <THREAD_ID> \
  --body "<your explanation>"

Best practices for replies:

  • Acknowledge the feedback
  • Explain what was changed
  • Reference specific commit(s) if relevant
  • Be concise but clear
  • Use code fences for code snippets

Example reply:

gh pr-review comments reply \
  --pr <PR_NUMBER> \
  --repo <OWNER/REPO> \
  --thread-id <THREAD_ID> \
  --body "$(cat <<'EOF'
@reviewer Thanks for the feedback! I've addressed your suggestions:

1. Applied the requested refactor in the relevant module
2. Removed duplicated logic in the affected call sites
3. Improved sanitization to match the project’s expectations
4. Added/updated tests for the new behavior

Changes committed in abc1234, all tests pass.
EOF
)"

Note: Use heredoc for multi-line bodies to avoid shell escaping issues. Note: Always start replies with @reviewer (e.g., @gemini-code-assist... or @greptile …) after you push changes. There can be multiple reviewers, so always look for the exact comment from which reviewer the comment is.

If this was a normal comment and not a review (see step 2), you can use this to answer:

gh pr comment <PR_NUMBER> --body "$(cat <<'EOF'
@reviewer … <same as above>
EOF
)"

You can also just react to the comment if appropriate.

Reply to all open threads first:

  1. Respond to every open comment with what you did or why it was not done.
  2. Only after all replies are posted, proceed to the wait/resolve phase.

8. Wait for Follow-ups and Resolve Threads

After implementing fixes, pushing the commit, and replying to all open comments, wait up to 5 minutes for follow-ups:

# Wait for a minute for reviewer response
sleep 60

# Re-check for new replies or new threads
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>

Do this step up to 5 times to wait for up to 5 minutes.

If there is a follow-up hint, address it (steps 3-7) and then resolve.

If there is a confirmation, resolve the thread:

gh pr-review threads resolve \
  --pr <PR_NUMBER> \
  --repo <OWNER/REPO> \
  --thread-id <THREAD_ID>

Response:

{
  "thread_node_id": "PRRT_kwDOQkQlKs5p24lu",
  "is_resolved": true
}

Batch resolve multiple threads:

# Resolve outdated threads first
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_OUTDATED_1>
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_OUTDATED_2>

# Then resolve active threads after replying
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_ACTIVE>

Strategy:

  1. Resolve outdated threads (isOutdated: true) - no reply needed
  2. Reply to active threads explaining fixes (or non-changes)
  3. Wait up to 5 minutes for a response
  4. Resolve active threads after confirmation or no response

9. Verify All Threads Resolved

Final check:

gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>

Expected output: All threads show isResolved: true


Complete Example Workflow

# 1. Get PR context
gh pr view --json number
git remote get-url origin

# 2. List review threads
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>

# 3. Read comments and files
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments --jq '.[] | {id,body,path,line}'
cat path/to/file.ts

# 4. Implement fixes
edit path/to/file.ts <oldString> <newString>

# 5. Run tests
bun run test:unit -- tests/path/to/file.test.ts
bun run typecheck
bun run lint

# 6. Commit and push
git add lib/emails/from-address.ts
git commit -m "fix: address PR review feedback"
git push

# 7. Reply to threads
gh pr-review comments reply --pr <PR_NUMBER> --repo <OWNER/REPO> \
  --thread-id <THREAD_ID> --body "$(cat <<'EOF'
@reviewer Thanks for review! I've addressed all feedback:
1. Centralized logic
2. Improved sanitization
3. Added tests

Changes in abc1234.
EOF
)"

# 8. Wait then resolve threads
sleep 300
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> \
  --thread-id <THREAD_ID>

# 9. Verify
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
git status

gh-pr-review Commands Reference

CommandPurpose
gh pr-review threads listList all review threads
gh pr-review threads resolveResolve a specific thread
gh pr-review threads unresolveReopen a resolved thread
gh pr-review comments replyReply to a review thread
gh pr-review reviewManage pending reviews

Common flags:

  • --pr <number>: Pull request number
  • -R, --repo <owner/repo>: Repository identifier
  • --thread-id <id>: GraphQL thread node ID

Troubleshooting

IssueSolution
command not found: gh-pr-reviewInstall extension: gh extension install agynio/gh-pr-review
must specify a pull request via --prRun from PR directory or add --pr <number>
--repo must be owner/repo when using numeric selectorsAdd -R <owner/repo> or run from authenticated repo
Shell escaping issues with --bodyUse heredoc: --body "$(cat <<'EOF'\n...\nEOF)"
Thread not foundCheck threadId is exact GraphQL ID, not PR number

Best Practices

Before replying:

  • ✓ Read all review comments carefully
  • ✓ Understand the intent (suggestion vs. blocker)
  • ✓ Check if similar issues exist elsewhere

When implementing fixes:

  • ✓ Follow existing code patterns
  • ✓ Update/add tests for changes
  • ✓ Run full test suite
  • ✓ Check lint and type errors

When replying:

  • ✓ Be polite and appreciative
  • ✓ Explain what was changed
  • ✓ Reference specific files/lines
  • ✓ Keep it concise

Before resolving:

  • ✓ Ensure all issues are addressed
  • ✓ Verify tests pass
  • ✓ Commit changes to branch

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenCode

29.16%
按下载量换算90

Claude Code

21.88%
按下载量换算68

Codex

20.52%
按下载量换算64

Gemini CLI

12.13%
按下载量换算38

Cursor

8.45%
按下载量换算26

Antigravity

3.6%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills