From claude-code-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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-tools:gh-pr-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create and manage GitHub PR reviews with line-specific comments using the `gh` CLI.
Create and manage GitHub PR reviews with line-specific comments using the gh CLI.
# Get PR info for current branch
${SKILL_DIR}/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"}]}' | ${SKILL_DIR}/scripts/create-review.sh
# Submit a pending review
${SKILL_DIR}/scripts/submit-review.sh 123 456789 COMMENT "Please address the comments"
Get PR context information.
# Auto-detect PR from current branch
${SKILL_DIR}/scripts/pr-info.sh
# Get info for specific PR
${SKILL_DIR}/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' | ${SKILL_DIR}/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.
${SKILL_DIR}/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:
${SKILL_DIR}/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:
PR_INFO=$(${SKILL_DIR}/scripts/pr-info.sh)
Review the code and collect findings
Create pending review:
echo '{"pr_number":123,"comments":[...]}' | ${SKILL_DIR}/scripts/create-review.sh
User reviews comments on GitHub and edits if needed
User submits review via GitHub UI or:
${SKILL_DIR}/scripts/submit-review.sh 123 $REVIEW_ID COMMENT
gh CLI installed and authenticated (gh auth login)jq for JSON processingnpx claudepluginhub nilpath/nilpath-marketplace --plugin claude-code-toolsPosts code review findings as line-bound PR comments via the GitHub CLI. Maps issues to specific lines and supports severity filtering.
Fetches and addresses GitHub PR review/issue comments on current branch using gh CLI. Lists threads via script, summarizes fixes, applies user-selected changes, with auth handling.
Fetches GitHub PR review comments via gh CLI, inventories by file/line/author, addresses each with code fixes, runs tests, commits referencing PR, pushes, and reports resolutions.