PR Review Response
pr-review-response
Extract and respond to comments from a GitHub Pull Request. Use this skill when given a GitHub PR URL to review comments and act on the feedback, or when asked to address PR review feedback.
SKILL.md
Full skill instructions
PR Review Response
This skill helps you extract comments from a GitHub Pull Request and act on the feedback.
Input
Accept a GitHub PR URL in the format: https://github.com/{owner}/{repo}/pull/{number}
Parse the URL to extract:
owner: Repository ownerrepo: Repository namenumber: PR number
Extracting Comments
Use the gh CLI to fetch all types of PR comments:
1. Review Comments (inline comments on code)
gh api repos/{owner}/{repo}/pulls/{number}/comments
These comments include:
path: File path the comment referenceslineororiginal_line: Line numberbody: Comment textdiff_hunk: Code context
2. PR Reviews (approval/request changes with summary)
gh api repos/{owner}/{repo}/pulls/{number}/reviews
These include:
body: Review summarystate: APPROVED, CHANGES_REQUESTED, COMMENTED
3. General PR Comments (conversation thread)
gh api repos/{owner}/{repo}/issues/{number}/comments
These are discussion comments not tied to specific lines.
Processing Comments
- Group by file: Organize inline comments by their
pathfield - Classify feedback by intent:
- Change requests — explicit directives to modify code (e.g. "please change", "should be", "fix", "update")
- Open questions — inquiries that require investigation or clarification
- Enhancement suggestions — non-blocking recommendations for improvement
- Prioritize: Address blocking comments (from CHANGES_REQUESTED reviews) first
Acting on Feedback
For each actionable comment:
- Read the referenced file to understand the current code
- Fix problems at the root: Don't apply superficial fixes. Investigate and address the underlying cause of the issue, not just the symptom mentioned in the comment
- Apply requested changes using the Edit tool
- For questions: Investigate and provide answers or make clarifying changes
- For suggestions: Evaluate and implement if appropriate
- Add tests for edge cases: If the feedback identifies an edge case and the project has testing already set up, add a test to cover that edge case to prevent regression
Example Workflow
Given https://github.com/acme/app/pull/42:
- Extract: owner=
acme, repo=app, number=42 - Fetch comments:
gh api repos/acme/app/pulls/42/comments gh api repos/acme/app/pulls/42/reviews gh api repos/acme/app/issues/42/comments - Parse the JSON responses to identify feedback
- For each comment with a file path, read that file and apply changes
- Summarize what was addressed
Output
After processing, provide a summary of:
- Number of comments found
- Actions taken for each comment
- Any comments that need clarification or manual review
