Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计异常

github-pr-reviewGitHub PR 审查

Agent Skill

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

总安装

396

周安装

17

GitHub Stars

71

下载量

139
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/the1studio/theone-training-skills --skill github-pr-review

简介

github-pr-review 实现自动化 Pull Request 审查流程,提升协作效率。

  • 适用于代码合并前的安全检查、规范验证与建议生成。
  • 支持内联建议提交、审核状态标记及一键修复功能。
  • 使用前需配置 GitHub Token 并授权目标仓库访问权限。
  • 仅对已启用 webhook 的 The1Studio 项目完全生效。

SKILL.md

GitHub PR Review with Suggested Changes

Skill Purpose

This skill enables comprehensive GitHub pull request reviews with actionable suggested changes that developers can apply directly through GitHub's web UI using the "Commit suggestion" button.

Key Features:

  • Code review with comprehensive checklists (security, quality, performance)
  • Inline suggested changes using ```suggestion blocks
  • Approval decision logic (APPROVE / REQUEST_CHANGES / COMMENT)
  • GitHub API integration for programmatic review comments
  • Batch suggestion support for efficient fixes
  • Integration with tech-specific skills (Unity, React Native, etc.)

⚠️ CRITICAL: Always Approve or Request Changes

After every PR review, you MUST submit a review decision:

# Approve (no critical/high issues)
gh pr review $PR --repo $REPO --approve --body "..."

# Request changes (critical/high issues found)
gh pr review $PR --repo $REPO --request-changes --body "..."

# Comment only (medium issues, can merge)
gh pr review $PR --repo $REPO --comment --body "..."

See: Approval Criteria for decision tree.

When This Skill Triggers

Automatically triggers when:

  • User asks to "review PR" or "review pull request"
  • User provides a GitHub PR URL for review
  • User asks to "check PR" or "analyze PR changes"
  • User requests code review with suggestions
  • User asks "help review this PR"

Manual trigger:

  • User explicitly invokes the skill with /github-pr-review

Quick Reference

GitHub Suggested Changes Syntax

Add nullable directive at the top of the file.

\`\`\`suggestion
#nullable enable

namespace YourNamespace
\`\`\`

Result: Shows a "Commit suggestion" button in GitHub UI that applies the change when clicked.

How It Works

Step 1: Fetch PR Details

# Get PR information
gh pr view <PR_NUMBER> --repo <OWNER/REPO> --json title,body,files,commits

# Get PR diff
gh pr diff <PR_NUMBER> --repo <OWNER/REPO>

Step 2: Analyze Code Changes

  • Review against coding standards (e.g., theone-unity-standards)
  • Identify issues by severity (Critical, Important, Suggestions)
  • Categorize issues by file and line number

Step 3: Create Inline Suggestions

Use GitHub API to add inline comments with suggestions:

# Get latest commit ID
COMMIT_ID=$(gh pr view <PR> --repo <REPO> --json commits --jq '.commits[-1].oid')

# Add inline suggestion comment
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  /repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
  -f body="<suggestion text with \`\`\`suggestion block>" \
  -f commit_id="$COMMIT_ID" \
  -f path="<file_path>" \
  -F position=<line_number>

Step 4: Add Summary Comment

Add a general comment explaining:

  • Number of suggestions added
  • How to apply suggestions (individual or batch)
  • What issues will be resolved

Suggestion Types

1. Single-Line Suggestions

Fix access modifier.

\`\`\`suggestion
public sealed class MyClass
\`\`\`

2. Multi-Line Suggestions

Add nullable directive and fix class.

\`\`\`suggestion
#nullable enable

namespace MyNamespace
{
    public sealed class MyClass
    {
        // class body
    }
}
\`\`\`

3. Complete File Replacements

For major refactoring, provide complete fixed file in expandable section:

<details>
<summary>Click to expand: Complete fixed file</summary>

\`\`\`csharp
// entire file content
\`\`\`
</details>

Best Practices

✅ DO:

  1. Use inline suggestions for fixable issues

- Syntax errors, formatting issues - Missing keywords, modifiers - Simple refactoring

  1. Add suggestions at correct line positions

- Use gh pr diff to find exact line numbers - Use position parameter (diff position, not file line number)

  1. Group related changes

- Combine related fixes in one suggestion block - Example: Add #nullable enable + sealed keyword together

  1. Provide context

- Explain WHY the change is needed - Reference coding standards or best practices

  1. Use batch suggestions for multiple fixes

- Tell developer about "Add suggestion to batch" option - Allows applying all suggestions in one commit

❌ DON'T:

  1. Don't suggest changes for non-fixable issues

- Architectural problems requiring discussion - Design pattern changes - Use regular comments for these

  1. Don't create overlapping suggestions

- Each suggestion should apply cleanly - Avoid suggesting same lines multiple times

  1. Don't suggest changes without explanation

- Always include WHY the change is needed - Link to relevant documentation or standards

GitHub API Position Calculation

Important: The position parameter is the diff position, not the file line number.

# Get diff to see positions
gh pr diff <PR_NUMBER> --repo <OWNER/REPO>

# Position starts at 1 for first changed line
# Increments for each line in the diff (context + changes)

Example:

@@ -0,0 +1,10 @@
+namespace MyNamespace    # position: 1
+{                        # position: 2
+    public class Foo     # position: 3
+    {                    # position: 4

Common Review Patterns

Pattern 1: Missing Nullable Directive

Issue: Missing #nullable enable Location: Line 1 (before namespace) Position: Usually 1

Add \`#nullable enable\` directive at the top of the file.

\`\`\`suggestion
#nullable enable

namespace YourNamespace
\`\`\`

Pattern 2: Missing Sealed Keyword

Issue: Class should be sealed Location: Class declaration line Position: Find in diff

Add \`sealed\` keyword to prevent inheritance.

\`\`\`suggestion
    public sealed class YourClass
\`\`\`

Pattern 3: Fields to Properties

Issue: Public fields instead of properties Location: Field declaration lines Position: Find in diff

Convert field to property with getter.

\`\`\`suggestion
        public Dictionary<string, int> MyProperty { get; } = new();
\`\`\`

Pattern 4: Remove Region Comments

Issue: Using #region / #endregion Location: Region block Position: Find in diff

Remove \`#region\` comments - code should be self-organizing.

\`\`\`suggestion
        private readonly UserDataManager userDataManager;

        public MyController(UserDataManager userDataManager)
        {
            this.userDataManager = userDataManager;
        }
\`\`\`

Complete Workflow Example

# 1. Get PR details
PR_NUMBER=984
REPO="The1Studio/TheOneFeature"
COMMIT_ID=$(gh pr view $PR_NUMBER --repo $REPO --json commits --jq '.commits[-1].oid')

# 2. Review code (use theone-unity-standards skill)
# ... analyze code against standards ...

# 3. Add suggestion for file1
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  /repos/$REPO/pulls/$PR_NUMBER/comments \
  -f body="Add \`#nullable enable\` directive.

\`\`\`suggestion
#nullable enable

namespace MyNamespace
\`\`\`" \
  -f commit_id="$COMMIT_ID" \
  -f path="path/to/file1.cs" \
  -F position=1

# 4. Add suggestion for file2
# ... repeat for each issue ...

# 5. Add summary comment
gh pr comment $PR_NUMBER --repo $REPO --body "## ✅ Suggestions Ready

I've added 6 inline suggestions. Go to Files Changed tab and click 'Commit suggestion' on each, or use 'Add suggestion to batch' to apply all at once."

Integration with Other Skills

Works best with:

  • theone-unity-standards - For Unity C# code reviews
  • theone-react-native-standards - For React Native reviews
  • theone-cocos-standards - For Cocos reviews
  • code-review - For internal review practices (receiving feedback)
  • docs-seeker - For finding latest library documentation

Example workflow:

  1. User provides PR URL
  2. Apply general checklists (Review Checklists)
  3. Trigger tech-specific skill (e.g., theone-unity-standards) for detailed analysis
  4. Create inline suggestions using github-pr-review
  5. Submit review decision (APPROVE/REQUEST_CHANGES) per Approval Criteria
  6. Developer applies suggestions via GitHub UI

Review Process

Step 0: Apply Review Checklists

Before diving into code, run through technology-agnostic checklists:

See: Review Checklists

  1. 🔒 Security checklist (secrets, injection, auth)
  2. ✅ Correctness checklist (logic, state, API)
  3. 🧪 Testing checklist (coverage, quality)
  4. 🧹 Quality checklist (structure, DRY)
  5. ⚡ Performance checklist (queries, memory)
  6. 📚 Documentation checklist

Troubleshooting

Issue: "404 Not Found" when creating suggestion

Cause: Wrong position value Fix: Verify position in diff output

gh pr diff <PR> --repo <REPO> | less
# Count lines from @@ hunk header

Issue: Suggestion doesn't show "Commit suggestion" button

Cause: Invalid ```suggestion syntax Fix: Ensure proper markdown formatting:

  • Three backticks
  • Word "suggestion" (lowercase)
  • Proper code indentation inside block

