From rabbit-pr
Address CodeRabbit (or similar bot) review comments on a PR. Use when the user says "rabbit-pr", "rabbit-pr-fix", "fix review comments", "address PR feedback", "check coderabbit comments", or asks to verify and fix automated review comments on a pull request. Accepts an optional PR number; otherwise auto-detects from the current branch. Fetches comments, builds a checklist, verifies each against code, applies fixes, resolves conflicts, pushes, replies, and resolves threads.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rabbit-pr:rabbit-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Address automated review comments (CodeRabbit, etc.) on a pull request.
Address automated review comments (CodeRabbit, etc.) on a pull request.
gh pr list --head $(git branch --show-current) --json number --jq '.[0].number'gh pr view <number> --json title,headRefName,baseRefName,state,mergeable,mergeStateStatus
# Inline file-level comments
gh api repos/{owner}/{repo}/pulls/<number>/comments
# Review-level comments (body of each review — often contains actionable feedback)
gh api repos/{owner}/{repo}/pulls/<number>/reviews
Important: Comments can live in two places:
/comments): attached to specific file lines/reviews): top-level review summary text, often containing actionable items not tied to specific linesFetch both. Filter reviews to those with a non-empty body and state of CHANGES_REQUESTED or COMMENTED. Parse review bodies for actionable items (look for bullet points, code suggestions, or imperative statements).
Skip already-handled comments. For each inline comment, check whether the authenticated user (gh api user --jq .login) already has a reply in its thread — if so, skip it. Otherwise the skill will double-reply when re-run on the same PR.
Classify CodeRabbit severity. CodeRabbit tags items with markers like _⚠️ Potential issue_, _🛠️ Refactor suggestion_, _🧹 Nitpick_. Prioritize Potential issue and Refactor suggestion; treat Nitpick as optional unless the user explicitly asks to address them.
Skip resolved threads. Use the GraphQL API to fetch thread resolution state and skip resolved ones:
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=<owner> -F repo=<repo> -F num=<number>
Before doing any work, build a single checklist covering every comment to be processed (inline + review body items, after filtering out resolved/already-replied/nitpick-if-skipped). For each entry capture:
review-body-<reviewId>-<n> for review body items)path:line or review bodyfix needed, reply needed, both, doneRender it to the user as a markdown checklist (- [ ] ...) and use TodoWrite to track it. Update the checklist after every action (verify, fix, push, reply, resolve). Show the final checklist state to the user before closing out the workflow in step 9.
git checkout <headRefName>
git pull
For inline comments:
For review body items:
For each entry, mark verdict in the checklist:
valid → keep fix needed / bothalready fixed → flip to reply needed (acknowledge in reply)not applicable → flip to reply needed (explain why we're declining)done for the fix portion as you finish it)Check mergeStateStatus:
BEHIND: git merge <baseRefName> --no-editCONFLICTING: merge and resolve conflicts manuallyCLEAN: skipgit add <changed-files>
git commit -m "<prefix>: address review feedback on <PR-title-summary>"
git push origin <headRefName>
git log --oneline -20 first. Some repos use fix:, others use no prefix, others use ticket IDs. Don't hard-code fix:.headRepositoryOwner.login from gh pr view. If it differs from the base repo owner, the push target is the fork remote, not origin. Either add the fork as a remote or skip the push step and tell the user to push manually.Batch all replies into a single bash command to minimize user confirmations. Chain all gh api calls in one Bash invocation:
&& when each reply must succeed before continuing (rare).; for best-effort: a single failed reply (e.g., 404 on a deleted comment) shouldn't abort the rest.gh api repos/{owner}/{repo}/pulls/<number>/comments/<id1>/replies -f body="..." ; \
gh api repos/{owner}/{repo}/pulls/<number>/comments/<id2>/replies -f body="..." ; \
gh pr comment <number> --body "..."
gh api repos/{owner}/{repo}/pulls/<number>/comments/<id>/replies -f body="..."gh pr comment <number> --body "..." referencing the review and listing what was addressedEach reply should include:
Resolve threads after replying. For each thread we addressed, resolve it via GraphQL (use the reviewThreads.nodes[].id collected in step 2):
gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -F id=<threadId>
Mark each checklist item done after its reply (and resolve, if applicable) succeeds.
Before closing out, render the final checklist state to the user as a markdown checklist showing every comment with its final status (done, or skipped — <reason> for nitpicks/already-replied/resolved). Include:
Do not consider the workflow complete until the user has seen this final state.
git logCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub dinhnguyen/claude-plugins --plugin rabbit-pr