gh-pr-review-comments
Address PR Review Comments
Use this skill to run a full GitHub PR review follow-up pass from live comment data instead of screenshots or pasted summaries. Fetch the comments, decide what to accept, update only the current PR branch, resolve threads deliberately, and finish with the exact status line the user expects.
Boundary Rules
- This skill addresses existing review comments on the current PR branch. It does not run a fresh end-to-end critique of the implementation plan.
- If the user wants a broader challenge of the plan, branch approach, or test strategy beyond the current review comments, use
gh-plan-review.
Core Workflow
- Confirm you are already on the PR feature branch you intend to update, not
main,master, or another default branch. - Fetch the authoritative review comments with
gh api --paginate repos/{owner}/{repo}/pulls/{pr}/comments. - Exclude reply comments such as items with
in_reply_to_idbefore triaging, so you classify top-level review requests rather than thread replies. - Classify every remaining review comment before touching code.
- Inspect the relevant files, diff, and surrounding context for accepted comments.
- Apply only the accepted fixes on the same PR branch.
- Run the smallest relevant verification for the touched code.
- Determine whether the PR branch has exactly one branch commit or multiple branch commits relative to the PR base. A multi-commit PR branch must not default to amend or force-push.
- Before committing or pushing, re-read the affected workflow, file, or ruleset end-to-end and do a self-review for contradictions, path-specific regressions, or metadata mismatches introduced by the accepted fixes.
- If that self-review introduces additional edits, run the smallest relevant verification again for the final diff.
- If the PR branch has multiple branch commits relative to the PR base and the user did not explicitly request amend, squash, or another history rewrite, ask whether to create a new commit, amend
HEAD, or use another explicit rewrite flow, and stop until the user answers. - Create a new commit when the chosen path is additive. Amend the existing PR commit only when the branch has exactly one branch commit relative to the PR base or when the user explicitly requested amend or squash. If the user explicitly requested another history rewrite, follow that instruction instead of assuming amend. Use
git commit --amend --no-editonly when the existing commit message still accurately describes the updated branch diff; otherwise amend the commit message so it matches the current branch diff. - If a new commit was created, get any required user or repo-policy approval for pushing, then push the feature branch with
git push. If history was rewritten, get any required user or repo-policy approval for pushing, then push the feature branch withgit push --force-with-lease. - If the open PR title or body is now stale relative to the current branch diff, update the PR metadata before re-requesting review.
- Post a short reply on every handled review thread describing the action taken, then resolve it intentionally.
- After resolving handled threads, re-request review from each relevant human reviewer and supported review bot unless the user says not to. If a relevant bot is clearly identified but missing from references/review-bots.md, mention its username explicitly and ask the user whether to re-request that bot or add it to the registry instead of silently skipping it.
- Report the result in the required status format.
Triage Rules
Classify every top-level review comment into exactly one bucket before making edits. Do not treat reply comments as separate actionable review requests.
✅ valid/actionable: Implement the change. Use this for correctness issues, real regressions, missing edge cases, missing tests, or maintainability problems that clearly matter.⚪ optional/nit: Decide case-by-case. Accept only if the change stays inside the current scope and keeps the diff minimal.❌ invalid/circular/conflicting: Do not change code blindly. Use this for stale feedback, misunderstandings, contradictory requests, circular churn, or scope expansion that is not justified by the PR.
Treat conflicting comments as a single decision, not two independent tasks. If a comment is unclear, inspect the code, tests, current PR diff, and related discussion before deciding.
Implementation Rules
GitHub CLI commands that require network access should be run outside the sandbox immediately, using approved gh prefix rules when available, instead of trying them in-sandbox first.
- Work from live GitHub review data, not screenshots.
- Paginate
gh apicalls whenever the endpoint is paginated and the workflow depends on a complete result set. - Keep the current PR branch intact. Preserve the single-commit flow only when the branch has exactly one branch commit relative to the PR base or the user explicitly requested history rewrite.
- Follow the repo and user push policy. If approval is required before any push, obtain it before pushing.
- On a multi-commit PR branch, ask before rewriting history.
- Use
git pushafter a new commit on the PR feature branch. - Use
git push --force-with-leaseonly after amend, rebase, or another explicit history rewrite on the PR feature branch. Never force-pushmain,master, or another default branch. - Touch only the files required to address accepted comments.
- Decline scope expansion unless the user explicitly asks for it.
- Avoid cosmetic churn when a comment is optional or invalid.
- If no comments are accepted, do not manufacture code changes just to appear responsive.
- If accepted fixes materially change the branch summary, refresh the commit message and open PR title/body so they still describe the current diff before re-requesting review. When refreshing an open PR body, preserve any applicable
Closes #xx,Fixes #xx, orPart of #xxtrailer and any required template sections that still accurately describe the current diff. - If the self-review pass adds or changes files, rerun the smallest relevant verification on the final diff before committing and pushing.
Self-Review Rules
- After applying accepted fixes and before re-requesting review, run a short adversarial self-review of the affected workflow or file, not just the touched hunk.
- Check whether the new wording or code creates contradictions with other paths, especially distinctions like single-commit versus multi-commit, new PR versus existing PR, commit metadata versus PR metadata, and default base versus configured base.
- If the accepted fix changes what text, behavior, or command will actually be sent or executed, verify that any preview, confirmation, or metadata rule still matches that actual behavior.
- Fix any material contradiction you can justify from local context before pushing and re-requesting review, including stale commit or PR metadata when the branch summary has changed.
- If fixing that contradiction changes the diff, rerun the smallest relevant verification before you commit and push.
Thread Resolution Rules
- Every handled review thread must receive a short reply before you resolve it.
- Resolve
fixedcomments after the fix is present locally and ready to push, and reply with a short acknowledgement of what changed. - Resolve
dismissed/no-changecomments only after posting a concise rationale. - Resolve
partially-fixedcomments only after explaining exactly what changed and what did not. - Do not leave handled comments open between passes.
- Count only threads you actually resolved during this pass in the final status line.
- Read references/github-review-threads.md only when you need reply endpoints, thread IDs, or GraphQL resolution commands.
Reviewer Rules
- Read references/review-bots.md when you need the supported bot table, exact summon text, or preferred bot-detection evidence.
- Determine relevant human reviewers from handled review comments authored by non-bot users and from explicit user instruction.
- Re-request human reviewers with GitHub review requests when possible. Read references/github-review-threads.md when you need the request-review command.
- If multiple human reviewers participated in the current review round, re-request each relevant human once after the fix is pushed.
- Determine relevant review bots in this order: handled review comments from a supported bot, explicit user instruction, then bot-authored top-level PR comments.
- If the bot is not obvious from inline review comments, inspect top-level PR comments with
gh api --paginate repos/{owner}/{repo}/issues/{pr}/commentsand prefer bot-authored comments over summon comments. - Treat prior PR summon comments as historical context only. Use them only to corroborate explicit user instruction or current-round bot activity, never as the sole reason to re-request bot review.
- If multiple supported bots participated in the current review round, post one exact summon comment for each of them after pushing the fix.
- If a bot is clearly identified from PR context but is not listed in references/review-bots.md, mention the bot username explicitly and ask the user whether to re-request that bot or add it to the registry. Do not invent summon text.
- If a human reviewer or bot username cannot be identified confidently, do not guess. Skip that re-review request unless the user names the reviewer or you can confirm it from PR context.
Git and Review Commands
Use one of these command paths after accepted fixes are ready on a PR feature branch:
# Single-commit branch or explicit history rewrite
git commit --amend --no-edit
git push --force-with-lease
# Multi-commit branch with additive update
git commit
git push
If the repo or user policy requires approval before pushing, obtain that approval first. Use git push after a new commit. Use git push --force-with-lease only after amend, rebase, or another explicit history rewrite on the PR feature branch.
When the PR branch has multiple branch commits relative to the PR base and the user did not explicitly request history rewrite, stop and ask whether to create a new commit, amend HEAD, or use another explicit rewrite flow.
When the self-review pass finds that the chosen commit message is stale, update it so it matches the current branch diff instead of blindly reusing old metadata. When the open PR title or body is stale, update the PR metadata before re-requesting review, preserving any applicable issue trailer or required template section that still matches the current diff instead of blindly replacing the body.
Re-request review when the pass is complete by requesting each relevant human reviewer again and by posting one standalone PR comment per relevant supported bot, using the exact summon text from references/review-bots.md. If a relevant bot is clearly identified but missing from that registry, mention its username explicitly and ask the user whether to re-request that bot or add it to the registry; do not invent a summon comment.
If no code changed, skip commit and push. If re-review would be misleading because the task is blocked or incomplete, or no relevant human reviewer or supported bot was identified, report no in the final status line.
Output Format
After finishing the pass, emit exactly one status line in this format:
status | commit | comments resolved (n) | re-review requested (yes/no)
Use these values consistently:
status:done,partial,blocked, orno-changecommit: short SHA of the created or updated commit, orunchangedif no commit was createdcomments resolved (n): number of threads resolved in this passre-review requested (yes/no):yesonly if you actually re-requested one or more relevant reviewers, whether by human review request or bot summon comment
Example:
done | abc1234 | comments resolved (5) | re-review requested (yes)
More from beeman/skills
feature-structure
Use when reorganizing code around feature boundaries, splitting monolithic screen components or state hooks, deciding whether logic belongs in data-access, feature, ui, or child features, or moving orchestration out of prop-heavy UI files.
8gh-pr-create
Create a GitHub pull request from local repo changes. Use when Codex must get feature-branch setup and local commit packaging from `gh-commit`, get approval before pushing, show the exact PR title and body that will be sent, handle single-commit and multi-commit branch flows explicitly, and open or update the PR with gh.
7gh-issue-kickoff
Kick off work on a GitHub issue with gh. Use when Codex needs to start from the authoritative issue state and local codebase, fix only material issue gaps, and produce the first execution-ready implementation plan. For a deeper critique or tradeoff review of an existing plan, use `gh-plan-review`.
5gh-plan-review
Review, challenge, pressure-test, or refine an implementation plan tied to a GitHub issue, GitHub PR, or active branch. Use when Codex needs to inspect the authoritative GitHub state and local repo context, run a scope challenge, identify material plan risks, surface real tradeoffs, and finish with a fixed review summary without mutating code or git state.
5gh-pr-rebase
Rebase an existing GitHub PR branch onto the repository default branch. Use when Codex needs to fetch the latest default-branch history, keep the local default branch current when that is safe, rebase the current feature branch, resolve straightforward conflicts carefully, ask the user to decide ambiguous conflicts, and update the remote PR branch with `git push --force-with-lease` after any required approval.
5gh-commit
Prepare a local Git commit from repo changes. Use when Codex needs to get onto the correct feature branch if needed, inspect `git status --short`, the current diff, and branch history, run the smallest relevant verification, add any required changeset, and package the tracked work into either a new commit or an explicitly approved amend flow before any push or PR step.
4