Issue: Suggestion applies but breaks code

Cause: Incorrect indentation or incomplete context Fix:

  • Match existing file indentation exactly
  • Include enough context lines
  • Test suggestion locally first

Summary

This skill automates comprehensive GitHub PR reviews with actionable suggestions:

  1. ✅ Applies technology-agnostic review checklists
  2. ✅ Fetches PR details and diff
  3. ✅ Analyzes code against standards (general + tech-specific)
  4. ✅ Creates inline suggestions with ```suggestion blocks
  5. ✅ Uses GitHub API for programmatic comments
  6. Submits review decision (APPROVE/REQUEST_CHANGES)
  7. ✅ Enables one-click fixes via GitHub UI

Result: Faster, more efficient PR reviews with instant applicability AND clear approval status.

Skill References

ReferencePurpose
Approval CriteriaDecision tree for APPROVE/REQUEST_CHANGES
Review ChecklistsTechnology-agnostic security, quality, performance checklists
API ReferenceGitHub API commands and examples
Workflow ExamplesComplete review workflow examples

ClaudeAssistant Automated Review Service

For The1Studio repositories, you can trigger automated PR reviews via webhook:

Triggering Automated Review

# Simply comment on any PR:
/review

# The webhook will:
# 1. Fetch PR files and diffs
# 2. Run Claude Code review with inline suggestions
# 3. Post review with "Apply suggestion" buttons

How It Works

┌──────────────────────────────────────────────────────────────┐
│  GitHub PR Comment "/review"                                  │
│            ↓                                                  │
│  Webhook → github-review-service (port 16300)                │
│            ↓                                                  │
│  Fetch PR files → Generate prompt with diffs                 │
│            ↓                                                  │
│  claude-service (port 16304) → Claude Code analysis          │
│            ↓                                                  │
│  Post inline comments with ```suggestion blocks              │
│            ↓                                                  │
│  GitHub shows "Apply suggestion" button on each comment      │
└──────────────────────────────────────────────────────────────┘

Inline Suggestions Format

The service generates suggestions in GitHub's format:

🔵 **Suggestion**

Add `sealed` keyword to prevent inheritance.

\`\`\`suggestion
public sealed class MyClass
\`\`\`

**Category:** CodeQuality

Result: Users see "Apply suggestion" button and can commit fixes with one click.

Service Architecture

ServicePortPurpose
github-review-service16300Webhook handler, review orchestration
claude-service16304Claude Code API gateway
postgres16305Review history storage
dashboard16302Monitoring UI

Deduplication

  • Reviews are deduplicated by commit SHA
  • Same commit won't be reviewed twice
  • Merged PRs can trigger but may skip if already reviewed

Manual API Trigger

# If webhook not working, trigger via API:
curl -X POST http://localhost:16300/api/review \
  -H "Content-Type: application/json" \
  -d '{
    "owner": "The1Studio",
    "repo": "YourRepo",
    "prNumber": 123,
    "installationId": 95277005
  }'

External References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

27.92%
按下载量换算39

windsurf

25.86%
按下载量换算36

trae

19.15%
按下载量换算27

OpenCode

11.84%
按下载量换算16

Codex

8.38%
按下载量换算12

Antigravity

3.55%
按下载量换算5

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills