skills/addressing-pr-review-comments/SKILL.md
Use this skill to work through review feedback on a pull request — read the inline review comments, assess each one's validity, make the code changes that are warranted, and reply to every thread with a one-line explanation of what was done (or why it was declined). Triggers when the user asks to address PR feedback, respond to reviewers, work through review comments, handle a code review, action the comments on a PR, or asks "what do the reviewers want changed?" Also triggers when resuming work on a PR that has open review threads.
npx skillsauth add mattobee/skills addressing-pr-review-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Work through inline review comments on a pull request: read them, decide which are valid, make the changes that are warranted, and reply to each thread explaining what was done.
Not every comment deserves a code change. Some are wrong, some are out of scope, some duplicate others, some are stylistic preferences that conflict with project conventions. Engage with each comment honestly rather than capitulating to all of them.
Run these checks before doing anything else. Fail fast — it's better to stop here than to discover a problem halfway through making changes.
gh auth status. If it reports the user is not logged in, or the token lacks repo scope, stop and ask the user to authenticate. Don't attempt to proceed with an unauthenticated CLI.git rev-parse --is-inside-work-tree and git remote get-url origin (or whichever remote points to the PR's host). If either fails, stop — there's no PR to address.git status --porcelain. If there are uncommitted or staged changes, stop and ask the user how to proceed. Options: stash them (git stash push -m "pre-review-changes"), commit them first, or abort. Do not silently mix the user's in-progress work with review-feedback commits.headRefName. If not, ask the user before switching — they may have intentionally checked out a different branch.git fetch origin <head-branch> then compare with git rev-list --left-right --count HEAD...origin/<head-branch>. If the remote is ahead, pull before making changes (the reviewer may have pushed a fixup). If the local branch is ahead, note it — those unpushed commits may already address some comments.git rev-list --count origin/<base-branch>..HEAD and the reverse. If the base branch is far ahead, warn the user — merge conflicts are likely and should be resolved as a separate commit before review-feedback commits.If any check fails or surfaces something unexpected, stop and report what was found before continuing.
gh pr view --json number,headRefName,baseRefName,url,state to find the PR for the current branch.gh pr list --state open --author @me and ask the user which one to address. Do not guess.Use the GitHub API rather than gh pr view — the latter does not return inline comments with the structure needed to reply.
gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate
This returns inline review comments. Each comment has:
id — used to reply via in_reply_topath, line, original_line, side — where the comment is anchoredbody — the comment textuser.login — who wrote itin_reply_to_id — set if this is a reply within an existing threadpull_request_review_id — groups comments from the same reviewGroup comments into threads. The thread's root is the comment whose in_reply_to_id is null; subsequent replies share the chain. Address one reply per thread, at the root, unless a sub-comment specifically asks a new question.
Skip threads where:
The most recent comment in the thread is from the PR author (you, presumably) and answers the reviewer — already handled.
The thread is marked resolved. Resolved state is not in the REST comments endpoint; fetch it via GraphQL if needed:
gh api graphql -f query='query($owner:String!,$repo:String!,$num:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$num){reviewThreads(first:100){nodes{id isResolved comments(first:1){nodes{databaseId}}}}}}}' -F owner=... -F repo=... -F num=...
Match thread IDs back to comment IDs via the first comment's databaseId.
Also fetch top-level review summaries with gh api repos/{owner}/{repo}/pulls/{number}/reviews so context from the overall review is available, but do not reply to those — this skill addresses inline threads only.
For every unresolved thread, decide one of:
Default to acting. Decline only when there is a clear, articulable reason. Vague discomfort with a suggestion is not a reason to decline — either find the real objection or make the change.
Grounds for declining include:
AGENTS.md, CONTRIBUTING.md, the codebase's existing patterns, or a prior discussion.If declining because the reviewer might be right but you disagree, say so plainly in the reply and invite further discussion rather than dismissing.
Group related changes together. Use the TodoWrite tool to track each thread and its decision so nothing slips.
After making changes:
refactor: extract validation helper (review feedback)).Do not amend or force-push earlier commits on the PR branch unless the user explicitly asks for it. Reviewers rely on incremental commits to see what changed since their last pass.
Reply directly to each thread once the corresponding change is committed (or the decision to decline is made). Replies are posted via:
gh api repos/{owner}/{repo}/pulls/{number}/comments \
-X POST \
-F in_reply_to={root_comment_id} \
-F body='...'
Keep replies to one line where possible. The reviewer wants to know what happened, not read an essay.
Reply patterns:
Done in <commit-sha-or-short-description>. — e.g., Done in a1b2c3d — extracted to validateInput().Renamed the variable; left the function signature as-is because <reason>.Left as-is — <thing> already handles this case at <file>:<line>.Left as-is — project convention is to <pattern>, see <reference>.Out of scope for this PR — opened #<issue-number> to track.Disagree — <one-sentence reason>. Happy to discuss if you feel strongly.Can you clarify — do you mean <option A> or <option B>?Do not use filler phrases ("Great catch!", "Good point!", "Thanks for the feedback!"). Get to the substance.
If a thread had multiple sub-comments and the final reply was from the reviewer asking a follow-up, address that follow-up specifically rather than restating what was already discussed.
Resolving threads is a reviewer privilege by convention — don't auto-resolve threads on the reviewer's behalf. Replies are enough. If the project's workflow is for the PR author to resolve threads after addressing them, the user will say so; otherwise leave them open.
After all replies are posted, give the user a short summary:
gh pr view --comments shows issue-style PR comments, not inline review comments. Use gh api .../pulls/{n}/comments for inline review comments. The two endpoints return different data.in_reply_to works, but the thread display can get confusing. Always reply to the thread's root comment (in_reply_to_id is null).suggestion as the language tag. You can apply them by editing the file to match, then replying. There's no single API call to "accept suggestion" outside the web UI.gh api paginates at 30 items by default. Use --paginate for any PR with substantial review activity.testing
Use this skill to write Playwright accessibility tests using the two-layer strategy (axe-core scans + targeted assertions). Triggers when adding accessibility test coverage, reviewing test gaps, writing axe scans, or creating Playwright assertions for accessible names, landmarks, ARIA states, focus management, or contrast.
tools
Use this skill to suggest prioritised next steps for a project. Triggers when the user asks what to work on next, wants to resume after a break, or needs help prioritising a backlog.
development
Use this skill to review implemented UI code for WCAG accessibility compliance. Triggers when reviewing components, pages, or templates for accessibility, auditing a feature after implementation, or answering questions about accessible patterns, ARIA, keyboard navigation, or screen reader support.
testing
Use this skill to prioritise a set of accessibility issues for remediation based on severity, user impact, and effort. Triggers when triaging an accessibility backlog, deciding what to fix first after an audit, planning an accessibility sprint, or asking which accessibility issues matter most.