address-pr-comments
Use this skill when addressing, responding to, or resolving PR review comments on GitHub pull requests. Triggers on "address PR comments", "respond to review", "handle review feedback", "reply to PR comments", "fix review comments", or when the user wants to process open review threads on their PR. Uses the gh CLI to fetch unresolved comments, make code changes where agreed, and post batch replies with a humble, thankful tone.
engineering githubpr-reviewcode-reviewgh-clipull-requestreview-commentsWhat is address-pr-comments?
Use this skill when addressing, responding to, or resolving PR review comments on GitHub pull requests. Triggers on "address PR comments", "respond to review", "handle review feedback", "reply to PR comments", "fix review comments", or when the user wants to process open review threads on their PR. Uses the gh CLI to fetch unresolved comments, make code changes where agreed, and post batch replies with a humble, thankful tone.
Quick Start
- Open your terminal or command prompt
- Run:
npx skills add AbsolutelySkilled/AbsolutelySkilled --skill address-pr-comments - Start your AI coding agent (Claude Code, Cursor, Gemini CLI, or any supported agent)
- The address-pr-comments skill is now active and ready to use
address-pr-comments
address-pr-comments is a production-ready AI agent skill for claude-code, gemini-cli, openai-codex. Addressing, responding to, and resolving PR review comments on GitHub pull requests using the gh CLI.
Quick Facts
| Field | Value |
|---|---|
| Category | engineering |
| Version | 0.1.0 |
| Platforms | claude-code, gemini-cli, openai-codex |
| License | MIT |
How to Install
- Make sure you have Node.js installed on your machine.
- Run the following command in your terminal:
npx skills add AbsolutelySkilled/AbsolutelySkilled --skill address-pr-comments- The address-pr-comments skill is now available in your AI coding agent (Claude Code, Gemini CLI, OpenAI Codex, etc.).
Overview
Automates the workflow of reading open PR review comments, understanding each one,
making code changes where the feedback is valid, and posting thoughtful replies to
every comment - all via the gh CLI. The agent exercises judgment on which comments
to accept vs. respectfully defer, and batches all replies for user review before posting.
Replies are written with a humble, thankful tone to foster good collaboration.
Tags
github pr-review code-review gh-cli pull-request review-comments
Platforms
- claude-code
- gemini-cli
- openai-codex
Related Skills
Pair address-pr-comments with these complementary skills:
Frequently Asked Questions
What is address-pr-comments?
Use this skill when addressing, responding to, or resolving PR review comments on GitHub pull requests. Triggers on "address PR comments", "respond to review", "handle review feedback", "reply to PR comments", "fix review comments", or when you want to process open review threads on your PR.
How do I install address-pr-comments?
Run npx skills add AbsolutelySkilled/AbsolutelySkilled --skill address-pr-comments in your terminal. The skill will be immediately available in your AI coding agent.
What AI agents support address-pr-comments?
This skill works with claude-code, gemini-cli, openai-codex. Install it once and use it across any supported AI coding agent.
Maintainers
Generated from AbsolutelySkilled
SKILL.md
Address PR Review Comments
Automates the workflow of reading open PR review comments, understanding each one,
making code changes where the feedback is valid, and posting thoughtful replies to
every comment - all via the gh CLI. The agent exercises judgment on which comments
to accept vs. respectfully defer, and batches all replies for user review before posting.
When to use this skill
Trigger this skill when the user:
- Wants to address or respond to PR review comments
- Says "handle my PR feedback" or "fix review comments"
- Asks to reply to open review threads on a GitHub PR
- Wants to process unresolved review comments on their branch
- Says "address the PR comments" or "respond to reviewer"
- Needs to batch-reply to all open comments on a PR
Do NOT trigger this skill for:
- Creating a new PR or writing a PR description
- Reviewing someone else's PR (that's code-review, not addressing comments)
- General git operations unrelated to PR review comments
Prerequisites
The gh CLI must be authenticated. Verify with:
gh auth statusThe user should be on the branch associated with the PR, or provide a PR number/URL.
Core workflow
Step 1 - Identify the PR
Determine the PR number. If the user doesn't specify one:
gh pr view --json number,title,url -q '.number'Gotcha: This only works if the current branch has an open PR. If it fails, ask the user for the PR number or URL.
Step 2 - Fetch all review comments
Fetch all review comments (not issue comments) on the PR:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --paginateEach comment object contains:
id- unique comment IDbody- the reviewer's comment textpath- file path the comment is online/original_line- line number in the diffdiff_hunk- surrounding diff contextin_reply_to_id- if this is a reply to another comment (threaded)user.login- who left the comment
Also fetch review-level comments (top-level review bodies):
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews --paginateStep 3 - Filter to unaddressed comments
A comment is "unaddressed" if:
- It was NOT written by the PR author (the user)
- It has no reply from the PR author in its thread
- It is not a bot comment
To check threads, group comments by in_reply_to_id. A root comment (no in_reply_to_id)
that has no reply from the PR author's login is unaddressed.
Gotcha: The
in_reply_to_idfield links replies to their parent comment. Comments without this field are root comments. Always check the full thread before deciding a comment is unaddressed.
Step 4 - Read code context and evaluate each comment
For each unaddressed comment:
- Read the file at the path mentioned in
path - Understand the reviewer's suggestion in context
- Decide: agree (the suggestion improves the code) or defer (current approach is better)
Agreement criteria:
- The suggestion fixes a real bug or edge case
- It improves readability, performance, or maintainability
- It follows project conventions the current code missed
- It catches a typo, naming issue, or documentation gap
Defer criteria (respectfully):
- The suggestion would introduce unnecessary complexity
- The current approach was intentional and has good reasons
- The suggestion conflicts with project conventions or requirements
- The comment is based on a misunderstanding of the context
Step 5 - Make code changes for agreed comments
For each agreed comment, make the code change. Track what was changed:
- File path and what was modified
- Which comment prompted the change
Gotcha: Multiple comments may affect the same file or even the same lines. Process them carefully to avoid conflicting edits. Read the file fresh before each edit if multiple comments target the same file.
Step 6 - Draft all replies (batch mode)
Draft replies for ALL comments before posting any. Present them to the user for review.
Reply tone guidelines:
- Be humble and thankful: "Good catch!", "Thanks for flagging this!", "Great suggestion, updated!"
- For agreed + changed: mention the specific change made
- For deferred: explain the reasoning respectfully, stay open to further discussion
- Keep replies concise - 1-3 sentences max
- Never be defensive or dismissive
Reply templates:
For agreed comments where changes were made:
Good catch! Updated [brief description of change]. Thanks for the review!Thanks for flagging this - you're right. Fixed in the latest push.Great suggestion! Refactored to [what was done]. Appreciate the feedback.For deferred comments:
Thanks for the suggestion! I considered this, but went with [current approach] because [reason]. Happy to discuss further if you see issues with this approach.Appreciate the review! The current implementation is intentional here - [brief reason]. Let me know if you think there's still a concern.Step 7 - Present batch to user for approval
Before posting, present a summary table:
| # | File | Comment (summary) | Action | Reply (draft) |
|---|------|-------------------|--------|---------------|
| 1 | src/api.ts:42 | Missing null check | Agreed - Fixed | "Good catch! Added null check..." |
| 2 | src/utils.ts:15 | Use lodash instead | Deferred | "Thanks! Kept native impl because..." |Ask the user to approve, edit, or skip specific replies.
Step 8 - Post replies
Post each reply using the GitHub API:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-method POST \
-f body="Good catch! Updated the null check. Thanks for the review!" \
-F in_reply_to={parent_comment_id}Gotcha: Use
in_reply_toto thread the reply under the original comment. Do NOT create a new top-level review comment - always reply in the existing thread. Thein_reply_tovalue should be theidof the root comment in the thread.
Error handling
| Error | Cause | Resolution |
|---|---|---|
gh: not found |
gh CLI not installed | Ask user to install: brew install gh |
HTTP 401 |
gh not authenticated | Run gh auth login |
HTTP 404 on PR |
Wrong repo or PR doesn't exist | Verify PR number and repo |
HTTP 422 on reply |
Invalid in_reply_to ID |
Verify the comment ID exists and belongs to the PR |
| No unaddressed comments | All comments already replied to | Inform the user - nothing to do |
Anti-patterns
| Mistake | Why it's wrong | What to do instead |
|---|---|---|
| Agreeing with everything | Wastes effort, may introduce bad changes | Exercise judgment - defer when current approach is better |
| Being defensive in replies | Creates friction, poor collaboration | Stay humble: "Thanks for the suggestion" even when deferring |
| Posting replies before user approval | User loses control over what's posted | Always batch and present for approval first |
| Replying as top-level comments | Breaks the review thread structure | Always use in_reply_to to thread replies |
| Ignoring diff context | May misunderstand what the reviewer is pointing at | Always read diff_hunk and the full file before deciding |
References
For detailed information on specific topics, read the relevant file from references/:
references/gh-api-reference.md- Full GitHub API endpoints for PR reviews and comments
References
gh-api-reference.md
GitHub API Reference for PR Review Comments
Key endpoints
List review comments on a PR
GET /repos/{owner}/{repo}/pulls/{pull_number}/commentsReturns all review comments (inline code comments) on a PR. Supports pagination.
Key response fields per comment:
id(integer) - unique comment ID, use this forin_reply_tobody(string) - comment textpath(string) - relative file pathline(integer) - line in the diff (null for outdated comments)original_line(integer) - original line numberside(string) - "LEFT" or "RIGHT" side of the diffdiff_hunk(string) - diff context around the commentin_reply_to_id(integer) - parent comment ID if this is a threaded replyuser.login(string) - GitHub username of the commentercreated_at(string) - ISO timestampupdated_at(string) - ISO timestamp
List reviews on a PR
GET /repos/{owner}/{repo}/pulls/{pull_number}/reviewsReturns top-level reviews (approve, request changes, comment). Each review may have a body.
Key response fields:
id(integer) - review IDuser.login(string) - reviewer usernamebody(string) - top-level review body (may be empty)state(string) - "APPROVED", "CHANGES_REQUESTED", "COMMENTED", "DISMISSED"
Reply to a review comment (thread a reply)
POST /repos/{owner}/{repo}/pulls/{pull_number}/commentsBody parameters:
body(string, required) - the reply textin_reply_to(integer, required) - the ID of the comment to reply to
This creates a threaded reply under the specified comment.
Example with gh CLI:
gh api repos/{owner}/{repo}/pulls/42/comments \
-method POST \
-f body="Good catch! Fixed in the latest push." \
-F in_reply_to=123456789Create a new review comment (not a reply)
POST /repos/{owner}/{repo}/pulls/{pull_number}/commentsBody parameters:
body(string, required)commit_id(string, required) - SHA of the commit to comment onpath(string, required) - relative file pathline(integer) - line number in the diffside(string) - "LEFT" or "RIGHT"
You almost never need this for addressing review comments. Always prefer replying to existing threads with
in_reply_to.
Get a single review comment
GET /repos/{owner}/{repo}/pulls/comments/{comment_id}Useful for verifying a comment exists before replying.
Pagination
All list endpoints support pagination. With gh api, use --paginate:
gh api repos/{owner}/{repo}/pulls/42/comments --paginateThis automatically follows Link headers and returns all pages.
Rate limits
- Authenticated requests: 5,000/hour
- Each reply POST counts as one request
- Batch posting 20 replies is fine, but if a PR has 100+ comments, be mindful
Common gotchas
Outdated comments - Comments on lines that no longer exist in the latest diff have
line: null. Theoriginal_lineanddiff_hunkstill show where the comment was. You can still reply to these.Review comments vs issue comments - Review comments (
/pulls/{n}/comments) are inline code comments. Issue comments (/issues/{n}/comments) are the general conversation. This skill focuses on review comments.Minimized/resolved comments - The REST API doesn't expose the "resolved" state of review threads. A comment thread is considered "addressed" if the PR author has replied. The GraphQL API has
isResolvedonReviewThreadif needed.Bot comments - Filter out comments from bots (check
user.type == "Bot"or known bot logins likedependabot,github-actions).in_reply_tomust be the root comment ID - When replying in a thread,in_reply_toshould reference the original comment'sid, not a reply's ID. Using a reply's ID still works but may create inconsistent threading on some GitHub UI views.
Frequently Asked Questions
What is address-pr-comments?
Use this skill when addressing, responding to, or resolving PR review comments on GitHub pull requests. Triggers on "address PR comments", "respond to review", "handle review feedback", "reply to PR comments", "fix review comments", or when the user wants to process open review threads on their PR. Uses the gh CLI to fetch unresolved comments, make code changes where agreed, and post batch replies with a humble, thankful tone.
How do I install address-pr-comments?
Run npx skills add AbsolutelySkilled/AbsolutelySkilled --skill address-pr-comments in your terminal. The skill will be immediately available in your AI coding agent.
What AI agents support address-pr-comments?
address-pr-comments works with claude-code, gemini-cli, openai-codex. Install it once and use it across any supported AI coding agent.
Is address-pr-comments free?
Yes, address-pr-comments is completely free and open source under the MIT license. Install it with a single command and start using it immediately.
What is the difference between address-pr-comments and similar tools?
address-pr-comments is an AI agent skill that teaches your coding agent specialized software engineering knowledge. Unlike standalone tools, it integrates directly into claude-code, gemini-cli, openai-codex and other AI agents.
Can I use address-pr-comments with Cursor or Windsurf?
address-pr-comments works with any AI coding agent that supports the skills protocol, including Claude Code, Cursor, Windsurf, GitHub Copilot, Gemini CLI, and 40+ more.