npx skills add ...
npx skills add automattic/pocket-casts-ios --skill address-pr-comments
npx skills add automattic/pocket-casts-ios --skill 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".
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 branch
using gh pr view --json number.If a PR number was provided, use it. Otherwise, detect it from the current branch:
If no PR is found, tell the user and stop.
Fetch inline review comments, general issue comments, and PR review submissions:
Get the repo owner and name (used as {owner}/{repo} in API paths):
Skip comments that are:
copilot),
which posts actionable review feedback that should be addressedin_reply_to_id is non-null — only treat top-level
inline comments (those with in_reply_to_id == null) as separate actionable itemsFocus 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.
Read the relevant code: Use the file path and line number from inline comments.
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.
Understand the ask: Determine what the reviewer wants — a bug fix, style change, refactor, clarification, etc.
Make the fix: Edit the code to address the feedback. Follow the project conventions from AGENTS.md / CLAUDE.md.
Commit and push: Stage only the files changed for this comment, commit, and push immediately. This ensures the commit hash is available on the remote for linking.
Track what you did: Record the comment, the action taken, and the full commit hash
(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):
If fixed (general PR comment):
If not fixed (inline review comment):
If not fixed (general PR comment):
If fixed (PR review submission):
If not fixed (PR review submission):
Post a single summary comment on the PR listing everything you did:
Collect the unique usernames of all human commenters (exclude bot accounts like
copilot, github-actions, etc.), then re-request their review:
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:
gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"'