automattic/address-pr-comments
Address PR review comments by fixing code, replying to each comment, and re-requesting review. Use this skill when the user wants to handle, fix, resolve, or address PR feedback, review comments, or code review suggestions. Also use when the user says things like "fix the PR comments", "handle review feedback", "address the review", or "respond to PR feedback".
npx skills add https://github.com/Automattic/pocket-casts-ios --skill address-pr-comments
Read all review comments on a PR, fix the code for each one, reply to each comment,
push the changes, post a summary, and re-request review.
$ARGUMENTS: Optional. A PR number. If omitted, detect the PR from the current branchusing gh pr view --json number.
If a PR number was provided, use it. Otherwise, detect it from the current branch:
gh pr view --json number -q '.number'
If no PR is found, tell the user and stop.
Fetch inline review comments, general issue comments, and PR review submissions:
# Inline review comments (code-level feedback)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
--paginate --jq '.[] | {id, path, line, original_line, side, diff_hunk, body, user: .user.login, in_reply_to_id, created_at}'
# General PR comments (issue-level)
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--paginate --jq '.[] | {id, body, user: .user.login, created_at}'
# PR review submissions (top-level review body from "Submit review")
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews \
--paginate --jq '.[] | select(.body != "" and .body != null) | {id, body, state, user: .user.login, created_at: .submitted_at}'
Get the repo owner and name (used as {owner}/{repo} in API paths):
gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"'
Skip comments that are:
copilot),which posts actionable review feedback that should be addressed
in_reply_to_id is non-null — only treat top-levelinline comments (those with in_reply_to_id == null) as separate actionable items
Focus on comments that contain feedback, suggestions, questions, or requested changes.
For PR review submissions, treat reviews with state: CHANGES_REQUESTED or COMMENTED
that have a non-empty body as actionable. Skip reviews with state: APPROVED or
DISMISSED, and skip reviews from bots (same rules as above).
Process each actionable comment one at a time. For each comment: fix, commit, push.
Do NOT reply to comments during this phase — all replies happen at the end.
If line is null (outdated comment), fall back to original_line and use the
diff_hunk to locate the relevant code in the current file.
For general comments, identify which files they reference.
refactor, clarification, etc.
from AGENTS.md / CLAUDE.md.
immediately. This ensures the commit hash is available on the remote for linking.
git add <changed-files>
git commit -m "$(cat <<'EOF'
Address review: <short description of what was fixed>
Co-Authored-By: Claude <[email protected]>
EOF
)"
git push
(git rev-parse HEAD) for the replies and summary later.
If a comment asks for something that would be incorrect, harmful to the codebase, or
contradicts project conventions, don't make the change. Instead, prepare a respectful
explanation of why. No commit is created for declined comments.
After all comments have been addressed and pushed, reply to each one:
If fixed (inline review comment):
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST -f body="Done in ${FULL_COMMIT_HASH}"
If fixed (general PR comment):
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--method POST -f body="@reviewer Re: your comment about X — Done in ${FULL_COMMIT_HASH}"
If not fixed (inline review comment):
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST -f body="I considered this but didn't make the change because: [reason]"
If not fixed (general PR comment):
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--method POST -f body="@reviewer Re: your comment about X — I considered this but didn't make the change because: [reason]"
If fixed (PR review submission):
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--method POST -f body="@reviewer Re: your review — Done in ${FULL_COMMIT_HASH}"
If not fixed (PR review submission):
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--method POST -f body="@reviewer Re: your review — I considered this but didn't make the change because: [reason]"
Post a single summary comment on the PR listing everything you did:
gh pr comment {pr_number} --body "$(cat <<'EOF'
## Review feedback addressed
{For each comment, one bullet point:}
- **File.swift:42** (@reviewer): [what was asked] — Done in <full-sha>
- **File.swift:87** (@reviewer): [what was asked] — Done in <full-sha>
- **General** (@reviewer): [what was asked] — Not changed because [reason]
- **Review** (@reviewer): [what was asked] — Done in <full-sha>
EOF
)"
Collect the unique usernames of all human commenters (exclude bot accounts like
copilot, github-actions, etc.), then re-request their review:
gh pr edit {pr_number} --add-reviewer reviewer1,reviewer2
Note: Bot accounts like Copilot cannot be re-requested for review — they will
automatically re-review when new commits are pushed.
Print a summary to the user:
Take automattic/address-pr-comments from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.