skills/address-pr-comments/SKILL.md
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.
npx skillsauth add absolutelyskilled/absolutelyskilled address-pr-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When this skill is activated, always start your first response with the :speech_balloon: emoji.
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.
Trigger this skill when the user:
Do NOT trigger this skill for:
The gh CLI must be authenticated. Verify with:
gh auth status
The user should be on the branch associated with the PR, or provide a PR number/URL.
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.
Fetch all review comments (not issue comments) on the PR:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --paginate
Each 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 commentAlso fetch review-level comments (top-level review bodies):
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews --paginate
A comment is "unaddressed" if:
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.
For each unaddressed comment:
pathAgreement criteria:
Defer criteria (respectfully):
For each agreed comment, make the code change. Track what was changed:
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.
Draft replies for ALL comments before posting any. Present them to the user for review.
Reply tone guidelines:
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.
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.
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 | 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 |
| 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 |
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 commentsdevelopment
Use when the user wants to simplify, clean up, refactor, tidy, or refine code — their staged/unstaged git changes or a target file/path. Reduces complexity, flattens nesting, removes redundancy and dead code, scores each change by value (holding low-value churn), then runs tests to prove nothing broke. Invoke on: "simplify", "simplify this", "simplify my code/changes", "clean up", "clean this up", "clean up my changes", "refactor this", "make this cleaner", "tidy this up", "reduce complexity", "flatten this", "remove dead code", "make it more readable", "polish before commit", or "absolute simplify". Acts on your working diff; for repo-wide dead code use absolute-prune; for lint/type debt use absolute-debt.
testing
Dependency upgrades: outdated/vulnerable deps planned into semver waves (patch/minor batched, majors gated and changelog-read), applied incrementally with lockfiles regenerated and tests green after each. Runs on green main. Triggers on "absolute upgrade", "upgrade our dependencies", "bump deps", "update packages", "move off the deprecated X", "clear the Dependabot backlog".
development
Lightweight standalone design spec for AI coding agents: codebase scan → bounded clarify pass (3–5 questions, not a grill) → reviewed design doc written to docs/plans/ → independent scored review → stop. No task board, no build. Use when you want a spec to discuss, hand off, or review before committing to implementation. Chains into absolute-work when ready to build. Triggers on "absolute spec", "write a spec", "spec out this feature", "draft a design doc", "I want a spec to hand off / review, don't build it yet".
tools
Dead code and dependency cleanup, repo-wide: unused deps, unreferenced exports, unreachable code, orphaned files — removed only with tool evidence, in reversible waves. Runs on green main. For diff-scoped cleanup use absolute-simplify. Triggers on "absolute prune", "remove dead code", "find unused deps/exports", "what can we delete", "clean up orphaned files".