From github-pr-comment-reviewer
GitHub pull request review and resolution skill. Systematically reviews PR comments, analyzes code, applies fixes, commits changes, and replies to review threads. Use when reviewing PR comments, resolving PR feedback, addressing code review suggestions, or when user provides PR URLs. Prefer this skill when doing any review of PR comments.
How this skill is triggered — by the user, by Claude, or both
Slash command
/github-pr-comment-reviewer:github-pr-comment-reviewerThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill helps systematically review and resolve GitHub pull request comments. It supports two workflows:
scripts/common.shscripts/get-comment-thread.shscripts/get-single-comment.shscripts/list-comment-ids.shscripts/list-threads-for-classification.shscripts/queries/find_thread_by_comment.graphqlscripts/queries/get_comment_thread.graphqlscripts/queries/list_comment_ids.graphqlscripts/queries/list_threads_for_classification.graphqlscripts/reply-to-comment.shThis skill helps systematically review and resolve GitHub pull request comments. It supports two workflows:
The skill handles the complete review cycle: analyzing feedback, reading code, applying fixes, committing changes, and replying to reviewers.
Activate this skill when:
#discussion_r123456)gh) must be installed and authenticatedjq must be installed for JSON processingUse Workflow 1: Review All Unresolved Comments
Example: https://github.com/owner/repo/pull/123
Use Workflow 2: Review Single Comment
Example formats:
https://github.com/owner/repo/pull/123#discussion_r456789https://github.com/owner/repo/pull/123/files#r456789https://github.com/owner/repo/pull/123/changes#r456789This workflow loads all unresolved threads, classifies them, presents an upfront summary for user approval, then executes — only pausing on items the user flagged.
Extract the owner, repository, and PR number from the user's input.
https://github.com/{owner}/{repo}/pull/{pr_number}Execute the classification script to get thread data (bodies, paths, lines, authors — but no diffHunks):
bash ${CLAUDE_SKILL_DIR}/scripts/list-threads-for-classification.sh "https://github.com/{owner}/{repo}/pull/{pr_number}"
This returns a JSON array of thread objects with full comment bodies and metadata — enough to classify each thread without fetching diffHunks.
Read the comment bodies, file paths, and conversation context for every thread. Classify each into one of two tiers:
Threads where the action is straightforward and low-risk:
Threads where the user should weigh in before you proceed:
Present a single summary of all threads with their classifications. For each thread, show:
https://github.com/owner/repo/pull/123#discussion_r456789). Do not use markdown link syntax like [link](url) — render the bare URL so it's clickable in terminal UIs that don't parse markdown.auto-fix, dismiss, or needs confirmationExample format:
## PR Review Plan — 8 threads
### Auto-proceed (5 threads)
| # | Thread | Author | File | Concern | Action |
|---|--------|--------|------|---------|--------|
| 1 | https://github.com/owner/repo/pull/123#discussion_r111 | reviewer1 | src/foo.ts:42 | Typo in comment | Fix: correct spelling |
| 2 | https://github.com/owner/repo/pull/123#discussion_r222 | reviewer2 | src/bar.ts:15 | Unused import | Fix: remove import |
| 3 | https://github.com/owner/repo/pull/123#discussion_r333 | reviewer1 | src/baz.ts:88 | Suggestion doesn't apply | Dismiss: already handled by validation on L72 |
### Needs confirmation (3 threads)
| # | Thread | Author | File | Concern | Why |
|---|--------|--------|------|---------|-----|
| 4 | https://github.com/owner/repo/pull/123#discussion_r444 | reviewer1 | src/auth.ts:30 | Token validation logic | Security-relevant change |
| 5 | https://github.com/owner/repo/pull/123#discussion_r555 | reviewer2 | src/api.ts:112 | Change return type | Public API change |
| 6 | https://github.com/owner/repo/pull/123#discussion_r666 | reviewer1 | src/core.ts:55 | Refactor loop structure | Logic change spanning 40+ lines |
Then pause once and ask:
"This is my plan for the PR review. Auto-proceed items will be fixed or dismissed without stopping. Each needs-confirmation item will be a hard stop — I'll present the concrete plan for that thread and wait for your explicit approval before touching any code. You can:
- Promote any auto-proceed item to needs-confirmation (e.g., 'confirm #2')
- Demote any needs-confirmation item to auto-proceed (e.g., 'auto #5')
- Say go to start execution as planned
- Say confirm all to pause on every item
- Say auto all to proceed through everything without pausing"
Wait for the user's response before continuing.
Reminder: Once execution starts, every needs-confirmation thread MUST trigger a pause per step 5.2 — the classification is a promise to the user, not a preference. Do not reclassify threads mid-execution to avoid pausing.
Process threads one at a time, in order. For each thread, follow 5.1 → 5.5 completely before starting the next thread. Never batch code changes across threads — each thread's fix is implemented and committed separately.
Important — push and reply are deferred: During Step 5, commit locally but do NOT push, and do NOT post replies. Keep a running tracker of thread → (commit hash, planned reply text) pairs as you work. All pushes and all replies happen together in Step 6 after every thread has been processed. This keeps CI runs to a single build instead of N, and avoids stale commit-hash citations if a later commit amends or reorders things.
Fetch the complete thread data including diffHunks:
bash ${CLAUDE_SKILL_DIR}/scripts/get-comment-thread.sh "THREAD_ID"
Before doing any work on this thread, check its classification from the upfront plan:
Auto-proceed items: continue to step 5.3.
Needs-confirmation items (including items the user promoted, or ALL items if the user said "confirm all"): STOP HERE. You MAY read the code to form a concrete plan, but do NOT make changes, stage anything, or commit. Present this to the user and wait for explicit approval:
## Thread #N — Needs Confirmation
**Thread**: [fully-qualified URL]
**Author**: [name]
**File**: [path:line]
**Concern**: [summary]
**Current Code**:
[code snippet from diffHunk or current file]
**My Plan**: [concrete description of what you intend to change]
Proceed with this fix?
Wait for the user's explicit response (e.g., "yes", "go", "proceed", or instructions to modify the plan). If they say no or give new direction, adjust and re-confirm. Do NOT continue to step 5.3 until you have explicit approval for THIS thread.
If the user said "stop" or "pause" at any earlier point, respect that and wait.
Do not rationalize your way past this checkpoint. The whole purpose of the upfront classification is to identify threads where the user wants input. Skipping this pause defeats the entire workflow.
path, line, diffHunk)If fixing — default to one commit per thread:
git add <specific files>, never git add . or git add -A)git rev-parse --short HEAD and record it in your thread tracker alongside the planned reply text — commit hashes are stable locally and the same hash will be present on the remote after Step 6's push🚫 Do NOT batch commits across threads as a default. The default is always one commit per thread. Do not accumulate unrelated fixes and commit them together.
Narrow exception — genuinely-shared fix across threads: If two (or more) threads describe the same underlying issue and the fix is literally the same change (not "similar" — the same), you may make a judgment call to combine them into a single commit. Legitimate cases:
When you combine threads into one commit:
If you are unsure whether two threads qualify for combining, commit them separately — that is always safe.
If dismissing: No code changes needed. Record the planned dismissal reply in your tracker and move on to the next thread.
Return to step 5.1 for the next thread. At this point you have a local commit (if fixing) and a planned reply, but nothing has been pushed or posted yet.
After all threads in Step 5 have been processed (all needs-confirmation pauses resolved, all fixes committed locally, all dismissals recorded):
git log --oneline origin/<branch>..HEAD (or git status) to confirm your local commits match the tracker.git push
A single push triggers a single CI run for all the review fixes — the reason replies are deferred. If the push fails (e.g., remote has new commits), resolve the conflict and retry; do not post replies until the push succeeds, since the commit hashes must be reachable on the remote for reviewers to follow them.
For each thread in the tracker, post its reply using the recorded commit hash (or dismissal reasoning):
bash ${CLAUDE_SKILL_DIR}/scripts/reply-to-comment.sh "THREAD_ID" "YOUR_REPLY_MESSAGE"
If fixed, use this reply format:
Fixed in commit {commit_sha}. {description_of_fix}
Addressed the concern about {original_issue}.
🤖 Generated with Claude Code
ALWAYS include the commit hash from the tracker — the commit that contains THIS thread's fix. For combined threads, the same hash appears in multiple replies and each reply notes the other thread's URL.
If dismissed, use this reply format:
Evaluated this suggestion. {reasoning_for_not_implementing}
🤖 Generated with Claude Code
If a reply fails to post, retry that specific reply; do not re-push or re-commit.
After all threads are processed, present a consolidated summary:
## PR Review Complete — 8 threads processed
### Fixed (4 threads)
| # | Thread | File | Change | Commit |
|---|--------|------|--------|--------|
| 1 | https://github.com/owner/repo/pull/123#discussion_r111 | src/foo.ts:42 | Corrected typo | abc1234 |
| 2 | https://github.com/owner/repo/pull/123#discussion_r222 | src/bar.ts:15 | Removed unused import | def5678 |
| 4 | https://github.com/owner/repo/pull/123#discussion_r444 | src/auth.ts:30 | Updated token validation | ghi9012 |
| 5 | https://github.com/owner/repo/pull/123#discussion_r555 | src/api.ts:112 | Changed return type | jkl3456 |
### Dismissed (2 threads)
| # | Thread | File | Concern | Reason |
|---|--------|------|---------|--------|
| 3 | https://github.com/owner/repo/pull/123#discussion_r333 | src/baz.ts:88 | Suggestion doesn't apply | Already handled by validation on L72 |
| 6 | https://github.com/owner/repo/pull/123#discussion_r666 | src/core.ts:55 | Refactor loop | Current structure is clearer for this case |
### Skipped (0 threads)
(none)
Every thread row MUST include the fully-qualified GitHub URL as bare text (not markdown link syntax). CLI terminals auto-linkify raw URLs but don't render [text](url) as clickable.
This workflow addresses a specific PR comment identified by URL.
Extract the owner, repository, PR number, and comment ID from the user's input.
Supported URL formats:
https://github.com/{owner}/{repo}/pull/{pr_number}#discussion_r{comment_id}https://github.com/{owner}/{repo}/pull/{pr_number}/files#r{comment_id}https://github.com/{owner}/{repo}/pull/{pr_number}/changes#r{comment_id}Execute the get-single-comment script:
bash ${CLAUDE_SKILL_DIR}/scripts/get-single-comment.sh "https://github.com/{owner}/{repo}/pull/{pr_number}#discussion_r{comment_id}"
This returns the complete comment thread data for the specific comment.
Process the comment response to understand the feedback:
Post a summary of the comment including:
Based on the comment analysis:
Fix the Issue
Commit and Push
Execute the reply-to-comment script using the thread ID from the comment data:
bash ${CLAUDE_SKILL_DIR}/scripts/reply-to-comment.sh "THREAD_ID_FROM_GET_SINGLE_COMMENT_RESPONSE" "YOUR_REPLY_MESSAGE"
ALWAYS include the commit hash of the fix if a fix was made.
If fixed, use this reply format:
Fixed in commit {commit_sha}. {description_of_fix}
Addressed the concern about {original_issue}.
🤖 Generated with Claude Code
Example:
Fixed in commit 2b36629. The redundant existence check has been removed since main() already validates the metadata file.
This addresses the performance concern about duplicate validation.
🤖 Generated with Claude Code
Push changes so the user can visually see them in the GitHub UI right away.
After completing work on this comment, you MUST:
Provide a summary of what was done:
Explicitly ask the user to verify the work using clear language like:
Wait for user confirmation before marking this task as complete
Even for single comments, always pause for user verification before considering the work finished.
When analyzing comment threads:
When implementing fixes:
Follow these git practices:
git add <file>, never git add . or git add -A)git rev-parse --short HEAD immediately after committing, and record it in your thread tracker. The hash is stable — the same value will be on the remote after Step 6's push.Reply guidelines:
🤖 Generated with Claude Code[text](url) markdown syntax) — CLI terminals auto-linkify raw URLs but don't render markdown linksIf scripts cannot be found, ensure you're using the ${CLAUDE_SKILL_DIR} variable:
bash ${CLAUDE_SKILL_DIR}/scripts/SCRIPT_NAME.sh
If gh commands fail, check authentication:
gh auth status
Ensure URLs match one of these formats:
https://github.com/owner/repo/pull/123https://github.com/owner/repo/pull/123#discussion_r456789https://github.com/owner/repo/pull/123/files#r456789https://github.com/owner/repo/pull/123/changes#r456789If no threads are returned, all comments may already be resolved. Verify on GitHub.
All scripts are located in ${CLAUDE_SKILL_DIR}/scripts/:
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub collinpeters/collin-claude-skills --plugin github-pr-comment-reviewer