jpskill.com
🛠️ 開発・MCP コミュニティ

github-pr

GitHub PR utilities for code review workflows

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o github-pr.zip https://jpskill.com/download/17530.zip && unzip -o github-pr.zip && rm github-pr.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17530.zip -OutFile "$d\github-pr.zip"; Expand-Archive "$d\github-pr.zip" -DestinationPath $d -Force; ri "$d\github-pr.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して github-pr.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → github-pr フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

概要

GitHub のプルリクエスト操作のための CLI ツールです。自動化されたコードレビューワークフローをサポートするように設計されています。GitHub CLI (gh) がインストールされ、認証されている必要があります。

前提条件

  • bun ランタイムがインストールされていること
  • GitHub CLI がインストールされ、認証されていること
    brew install gh
    gh auth login

コマンド

レビューが必要か確認

さまざまな条件をチェックして、PR をレビューする必要があるかどうかを判断します。

bun .opencode/skill/github-pr/check-review-needed.js [pr-number]

引数:

  • pr-number - PR 番号 (オプション、デフォルトは現在のブランチの PR)

出力: 次の要素を含む JSON オブジェクト:

  • shouldReview - レビューを進めるべきかどうかを示すブール値
  • reason - 決定の理由
  • prNumber - チェックされた PR 番号

チェックされる条件:

  • PR がクローズまたはマージされていない
  • PR がドラフトではない
  • PR が既知のボット (dependabot、renovate など) からのものではない
  • PR のタイトルが自動化を示していない (bump、chore(deps) など)
  • PR がすでに Claude/AI によってレビューされていない
  • PR が些細な変更ではない (変更行数が 2 行以下)

例:

# 現在のブランチの PR をチェック
bun .opencode/skill/github-pr/check-review-needed.js

# 特定の PR をチェック
bun .opencode/skill/github-pr/check-review-needed.js 123

ガイドラインファイルをリスト

PR の変更に関連する AGENTS.md (または CLAUDE.md) ファイルを検索します。

bun .opencode/skill/github-pr/list-guideline-files.js [pr-number] [--json]

引数:

  • pr-number - PR 番号 (オプション、デフォルトは現在のブランチの PR)

オプション:

  • --json - ファイルの内容を含む JSON 配列として出力

検索場所:

  • リポジトリのルート
  • PR で変更されたファイルを含むすべてのディレクトリ
  • 変更されたファイルの親ディレクトリ

優先順位: 同じディレクトリに AGENTS.md と CLAUDE.md の両方が存在する場合、AGENTS.md が優先されます。

例:

# 現在の PR のガイドラインファイルをリスト
bun .opencode/skill/github-pr/list-guideline-files.js

# JSON として完全なコンテンツを取得
bun .opencode/skill/github-pr/list-guideline-files.js 123 --json

JSON 出力形式:

[
  {
    "path": "AGENTS.md",
    "content": "# Project Guidelines\n..."
  },
  {
    "path": "src/components/AGENTS.md",
    "content": "# Component Guidelines\n..."
  }
]

インラインコメントを投稿

PR の特定の行または行範囲にレビューコメントを投稿します。

bun .opencode/skill/github-pr/post-inline-comment.js <pr-number> --path <file> --line <n> --body <text>

引数:

  • pr-number - PR 番号 (PR ブランチにいる場合はオプション)

オプション:

  • --path <file> - コメントするファイルのパス (必須)
  • --line <n> - コメントする行番号 (必須)
  • --start-line <n> - 複数行コメントの開始行 (オプション)
  • --body <text> - コメント本文 (Markdown 形式) (必須)

提案ブロック: 直接コミットできる小さな修正のための提案ブロックを含めます。

Fix the error handling:

```suggestion
try {
  await authenticate();
} catch (e) {
  handleAuthError(e);
}
```

重要: 提案は完全である必要があります。作成者は、他の場所に追加の変更を加える必要なく、[提案をコミット] をクリックできる必要があります。

例:

# 単一行コメント
bun .opencode/skill/github-pr/post-inline-comment.js 123 \
  --path src/auth.ts \
  --line 67 \
  --body "Missing error handling for OAuth callback"

# 複数行コメント (65-70 行)
bun .opencode/skill/github-pr/post-inline-comment.js 123 \
  --path src/auth.ts \
  --line 70 \
  --start-line 65 \
  --body "This authentication block needs refactoring"

gh CLI との統合

これらのツールは GitHub CLI (gh) をラップします。これらのユーティリティでカバーされていない操作については、gh を直接使用してください。

