review-github-pr
GitHubのプルリクエストをレビューし、改善提案をコメントとして投稿、必要に応じて承認または変更リクエストを添えて、コード品質向上に貢献するSkill。
📜 元の英語説明(参考)
Review a PR and submit suggestions as comments, along with an optional approval/request for changes.
🇯🇵 日本人クリエイター向け解説
GitHubのプルリクエストをレビューし、改善提案をコメントとして投稿、必要に応じて承認または変更リクエストを添えて、コード品質向上に貢献するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o review-github-pr.zip https://jpskill.com/download/10037.zip && unzip -o review-github-pr.zip && rm review-github-pr.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10037.zip -OutFile "$d\review-github-pr.zip"; Expand-Archive "$d\review-github-pr.zip" -DestinationPath $d -Force; ri "$d\review-github-pr.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
review-github-pr.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
review-github-prフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
読み取り専用: いかなるファイルも変更しないでください。あなたの仕事は、GitHub でレビュー、報告、フィードバックを送信することです。ローカルでの変更は行わないでください。
続行する前に、前提条件を確認してください:
gh auth statusを実行して、GitHub CLI が認証されていることを確認します。認証されていない場合は、停止してgh auth loginを実行するようにユーザーに指示してください。- レビューする PR または diff があることを確認します。不明な場合は、続行する前にユーザーにレビュー対象を尋ねてください。
手順
GitHub のプルリクエストをレビューし、優先順位付けされたインラインコメントを生成し、それらをまとめてレビューとして送信します。
使用場面: GitHub PR のレビュー、評価、批判、監査、または査定を行う場合。「この PR をレビューして」、「PR #123 をレビューして」、またはレビューする PR の URL が指定された場合などにトリガーされます。
GitHub とのすべてのやり取りは、gh CLI ツールを使用する必要があります。 curl、直接的な API URL、またはウェブフェッチは使用しないでください。常に gh pr、gh api、またはその他の gh サブコマンドを使用してください。
1. PR の diff を取得する
gh CLI を使用して、完全な diff と PR メタデータを取得します。
gh pr view <PR> --json number,title,body,baseRefName,headRefName
gh pr diff <PR>
ユーザーが URL を提供した場合は、そこからリポジトリと PR 番号を抽出します。プライベートリポジトリの場合は、URL を直接フェッチするのではなく、常に gh CLI を使用してください。
2. diff 全体を分析する
- 個々のチャンクだけでなく、完全な diff を読んでください。変更の全範囲を理解してください。
- 複数のファイルにわたる変更が互いいにどのように関連しているかを検討してください。
- 正確性、セキュリティ、パフォーマンス、可読性、および保守性を確認してください。
- お世辞や「LGTM」スタイルのコメントなど、無駄なものは含めないでください。 実行可能な発見事項 (重大な問題 (P0/P1) と些細な問題 (P2/P3)) のみを含めてください。すべてのコメントは、特定の問題または具体的な提案を指摘する必要があります。「良い変更だ」と指摘したり、作者を褒めたりするだけのコメントは実行可能ではありません。完全に省略してください。
3. 優先順位付けされたコメントを生成する
すべての発見事項を優先度レベルに整理します。
- P0 — 阻止: バグ、セキュリティ脆弱性、データ損失のリスク、機能の破損。これらはマージする前に修正する必要があります。
- P1 — 重要: ロジックエラー、欠落しているエッジケース、不適切なエラー処理、テストのギャップ。修正することを強くお勧めします。
- P2 — 提案: コードスタイルの改善、より良い命名、マイナーなリファクタリング、ドキュメントのギャップ。
- P3 — 些細なこと: 些細なスタイルの好み、オプションの改善、マイナーな観察。
最終決定する前に、すべての発見事項 (P3 の些細なことを含む) を確認し、それぞれを含める価値があるかどうかを慎重に判断してください。些細なことを黙って削除しないでください。含めるか、検討したが省略したことを明記してください。フィードバックを質問として組み立てるようにしてください。
送信する前に、優先度でグループ化およびソートされたコメントの完全なリストをユーザーに提示してください。 各コメントには、以下を含める必要があります。
- 以下のステップ 4 で使用されるフィードバックのインデックス。
- 優先度レベル (P0/P1/P2/P3)。
- ファイルパスと行番号。
- コメントテキスト。
4. レビューの処理方法を尋ねる
すべてのフィードバックを送信するか、一部のみを送信するか、およびレビューをどのように送信するかをユーザーに尋ねます。
- 承認 — コメント付きで PR を承認します。
- 変更をリクエスト — 変更をリクエストします (P0 または P1 の項目がある場合に適切です)。
- コメント — 承認または変更のリクエストなしでコメントを送信します。
ユーザーは、インデックス (パート 3 で提供) によって特定のフィードバックの送信をスキップできます。
5. 単一のバッチレビューとして送信する
JSON ペイロードを作成し、gh api と --input を使用して、すべてのコメントを単一のレビューとして送信します。
echo '<json_payload>' | gh api repos/{owner}/{repo}/pulls/{number}/reviews --method POST --input -
JSON ペイロードの形式:
{
"event": "APPROVE|REQUEST_CHANGES|COMMENT",
"body": "",
"comments": [
{
"path": "relative/file/path.ext",
"line": 42,
"side": "RIGHT",
"body": "**[P0]** Comment text here"
}
]
}
すべてのコメント本文は、必ず優先度を太字のプレフィックスで始める必要があります: **[P0]**、**[P1]**、**[P2]**、または **[P3]**。
レビューの本文/概要については、空 ("body": "") にしてください。概要、優先度数 (例: "1 P1, 3 P2")、無駄なもの、埋め合わせ、または賛辞を含めないでください。すべてのフィードバックは、インラインコメントのみに含める必要があります。
重要 — position ではなく、line と side を使用してください:
line: ファイルの新しいバージョンにおけるファイルの行番号 (diff ハンクヘッダーの+の後に表示される番号。たとえば、@@ -45,15 +47,30 @@は、新しい行が 47 から始まることを意味します)。ハンクの開始から正しい行番号を見つけるために、新しい側の行 (コンテキスト行と+行、-行はスキップ) を数えます。side: 新しい/変更された行のコメントの場合は、常に"RIGHT"。- 非推奨の
positionフィールドは使用しないでください — これは diff ハンク内の行のオフセットを指し、マルチハンクファイルではエラーが発生しやすくなります。
完了したら、レビュー URL をユーザーに返します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Read-only: Do not modify any files. Your job is to review, report, and submit feedback on GitHub. Do not to make local changes.
Before proceeding, verify prerequisites:
- Run
gh auth statusto confirm GitHub CLI is authenticated. If not, stop and tell the user to rungh auth login. - Confirm you have a PR or diff to review. If unclear, ask the user what to review before proceeding.
Instructions
Review a GitHub pull request, generate prioritized inline comments, and submit them as a batch review.
Use when: reviewing, evaluating, critiquing, auditing, or assessing a GitHub PR. Triggers on requests like "review this PR", "review PR #123", or when given a PR URL to review.
All GitHub interactions must use the gh CLI tool. Do not use curl, direct API URLs, or web fetching. Always use gh pr, gh api, or other gh subcommands.
1. Fetch the PR diff
Use gh CLI to get the full diff and PR metadata:
gh pr view <PR> --json number,title,body,baseRefName,headRefName
gh pr diff <PR>
If the user provides a URL, extract the repo and PR number from it. For private repos, always use gh CLI rather than fetching URLs directly.
2. Analyze the entire diff
- Read the complete diff, not just individual chunks. Understand the full scope of changes.
- Consider how changes across multiple files relate to each other.
- Check for correctness, security, performance, readability, and maintainability.
- Do not include fluff, praise, or "LGTM"-style commentary. Only include actionable findings: critical issues (P0/P1) and nits (P2/P3). Every comment must point to a specific problem or concrete suggestion. Comments that merely note something is "a good change" or compliment the author are not actionable — omit them entirely.
3. Generate prioritized comments
Organize all findings into priority levels:
- P0 — Blocking: Bugs, security vulnerabilities, data loss risks, broken functionality. These must be fixed before merge.
- P1 — Important: Logic errors, missing edge cases, poor error handling, test gaps. Strongly recommended to fix.
- P2 — Suggestion: Code style improvements, better naming, minor refactors, documentation gaps.
- P3 — Nit: Trivial style preferences, optional improvements, minor observations.
Before finalizing, review all findings — including P3 nits — and deliberately decide whether each is worth including. Do not silently drop nits; either include them or note that they were considered and omitted. Try to frame feedback as questions.
Present the full list of comments to the user, grouped and sorted by priority, before submitting. Each comment should include:
- An index of the feedback to be used in step 4 below.
- Priority level (P0/P1/P2/P3).
- File path and line number.
- The comment text.
4. Ask for review disposition
Ask the user if they want to submit all feedback, or just some, and how they want to submit the review:
- Approve — approve the PR with the comments.
- Request changes — request changes (appropriate when there are P0 or P1 items).
- Comment — submit comments without approving or requesting changes.
The user may skip submitting certain feedback by index (provided in part 3).
5. Submit as a single batch review
Construct a JSON payload and submit all comments as a single review using gh api with --input:
echo '<json_payload>' | gh api repos/{owner}/{repo}/pulls/{number}/reviews --method POST --input -
JSON payload format:
{
"event": "APPROVE|REQUEST_CHANGES|COMMENT",
"body": "",
"comments": [
{
"path": "relative/file/path.ext",
"line": 42,
"side": "RIGHT",
"body": "**[P0]** Comment text here"
}
]
}
Every comment body must start with the priority as a bold prefix: **[P0]**, **[P1]**, **[P2]**, or **[P3]**.
For the review body/summary, leave it empty ("body": ""). Do not include summaries, priority counts (e.g. "1 P1, 3 P2"), fluff, filler, or praise. All feedback belongs in inline comments only.
Important — use line and side, NOT position:
line: The file line number in the new version of the file (the number shown after+in the diff hunk header, e.g.@@ -45,15 +47,30 @@means new lines start at 47). Count new-side lines (context lines and+lines, skipping-lines) from the hunk start to find the correct line number.side: Always"RIGHT"for comments on new/changed lines.- Do not use the deprecated
positionfield — it refers to a line's offset within the diff hunk and is error-prone across multi-hunk files.
Return the review URL to the user when complete.