Process automated PR review comments systematically. Run this for CodeRabbit, Google
Code Assist (Gemini), GitHub Copilot, Devin, and similar review bots.
This skill is single-pass. It does one round, reports the current
state, and stops. Do not schedule future runs from inside this skill.
-
Get context - PR number and current GitHub user:
gh pr view --json number -q '.number'
gh api user --jq '.login'
-
Fetch all bot comments - Prefer GraphQL for review threads to only process unresolved ones:
gh api graphql --paginate -f query='
query($endCursor: String) {
repository(owner: "{owner}", name: "{repo}") {
pullRequest(number: {pr_number}) {
reviewThreads(first: 50, after: $endCursor) {
nodes {
id
isResolved
path
comments(first: 10) {
nodes {
databaseId
body
author { login }
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
}' | jq '.data.repository.pullRequest.reviewThreads.nodes | map(select(.isResolved == false))'
gh api repos/{owner}/{repo}/issues/{pr_number}/comments --paginate
Filter for comments from coderabbitai[bot], gemini-code-assist[bot],
github-copilot[bot], devin-ai-integration[bot],
and similar bots.
Human comments: Never resolve or minimize human comments. You may reply
to push back if incorrect, or ask for clarification - but leave the thread
open for the human to resolve.
-
For each bot comment (review or issue), analyze the suggestion and decide:
- Accept: If the suggestion improves code quality, correctness, or follows
our patterns
- Push back: If the suggestion doesn't apply, is incorrect, or conflicts
with our conventions (documented in CLAUDE.md files)
-
Reply to each comment:
For review comments, use in_reply_to to thread the reply:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-X POST \
-f body="[response]
CC on behalf of @{username}" \
-f commit_id="{commit_sha}" \
-f path="{file_path}" \
-F in_reply_to={comment_id}
For issue comments (top-level PR comments), reply on the issue thread:
gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
-X POST \
-f body="[response]
CC on behalf of @{username}"
-
Resolve addressed bot review threads using GraphQL (never resolve human
comments):
gh api graphql -f query='
query {
repository(owner: "{owner}", name: "{repo}") {
pullRequest(number: {pr_number}) {
reviewThreads(first: 50) {
nodes {
id
isResolved
comments(first: 1) {
nodes { databaseId }
}
}
}
}
}
}'
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "{thread_id}"}) {
thread { isResolved }
}
}'
-
Minimize (hide) other addressed bot issue comments using GraphQL.
Some bots post as issue comments instead of review comments. These
cannot be "resolved" like review threads; instead, minimize them:
gh api graphql -f query='
mutation {
minimizeComment(input: {
subjectId: "{comment_node_id}",
classifier: RESOLVED
}) {
minimizedComment { isMinimized }
}
}'
Only minimize bot comments you have already addressed (accepted or
pushed back on). Never minimize human comments.
-
Check nitpick suggestions (marked with [nitpick] or similar) -
these should also be addressed, not ignored.
-
Implement accepted suggestions:
- Make the code changes for suggestions you agreed with
- Group related changes logically
-
Check review bot status:
Before considering this round clean, verify that all review
bot checks have completed:
gh pr checks $(gh pr view --json number -q '.number') \
--json name,state \
| jq '[.[] | select(
(.name | test("coderabbit|copilot|gemini|devin"; "i"))
and (.state | IN("PENDING","QUEUED","REQUESTED",
"WAITING","IN_PROGRESS"))
)]'
If any review bot checks are still in a non-terminal state,
this round is not clean even if there are zero unresolved
comments. Report pending_bots and stop.
-
Check and fix failing CI:
gh run list --branch $(git branch --show-current) --limit 5 \
--json status,conclusion,name,databaseId
gh run view {run_id} --log-failed
- If CI is failing, read the logs and fix the root cause
- Common failures: formatting (run
bun run format with --write),
lint errors, type errors, test failures
- Fix the issues in code, don't just suppress them
-
Run quality checks:
Run the quality checks for the project (using ruff format,
ruff check, ty for Python, bun run lint, bun run format,
bun run typecheck for TypeScript).
-
Commit and push:
- Create a commit with a message like
fix: address review comments
- Push to the current branch
- If you pushed new commits in this step, return
pending_bots
in the final status because CI and review bots need to run on
the new commit
-
Report one round status and stop:
Return exactly one of:
clean: no actionable bot comments remain, review bot checks are
complete, and CI is green
pending_bots: review bots have not finished yet, or new
commits were just pushed and checks are re-running
needs_changes: actionable bot comments remain
failing_ci: CI is failing and still needs fixes
If the round is clean and the PR is currently a draft, mark it as
ready for review:
gh pr ready
If the round is not clean, summarize what remains and stop. A
caller may invoke /rabbit-round again later.