Handle PR review feedback - fetch comments and respond appropriately
Automates addressing PR review feedback by fetching comments, making code changes, and posting in-thread responses. Use this when you need to efficiently handle review cycles without manually switching between GitHub and your editor.
/plugin marketplace add jwilger/claude-code-setup/plugin install sdlc@jwilger-claude-pluginsHandle PR review feedback. This command:
From current branch, find the associated PR:
gh pr view --json number,url,reviewDecision,reviews
If no PR exists:
No PR found for current branch.
Run /sdlc:pr first to create a pull request.
Use the gh-pr-review extension to get all pending review comments:
# Get all unresolved review threads
gh pr-review review view -R <owner>/<repo> --pr <number> --unresolved
# Get threads from a specific reviewer
gh pr-review review view -R <owner>/<repo> --pr <number> \
--reviewer <username> \
--states CHANGES_REQUESTED
This returns a structured view of all inline comments with their thread IDs.
Group comments by:
For each unresolved comment, show:
Display formatted summary:
PR #<number> has <count> pending review comments:
File: src/auth/login.rs
Line 42: @reviewer - "Should we validate email format here?"
Line 89: @reviewer - "Consider using Result instead of Option"
File: src/auth/mod.rs
Line 15: @reviewer - "Missing documentation for public function"
Would you like me to address these comments?
For each comment, the process is:
Use the appropriate agent:
This is critical - replies must be in-thread, not as general comments.
Using gh-pr-review extension:
gh pr-review comments reply \
--thread-id <thread-id> \
--body "<response>" \
-R <owner>/<repo> <pr-number>
The response should:
Example responses:
validator crate. See updated code."Result is clearer here. Updated to return Result<User, AuthError>."Sometimes a review comment doesn't require a code change:
After addressing comments, commit:
git add .
git commit -m "Address review feedback
- <summary of changes>
- Responds to comments from @reviewer"
git push
Request re-review:
gh pr edit <number> --add-reviewer <original-reviewer>
Or using the review request endpoint:
gh api repos/{owner}/{repo}/pulls/<number>/requested_reviewers \
-f reviewers[]="<reviewer>"
Review feedback addressed!
Changes made:
- src/auth/login.rs: Added email validation
- src/auth/login.rs: Changed Option to Result
- src/auth/mod.rs: Added documentation
Responses posted: <count>
Re-review requested from: @<reviewer>
PR: <url>
This command uses the gh-pr-review extension (agynio/gh-pr-review) for:
gh pr-review review viewgh pr-review comments replygh pr-review threads resolveInstall with: gh extension install agynio/gh-pr-review
Add to auto-approval: Bash(gh pr-review:*)