github-pr-review
БесплатноБез исполняемых скриптовНе проверенUse when reviewing GitHub pull requests with gh CLI - creates pending reviews with code suggestions, batches comments, and chooses appropriate event types…
Об этом скилле
GitHub PR Review
Overview
Workflow for reviewing GitHub pull requests using gh api to create pending reviews with code suggestions. Always use pending reviews to batch comments, even under time pressure.
CRITICAL: Always get explicit user approval before posting any review comments. Show exactly what will be posted and ask for yes/no confirmation using AskUserQuestion.
When to Use
- Reviewing pull requests
- Adding code suggestions to PRs
- Posting review comments with the gh CLI
Prerequisites
CRITICAL: Check if gh CLI is installed before attempting to use this skill.
Check for gh CLI
Before starting any PR review workflow, verify the gh CLI is available:
gh --version
If gh is not installed:
- Stop immediately - Do not attempt to run gh api commands
- Inform the user with this message:
The GitHub CLI (gh) is required for this skill but is not installed.
Please install it from: https://cli.github.com/
Installation options:
- macOS: brew install gh
- Windows: winget install GitHub.cli
- Linux: See https://cli.github.com/ for your distro
After installing, authenticate with:
gh auth login
Then try your PR review request again.
- Do not proceed with the review workflow until gh is installed
After Installation
Once gh is installed, users must authenticate:
gh auth login
Core Workflow
REQUIRED STEPS (do not skip):
- Check gh CLI is installed - Run
gh --versionto verify - Draft the review - Analyze PR and prepare all comments
- Show user exactly what will be posted - Use AskUserQuestion with yes/no
- Get explicit approval - Wait for user confirmation
- Post the review - Only after approval
Approval Pattern
Before posting ANY review, use AskUserQuestion to show:
- File and line number for each comment
- Exact comment text (including code suggestions)
- Event type (APPROVE/REQUEST_CHANGES/COMMENT)
- Overall review message
Example:
Question: "Ready to post this review?"
Header: "PR Review"
Options:
- Yes, post it: Posts the review as shown
- No, let me revise: Allows refinement
Technical Workflow
ALWAYS use the pending review pattern, even for single comments:
# Step 1: Create PENDING review (no event field)
gh api repos/:owner/:repo/pulls/<PR_NUMBER>/reviews \
-X POST \
-f commit_id="<COMMIT_SHA>" \
-f 'comments[][path]=path/to/file.ts' \
-F 'comments[][line]=<LINE_NUMBER>' \
-f 'comments[][side]=RIGHT' \
-f 'comments[][body]=Comment text
```suggestion
// suggested code here
Additional explanation...'
--jq '{id, state}'
Returns: {"id": , "state": "PENDING"}
Step 2: Submit the pending review
gh api repos/:owner/:repo/pulls/
-X POST
-f event="COMMENT"
-f body="Optional overall review message"
## Event Types
Choose the appropriate event type when submitting:
| Event Type | When to Use | Example Situations |
|------------|-------------|-------------------|
| `APPROVE` | Non-blocking suggestions, PR is ready to merge | Minor style improvements, optional refactoring |
| `REQUEST_CHANGES` | Blocking issues that must be fixed | Security vulnerabilities, bugs, failing tests |
| `COMMENT` | Neutral feedback, questions | Asking for clarification, neutral observations |
## Quick Reference
### Getting Prerequisites
```bash
# Get commit SHA
gh pr view <PR_NUMBER> --json commits --jq '.commits[-1].oid'
# Repository info (usually auto-detected by gh)
gh repo view --json owner,name
Required Parameters
commit_id: Latest commit SHA from the PRcomments[][path]: File path relative to repo rootcomments[][line]: End line number (use-Ffor numbers)comments[][side]: UseRIGHTfor added/modified lines (most common),LEFTfor deleted linescomments[][body]: Comment text with optional ```suggestion block
Optional Parameters
comments[][start_line]: For multi-line code suggestions (use-F)event: Omit for PENDING, or useCOMMENT/APPROVE/REQUEST_CHANGES
Syntax Rules
✅ DO:
- Use single quotes around parameters with
[]:'comments[][path]' - Use
-ffor string values - Use
-Ffor numeric values (line numbers) - Use triple backticks with
suggestionidentifier for code suggestions
❌ DON'T:
- Use double quotes around
comments[][]parameters - Mix up
-fand-Fflags - Forget to get commit SHA first
Code Suggestions Format
-f 'comments[][body]=Your comment explaining the issue
```suggestion
// The suggested code that will replace the specified line(s)
const fixed = "like this";
Additional context or explanation after the suggestion.'
**Important**: Code suggestions replace the entire line or line range. Make sure the suggested code is complete and correct.
### Edge Case: Suggestions with Nested Code Blocks
When suggesting changes to markdown files or document
Установить github-pr-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
AskUserQuestionFAQ
Что делает скилл github-pr-review?
Use when reviewing GitHub pull requests with gh CLI - creates pending reviews with code suggestions, batches comments, and chooses appropriate event types (COMMENT/APPROVE/REQUEST_CHANGES)
Как установить скилл github-pr-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл github-pr-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic