Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问clear审计提醒

pr-review公关审查

Agent Skill

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

总安装

447

周安装

19

GitHub Stars

公开资料未说明

下载量

157
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

pr-review 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 它自动化审查 Pull Request 内容,提升代码质量与合并效率。
  • 可通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体调用方式。
  • 安装前建议核实权限范围、维护状态,以及是否涉及联网、命令执行或文件读写操作。
  • pr-review 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GitHub PR Review Skill

Overview

This skill automatically processes unresolved GitHub Pull Request review discussions by analyzing the code context, validating feedback, and taking appropriate actions. It intelligently categorizes feedback as valid, invalid, or already addressed, then creates action plans or posts clarifying responses accordingly.

Supported Actions

Action TypeWhen UsedOutcome
Create TodoValid feedback needing fixesAdds task to todo list
Reply & ResolveInvalid or misunderstood feedbackPosts clarifying comment, resolves thread
Confirm & ResolveAlready fixed feedbackPosts confirmation, resolves thread
EscalateAmbiguous or complex feedbackAsks user for guidance

Discussion Classification

Valid Feedback

Legitimate issues that require code changes:

  • Missing error handling
  • Type safety concerns
  • Performance problems
  • Security vulnerabilities
  • Logic errors

Invalid Feedback

Misunderstandings or incorrect observations:

  • Code already handles the mentioned case
  • Reviewer misread the implementation
  • Feedback based on outdated context
  • Incorrect assumptions

Already Addressed

Feedback that has been fixed since review:

  • Changes made in recent commits
  • Fixed in different files
  • Resolved through refactoring

Workflow

1. Verify GitHub CLI Installation

Check if gh CLI is available:

gh --version

Expected output:

  • Success: gh version X.Y.Z (YYYY-MM-DD)
  • Failure: Command not found error

If not installed, display installation guide:

GitHub CLI (gh) is not installed.

Installation:
  macOS:          brew install gh
  Ubuntu/Debian:  sudo apt install gh
  Windows:        winget install GitHub.cli
  Linux (other):  See https://github.com/cli/cli#installation

After installation, authenticate:
  gh auth login

Verify authentication:

gh auth status

If not authenticated:

Please authenticate with GitHub:
  gh auth login

Follow the prompts to complete authentication.

2. Parse PR URL

Extract repository and PR information from argument:

URL format: https://github.com/{owner}/{repo}/pull/{number}

Extraction logic:

url="$ARGUMENTS"
owner=$(echo "$url" | sed -n 's#.*/github.com/\([^/]*\)/.*#\1#p')
repo=$(echo "$url" | sed -n 's#.*/github.com/[^/]*/\([^/]*\)/.*#\1#p')
pr_number=$(echo "$url" | sed -n 's#.*/pull/\([0-9]*\).*#\1#p')

Example:

Input:  https://github.com/anthropics/claude-code/pull/123
Output: owner=anthropics, repo=claude-code, pr_number=123

Validation:

  • Ensure all three values are non-empty
  • Verify PR number is numeric
  • Confirm URL matches expected pattern

If URL invalid:

Error: Invalid GitHub PR URL

Expected format: https://github.com/OWNER/REPO/pull/NUMBER
Example: https://github.com/anthropics/claude-code/pull/123

3. Fetch Unresolved Discussions

Query GitHub GraphQL API for review threads:

gh api graphql -f query='
  query($owner: String!, $repo: String!, $pr: Int!) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $pr) {
        title
        author { login }
        reviewThreads(first: 100) {
          nodes {
            id
            isResolved
            isOutdated
            path
            line
            comments(first: 10) {
              nodes {
                id
                body
                author { login }
                createdAt
              }
            }
          }
        }
      }
    }
  }
' -f owner="$owner" -f repo="$repo" -F pr="$pr_number"

Response structure:

