/git-tools:gh-pr-reviewfrom git-tools
GitHub PR review operations via gh CLI. Create pending reviews with line comments, submit reviews (approve/reject/comment). Use when adding PR comments, submitting reviews, or managing GitHub code reviews.
Ships in git-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create and manage GitHub PR reviews with line-specific comments using the gh CLI.
# Get PR info for current branch
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/pr-info.sh"
# Create a pending review with line comments
echo '{"pr_number":123,"summary":"Review summary","comments":[{"path":"src/app.ts","line":42,"body":"Fix this issue"}]}' | "${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/create-review.sh"
# Submit a pending review
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/submit-review.sh" 123 456789 COMMENT "Please address the comments"
Get PR context information.
# Auto-detect PR from current branch
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/pr-info.sh"
# Get info for specific PR
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/pr-info.sh" 123
Output:
{
"pr_number": 123,
"repo": "owner/repo",
"url": "https://github.com/owner/repo/pull/123",
"files": ["src/app.ts", "src/utils.ts"]
}
Create a pending review with line comments. The review is NOT submitted - user must submit manually.
echo '$JSON' | "${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/create-review.sh"
Input JSON:
{
"pr_number": 123,
"summary": "Overall review summary (optional)",
"comments": [
{
"path": "src/app.ts",
"line": 42,
"body": "**Critical:** Missing null check"
},
{
"path": "src/utils.ts",
"start_line": 15,
"line": 20,
"body": "**Suggestion:** Extract this block to a helper function"
}
]
}
Comment Fields:
| Field | Required | Description |
|---|---|---|
path | Yes | Relative file path in the repository |
line | Yes | Line number (end line for multi-line comments) |
body | Yes | Comment text (markdown supported) |
side | No | RIGHT (additions/context, default) or LEFT (deletions) |
start_line | No | First line for multi-line comments (must be < line) |
start_side | No | Side for start_line (defaults to match side) |
Single-line comment: Use path, line, body
Multi-line comment: Add start_line (and optionally start_side)
Output:
{
"review_id": 456789,
"url": "https://github.com/owner/repo/pull/123#pullrequestreview-456789",
"comment_count": 1,
"status": "PENDING"
}
Submit a pending review with an event type.
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/submit-review.sh" <pr_number> <review_id> <event> [body]
Events:
APPROVE - Approve the PRREQUEST_CHANGES - Request changes before mergeCOMMENT - Leave feedback without approval/rejectionExample:
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/submit-review.sh" 123 456789 REQUEST_CHANGES "Please address the inline comments"
For code review comments, use this format for clarity:
**[Severity]:** Brief description
**Why:** Explanation of the issue
**Fix:** Suggested solution or code example
Severity levels:
Scripts return JSON errors:
{
"error": true,
"message": "gh CLI not authenticated. Run 'gh auth login' first.",
"code": "AUTH_REQUIRED"
}
Error codes:
AUTH_REQUIRED - Run gh auth loginNO_PR - No PR found for current branchAPI_ERROR - GitHub API error (check message)INVALID_INPUT - Invalid JSON inputGet PR info:
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/pr-info.sh"
Review the code using the JSON tool result and collect findings. Run the helper directly rather than through command substitution, which can require separate shell approval.
Create pending review:
echo '{"pr_number":123,"comments":[...]}' | "${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/create-review.sh"
User reviews comments on GitHub and edits if needed
User submits review via GitHub UI or:
"${CLAUDE_PLUGIN_ROOT}/skills/gh-pr-review/scripts/submit-review.sh" 123 $REVIEW_ID COMMENT
gh CLI installed and authenticated (gh auth login)jq for JSON processingWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/gh-address-commentsAddress review/issue comments on the open GitHub PR for the current branch. Fetches all comments and review threads, summarizes what needs attention, and helps apply fixes. Use when responding to PR feedback, resolving review comments, or when user mentions "address comments" or "fix review feedback"./git-advancedAdvanced git operations (rebase, cherry-pick, reflog, stash, reset, clean), analysis tools (bisect, blame, history), and command reference. Use for complex git tasks, recovery operations, or when user mentions rebase, cherry-pick, reflog, stash, reset, bisect, or needs git command reference./git-commitsnpx claudepluginhub nilpath/nilpath-marketplace --plugin git-tools