# PR の詳細を表示
gh pr view 123 --json title,body,state,isDraft,files

# PR の差分を取得
gh pr diff 123

# PR のコメントを表示
gh pr view 123 --comments

# 通常のコメントを投稿
gh pr comment 123 --body "Comment text"

# PR head でファイルを表示
gh api repos/{owner}/{repo}/contents/{path}?ref={branch}

出力動作

  • コマンド出力は、ターミナルでユーザーに直接表示されます
  • JSON 出力は、読みやすさとパイプ処理のためにフォーマットされています
  • プログラムで出力を処理する必要がある場合は、--json フラグを使用してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Overview

CLI tools for GitHub pull request operations. Designed to support automated code review workflows. Requires the GitHub CLI (gh) to be installed and authenticated.

Prerequisites

  • bun runtime installed
  • GitHub CLI installed and authenticated
    brew install gh
    gh auth login

Commands

Check Review Needed

Determines if a PR should be reviewed by checking various conditions.

bun .opencode/skill/github-pr/check-review-needed.js [pr-number]

Arguments:

  • pr-number - PR number (optional, defaults to current branch's PR)

Output: JSON object with:

  • shouldReview - boolean indicating if review should proceed
  • reason - explanation for the decision
  • prNumber - the PR number checked

Conditions checked:

  • PR is not closed or merged
  • PR is not a draft
  • PR is not from a known bot (dependabot, renovate, etc.)
  • PR title doesn't indicate automation (bump, chore(deps), etc.)
  • PR has not already been reviewed by Claude/AI
  • PR is not trivial (2 or fewer lines changed)

Examples:

# Check current branch's PR
bun .opencode/skill/github-pr/check-review-needed.js

# Check specific PR
bun .opencode/skill/github-pr/check-review-needed.js 123

List Guideline Files

Finds AGENTS.md (or CLAUDE.md) files relevant to a PR's changes.

bun .opencode/skill/github-pr/list-guideline-files.js [pr-number] [--json]

Arguments:

  • pr-number - PR number (optional, defaults to current branch's PR)

Options:

  • --json - Output as JSON array with file contents

Search locations:

  • Repository root
  • All directories containing files modified in the PR
  • Parent directories of modified files

Priority: If both AGENTS.md and CLAUDE.md exist in the same directory, AGENTS.md takes precedence.

Examples:

# List guideline files for current PR
bun .opencode/skill/github-pr/list-guideline-files.js

# Get full content as JSON
bun .opencode/skill/github-pr/list-guideline-files.js 123 --json

JSON Output Format:

[
  {
    "path": "AGENTS.md",
    "content": "# Project Guidelines\n..."
  },
  {
    "path": "src/components/AGENTS.md",
    "content": "# Component Guidelines\n..."
  }
]

Post Inline Comment

Posts a review comment on a specific line or line range in a PR.

bun .opencode/skill/github-pr/post-inline-comment.js <pr-number> --path <file> --line <n> --body <text>

Arguments:

  • pr-number - PR number (optional if on a PR branch)

Options:

  • --path <file> - File path to comment on (required)
  • --line <n> - Line number to comment on (required)
  • --start-line <n> - Start line for multi-line comments (optional)
  • --body <text> - Comment body in markdown (required)

Suggestion blocks: Include a suggestion block for small fixes that can be committed directly:

Fix the error handling:

```suggestion
try {
  await authenticate();
} catch (e) {
  handleAuthError(e);
}
```

Important: Suggestions must be complete. The author should be able to click "Commit suggestion" without needing additional changes elsewhere.

Examples:

# Single line comment
bun .opencode/skill/github-pr/post-inline-comment.js 123 \
  --path src/auth.ts \
  --line 67 \
  --body "Missing error handling for OAuth callback"

# Multi-line comment (lines 65-70)
bun .opencode/skill/github-pr/post-inline-comment.js 123 \
  --path src/auth.ts \
  --line 70 \
  --start-line 65 \
  --body "This authentication block needs refactoring"

Integration with gh CLI

These tools wrap the GitHub CLI (gh). For operations not covered by these utilities, use gh directly:

# View PR details
gh pr view 123 --json title,body,state,isDraft,files

# Get PR diff
gh pr diff 123

# View PR comments
gh pr view 123 --comments

# Post a regular comment
gh pr comment 123 --body "Comment text"

# View file at PR head
gh api repos/{owner}/{repo}/contents/{path}?ref={branch}

Output Behavior

  • Command output is displayed directly to the user in the terminal
  • JSON output is formatted for readability and piping
  • Use --json flag when you need to process output programmatically