{
  "data": {
    "repository": {
      "pullRequest": {
        "reviewThreads": {
          "nodes": [
            {
              "id": "PRRT_...",
              "isResolved": false,
              "isOutdated": false,
              "path": "src/auth.ts",
              "line": 45,
              "comments": {
                "nodes": [
                  {
                    "body": "This needs null checking",
                    "author": {"login": "reviewer"},
                    "createdAt": "2024-01-01T12:00:00Z"
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

Filter for unresolved threads:

  • Extract threads where isResolved: false
  • Optionally include isOutdated: true threads (may be relevant)
  • Store thread ID, path, line, and all comments

If no unresolved discussions:

✓ All review discussions have been resolved

PR: [PR Title]
Status: No pending feedback

4. Analyze Each Discussion

For each unresolved thread, perform comprehensive analysis:

4.1 Read Local Code

Fetch the file at the specified path:

# Read the file with context around the line
Read file_path="$path"

Extract relevant section:

  • Focus on the specific line mentioned
  • Include 10 lines before and after for context
  • Identify function/class scope

4.2 Fetch PR Diff

Get the complete PR diff:

gh pr diff "$pr_number" -R "$owner/$repo"

Parse diff for the specific file:

  • Locate changes to the file mentioned in comment
  • Identify if the line was added, modified, or is context
  • Check if subsequent commits modified this area

4.3 Review Comment Thread

Analyze all comments in the thread:

  • First comment: Original reviewer feedback
  • Subsequent comments: Author responses and discussion
  • Extract key concerns and questions
  • Identify if conversation reached conclusion

4.4 Compare States

Determine the current state:

  1. Has code changed since review?

- Check git log for commits after review comment timestamp - Compare current code to PR diff

  1. Does current code address the concern?

- Valid feedback: Code still has the issue - Invalid feedback: Code already handles it - Already addressed: Fixed in later commits

  1. Is feedback contextually correct?

- Reviewer may have missed related code - Check imports and dependencies - Verify assumptions in the comment

5. Categorize and Process

Type A: Valid Feedback (Needs Fix)

Identification:

  • Issue exists in current code
  • Feedback is technically correct
  • Change would improve code quality

Action:

# Add to todo list using TodoWrite
TodoWrite:
  - content: "Fix [issue] in [file]:[line]"
  - status: "pending"

Example:

Discussion: "Missing null check for user.profile"
Current code: No null check present
Category: Valid Feedback

Action: Added todo "Add null check for user.profile in auth.ts:45"

Type B: Invalid Feedback (Misunderstanding)

Identification:

  • Code already handles the concern
  • Reviewer misunderstood implementation
  • Feedback based on incorrect assumption

Action:

# Post clarifying comment
gh api graphql -f query='
  mutation($threadId: ID!, $body: String!) {
    addPullRequestReviewThreadReply(input: {
      pullRequestReviewThreadId: $threadId
      body: $body
    }) {
      comment { id }
    }
  }
' -f threadId="$thread_id" -f body="[polite clarification]"

# Resolve the thread
gh api graphql -f query='
  mutation($threadId: ID!) {
    resolveReviewThread(input: {threadId: $threadId}) {
      thread { isResolved }
    }
  }
' -f threadId="$thread_id"

Comment template:

Thank you for the feedback! This is actually already handled:

[Explanation with code reference]

The [specific mechanism] ensures [desired behavior].

Reference: [file]:[line]

Example:

Discussion: "Variable 'token' is unused"
Current code: Variable used on line 67
Category: Invalid Feedback

Reply: "Thank you for checking! The 'token' variable is actually used
        on line 67 in the authentication middleware. Here's the usage:

if (token) { return validateToken(token); }

Action: Resolved thread

Type C: Already Addressed

Identification:

  • Issue existed at review time
  • Fixed in subsequent commits
  • Current code is correct

Action:

# Post confirmation comment
gh api graphql -f query='[same mutation as Type B]' \
  -f threadId="$thread_id" \
  -f body="This has been addressed in commit [hash]. [Brief explanation]"

# Resolve thread
gh api graphql -f query='[same resolve mutation]' -f threadId="$thread_id"

Comment template:

This has been addressed in commit [short-hash].

Changes made:
[Brief summary of the fix]

Current implementation:
[Code snippet if helpful]

Example:

Discussion: "Add TypeScript types for User interface"
Current code: User interface fully typed
Category: Already Addressed

Reply: "This has been addressed in commit abc123f. Added comprehensive
        TypeScript types for the User interface including optional fields."
Action: Resolved thread

Type D: Ambiguous or Complex

Identification:

  • Feedback requires design decision
  • Multiple valid approaches exist
  • User input needed for direction

Action:

# Ask user for guidance using AskUserQuestion
AskUserQuestion:
  question: "[Reviewer] suggests [approach]. How would you like to proceed?"
  options:
    - Implement suggested approach
    - Explain current approach to reviewer
    - Discuss alternative solution

6. Generate Summary Report

After processing all discussions, create summary:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PR Review Processing Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

PR: [PR Title] (#[number])
Repository: [owner]/[repo]

Summary:
  Total discussions:    [X]
  Valid feedback:       [Y] → Added to todo list
  Invalid feedback:     [Z] → Clarified and resolved
  Already addressed:    [W] → Confirmed and resolved
  Escalated:           [N] → Requires user input

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Action Items Created:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. [file]:[line] - [description]
2. [file]:[line] - [description]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Resolved Discussions:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✓ [file]:[line] - [reason for resolution]
✓ [file]:[line] - [reason for resolution]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

7. 반복 처리 루프

수정사항(Valid Feedback)이 있는 경우 모든 discussion이 해결될 때까지 다음 사이클을 반복합니다:

7.1 코드 수정 및 Push

Todo 항목에 따라 코드 수정 후 push:

# 변경사항 커밋
git add .
git commit -m "fix: address PR review feedback"

# Push
git push

7.2 CI Check 대기

PR의 모든 check가 완료될 때까지 대기:

# Check 상태 모니터링 (완료될 때까지 polling)
gh pr checks "$pr_number" -R "$owner/$repo" --watch

Check 상태 확인:

gh pr checks "$pr_number" -R "$owner/$repo"

예상 출력:

Some checks are still pending
0 failing, 1 pending, 0 passing, and 0 skipped checks

build   In progress  https://github.com/...

Check 완료 대기 로직:

  • --watch 플래그로 실시간 모니터링
  • 모든 check가 pass/fail/skipped 상태가 될 때까지 대기
  • Check 실패 시 사용자에게 알림 후 계속 진행

7.3 새로운 Discussion 확인

Check 완료 후 새로운 unresolved discussion 조회:

# 3단계의 GraphQL 쿼리 재실행
gh api graphql -f query='
  query($owner: String!, $repo: String!, $pr: Int!) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $pr) {
        reviewThreads(first: 100) {
          nodes {
            id
            isResolved
            isOutdated
            path
            line
            comments(first: 10) {
              nodes {
                id
                body
                author { login }
                createdAt
              }
            }
          }
        }
      }
    }
  }
' -f owner="$owner" -f repo="$repo" -F pr="$pr_number"

새 discussion 발견 시:

  • 4단계(분석)부터 다시 시작
  • 새로운 discussion 처리

7.4 종료 조건

루프 종료 조건:

  • Unresolved discussion이 0개
  • 모든 CI check 통과

최종 완료 메시지:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ PR Review 처리 완료
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

PR: [PR Title] (#[number])
Repository: [owner]/[repo]

처리 사이클: [N]회
총 처리 discussion: [X]개
CI Check: ✓ 모두 통과

모든 review feedback이 처리되었습니다.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

7.5 루프 흐름도

┌─────────────────────────────────────────────────────────┐
│                    시작                                  │
└────────────────────────┬────────────────────────────────┘
                         ▼
┌─────────────────────────────────────────────────────────┐
│          Unresolved discussion 조회                      │
└────────────────────────┬────────────────────────────────┘
                         ▼
              ┌─────────────────────┐
              │ discussion 있음?    │
              └──────────┬──────────┘
                   │           │
                  Yes          No
                   │           │
                   ▼           ▼
┌──────────────────────┐  ┌─────────────────────────┐
│ 분석 및 분류 (4단계)  │  │     ✓ 처리 완료         │
└──────────┬───────────┘  │     루프 종료           │
           ▼              └─────────────────────────┘
┌──────────────────────┐
│ 처리 및 응답 (5단계)  │
│ - Valid: 수정        │
│ - Invalid: resolve   │
│ - Addressed: resolve │
└──────────┬───────────┘
           ▼
     ┌───────────┐
     │ 수정 있음? │
     └─────┬─────┘
       Yes │
           ▼
┌──────────────────────┐
│ git commit && push   │
└──────────┬───────────┘
           ▼
┌──────────────────────┐
│ CI Check 대기        │
│ gh pr checks --watch │
└──────────┬───────────┘
           ▼
           │ (처음으로 돌아감)
           └────────────────────────────────────────┐
                                                    │
              ┌─────────────────────────────────────┘
              ▼
┌─────────────────────────────────────────────────────────┐
│          Unresolved discussion 재조회                    │
└─────────────────────────────────────────────────────────┘

Examples

Example 1: Valid Null Check Feedback

Review comment:

src/auth.ts:45
"This function should handle null user profiles"

Analysis:

# Read file
Read src/auth.ts

# Check lines 35-55
function getProfile(user) {
  return user.profile.name;  // Line 45 - no null check
}

Outcome:

Category: Valid Feedback
Action: Added todo "Add null check for user.profile in auth.ts:45"

Example 2: Misunderstood Variable Usage

Review comment:

src/api.ts:120
"Variable 'cache' is declared but never used"

Analysis:

# Read file
Read src/api.ts

# Check lines 110-140
const cache = new Map();  // Line 120

function getData(key) {
  if (cache.has(key)) {   // Line 130 - using cache
    return cache.get(key);
  }
  // ...
}

Outcome:

Category: Invalid Feedback

Reply posted:
"Thank you for reviewing! The 'cache' variable is actually used in the
getData function on lines 130-132 for memoization. Here's the usage:

if (cache.has(key)) { return cache.get(key); }


The cache improves performance by storing previously fetched data."

Action: Resolved thread

Example 3: Already Fixed Type Issue

Review comment:


src/types.ts:15 "Missing return type annotation"

Analysis:

# Check current code
Read src/types.ts

# Line 15 now has type annotation
function calculate(): number {  // Line 15 - type added
  return 42;
}

# Check git log
git log --oneline --since="[review date]" src/types.ts
# Shows: "a1b2c3d feat(types): add return type annotations"

Outcome:

Category: Already Addressed

Reply posted:
"This has been addressed in commit a1b2c3d. Added return type annotations
to all exported functions including this one.

Current implementation:

function calculate(): number { return 42; }


Action: Resolved thread

Technical Requirements

Required Tools

ToolPurposeInstallationCheck Command
GitHub CLIAPI accessbrew install ghgh --version
GitLocal repositoryBuilt-in or package managergit --version
jqJSON parsingbrew install jqjq --version

API Requirements

  • GitHub API: GraphQL endpoint access
  • Authentication: Valid GitHub token with repo scope
  • Rate limits: ~5000 requests/hour (authenticated)
  • Permissions: Read access to repository, write access to PR comments

Minimum Versions

  • gh CLI: 2.0.0 or higher
  • Git: 2.0 or higher
  • jq: 1.6 or higher

Best Practices

  1. Always read local code before making judgments
  2. Be polite and professional in all responses
  3. Provide code references to support clarifications
  4. Resolve threads only after posting comments
  5. Group related todos for efficiency
  6. Include commit hashes when mentioning fixes
  7. Ask for user input when uncertain
  8. Check git history to understand recent changes

Limitations

  1. Local context only: Analysis based on local repository state
  2. 100 discussions max: GraphQL query limited to first 100 threads
  3. 10 comments per thread: Comment fetch limited to first 10
  4. No file history: Cannot analyze full file evolution
  5. Requires authentication: Must have GitHub access token
  6. Rate limiting: May hit API limits on large PRs

Error Handling

Common Errors and Solutions

Error: gh: command not found

  • Cause: GitHub CLI not installed
  • Solution: Install with brew install gh or platform equivalent

Error: To get started with GitHub CLI, run: gh auth login

  • Cause: Not authenticated with GitHub
  • Solution: Run gh auth login and follow prompts

Error: GraphQL: Could not resolve to a PullRequest

  • Cause: Invalid PR number or URL
  • Solution: Verify PR exists and URL is correct

Error: Resource not accessible by personal access token

  • Cause: Insufficient permissions
  • Solution: Re-authenticate with gh auth refresh -s repo

Error: API rate limit exceeded

  • Cause: Too many API requests
  • Solution: Wait for rate limit reset (check gh api rate_limit)

Advanced Features

Batch Processing

For PRs with many discussions:

# Process in batches of 10
for i in {0..9}; do
  # Process discussion $i
  # Add delay to avoid rate limiting
  sleep 1
done

Draft Responses

Before posting, optionally show draft responses to user:

Draft response for [file]:[line]:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Response text]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Post this response? [y/n]

Filter by Reviewer

Process discussions from specific reviewer:

# Filter threads by comment author
jq '.data.repository.pullRequest.reviewThreads.nodes[] |
    select(.comments.nodes[0].author.login == "specific-reviewer")'

References

Notes

  • Always post comments before resolving threads (order matters)
  • Responses should be professional and technically accurate
  • Include code snippets when clarifying implementation details
  • Reference specific lines/commits to support arguments
  • Never resolve threads without explanation
  • Escalate to user when feedback is ambiguous or requires design decision

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

30.06%
按下载量换算47

Antigravity

23.03%
按下载量换算36

windsurf

18.22%
按下载量换算29

trae

13.09%
按下载量换算21

OpenCode

6.64%
按下载量换算10

Gemini CLI

3.16%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills