agentleFS
gjoranvgjoranv/claude-review-skills/gh-review-respond/SKILL.md

gh-review-respond

Skill1 starsChanged 4 months agoMITView on GitHub

Read review comments on a GitHub PR, respond to them, fix code issues, and resolve conversations. Use when the user asks to "handle PR review comments", "fix review feedback", or "respond to PR reviews".

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If all three sources return nothing actionable, tell the user and stop.

    line 19
  2. Distinctive:

    Disagree/Won't fix: If the user indicates a comment should not be addressed, draft a reply that acknowledges the reviewer's concern, …

    line 24
  3. Very specific:

    If the PR already has a human approval, record the IDs of its current APPROVED reviews and tell the user their states will be rechecked …

    line 30
  4. Distinctive:

    Human reviewers: ALWAYS create a NEW commit.

    line 34
  5. Distinctive:

    Confirm with the user: before taking any externally-visible action.

    line 35
  6. Very specific:

    Start with @<reviewer-login> so they get notified.

    line 58
  7. Distinctive:

    Only inline threads can be resolved — PR-level and review-level comments have no resolution state, so replying to them is enough.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Handle review comments on a GitHub PR. $ARGUMENTS: first argument is a PR URL or owner/repo#number. Second argument (if present) is context: a GitHub plan issue or Jira key (with or without --context prefix). If no PR is given, use the PR referenced earlier in this conversation. If context is provided, use it to better judge whether reviewer comments are relevant to the overall goal.

--auto: skip the confirmation checkpoint at step 4 and proceed directly to fixing, committing, and replying. Without this flag, the checkpoint is mandatory.

  1. Read all comments on the PR from all three sources. Each has different resolution semantics — do NOT skip any source:

    • Inline review comments: gh api repos/OWNER/REPO/pulls/NUMBER/comments (comments on specific lines of code). Filter out threads marked resolved via GraphQL (isResolved: true).
    • Review-level comments: gh api repos/OWNER/REPO/pulls/NUMBER/reviews (body text submitted with each review, e.g. approval or request-changes summary). No resolution state — include all that contain substantive feedback not already addressed.
    • PR-level comments: gh api repos/OWNER/REPO/issues/NUMBER/comments (general comments not attached to code or reviews). No resolution state — these are plain issue comments. Include ALL that the user has not already responded to. A PR-level comment must never be silently dropped because it "isn't resolvable".

    Track comment IDs carefully. Multiple reviewers (human and bot) often comment on the same file. Each inline comment has a unique numeric id. Record (id, reviewer, file, line, body) for every comment. When replying later, use the exact id from the original comment as in_reply_to. Do NOT look up comments by file and line number — that matches the wrong thread when multiple reviewers commented on the same file.

    If all three sources return nothing actionable, tell the user and stop. Otherwise proceed even if only PR-level comments are unanswered.

  2. Present a summary grouped by source (inline / review-level / PR-level), with reviewer, comment id, file+line for inline, and the feedback. Never omit a source from the summary — if a source has nothing, say so explicitly ("no PR-level comments to address").
  3. Categorize each comment:

    • Fix needed: The reviewer pointed out a real issue — propose a code fix.
    • Discussion: The reviewer asked a question or raised a point that needs the user's input.
    • Disagree/Won't fix: If the user indicates a comment should not be addressed, draft a reply that acknowledges the reviewer's concern, explains the reasoning for the current approach, and offers to revisit if the reviewer feels strongly. Avoid dismissive language.

    Prior instructions about how to handle an expected comment (e.g. "decline the pin-to-SHA suggestion") determine the proposed categorization, not permission to skip confirmation. The user must see the actual comments before replies are posted.

  4. Confirmation checkpoint (skip only if --auto was passed): After presenting the summary and proposed categorizations, STOP and end your turn. Do not reply, resolve, commit, or push in the same turn as the summary. Wait for the user to confirm which comments to fix, discuss, and decline.
  5. Apply fixes for all confirmed items. Most fixes are local code changes, but some may require doc updates, test additions, or config changes. If a fix requires changes in a different repo, note it for the user rather than attempting it.
  6. Stage and commit the fixes:
    • If the PR already has a human approval, record the IDs of its current APPROVED reviews and tell the user their states will be rechecked after the push. STOP and ask the user before committing.
    • Bot reviewers (e.g., Copilot): squash fixes into existing commits using git commit --fixup and git rebase --autosquash.
    • Human reviewers: ALWAYS create a NEW commit. NEVER squash, amend, fixup, or rebase for human reviews. The reviewer needs to see what changed.
  7. Confirm with the user before taking any externally-visible action. Show the commit summary and ask permission to push, reply to comments, and resolve conversations. If declined, stop.
  8. Push the branch: git push. Do this BEFORE replying so the reviewer sees the updated code when they re-visit the conversations. When the push follows a human approval recorded in step 6, re-read the PR's review records and report each recorded review's current state. Do not infer that a new commit retains or dismisses approval from another repository's behavior.
  9. Reply to each comment. The API differs by source:

    Inline review comments (reply into the existing thread):

    gh api repos/OWNER/REPO/pulls/NUMBER/comments \
      -X POST \
      -F in_reply_to=COMMENT_ID \
      -f body="Reply text"

    Use -F for numeric in_reply_to. The COMMENT_ID MUST be the exact id from the comment you are replying to (recorded in step 1). Do NOT reuse IDs from other threads on the same file — a Copilot comment on line 42 has a different ID than a human comment on line 42.

    PR-level comments (no reply mechanism — post a new issue comment that references the original):

    gh api repos/OWNER/REPO/issues/NUMBER/comments \
      -X POST \
      -f body="@reviewer Reply text"

    Start with @<reviewer-login> so they get notified; PR-level comments don't thread like inline ones.

    Review-level comments (the body of a review): reply via a PR-level comment addressed to the reviewer, same pattern as above. Don't try to reply to the review itself — that API creates a new review, not a reply.

    Content guidelines (all sources):

    • For fixes: reply with what was changed (e.g., "Fixed, changed X to Y").
    • For discussion items: reply with the user's response.
    • For declined items: reply with the rationale.
    • For bot reviewers (e.g., Copilot): keep replies short and factual (e.g., "Fixed" or "Dismissed, false positive"). No diplomatic tone needed.
  10. Resolve inline review threads in a single batched GraphQL mutation:
    gh api graphql -f query='mutation {
      t1: resolveReviewThread(input: {threadId: "ID1"}) { thread { isResolved } }
      t2: resolveReviewThread(input: {threadId: "ID2"}) { thread { isResolved } }
    }'
    Only inline threads can be resolved — PR-level and review-level comments have no resolution state, so replying to them is enough. Every inline thread that has been replied to must be resolved.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.