From codereview
Resolve CodeRabbit review comments on a GitHub PR. Extracts all review comments from coderabbitai[bot], creates a structured checklist with checkboxes, verifies each finding against current code, applies fixes when needed, runs regression tests, and resolves GitHub conversations. Use this skill whenever the user mentions coderabbit, wants to fix or resolve coderabbit comments, address PR review feedback from CodeRabbit, handle coderabbit findings, process coderabbit suggestions, or triage coderabbit bot comments — even if they say it casually like "fix coderabbit" or "resolve the PR comments". Triggers: "coderabbit", "coderabbit review", "fix coderabbit", "coderabbit PR", "resolve coderabbit", "address coderabbit", "coderabbit comments", "fix PR review", "resolver comentarios do coderabbit", "corrigir coderabbit"
How this skill is triggered — by the user, by Claude, or both
Slash command
/codereview:coderabbit_prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```text
$ARGUMENTS
Parse the user input before proceeding:
49 or #49--skip-tests — skip Phase 4 (regression testing)--dry-run — verify only, do not apply fixesIf $ARGUMENTS is empty or does not contain a PR number, ask: "What is the PR number containing the CodeRabbit comments?"
Extract all review comments left by CodeRabbit (coderabbitai[bot]) on a GitHub PR, create a structured checklist file (coderabbit-review.md), verify each comment against the current code, fix valid issues, run regression tests, and resolve all GitHub conversations. Every item ends resolved with a justification.
This skill is project-agnostic — it works with any repo that has a GitHub remote and CodeRabbit reviews.
MODIFIES CODE: This skill reads CodeRabbit comments, verifies issues, and applies fixes. It creates one tracking file (coderabbit-review.md) in the project root.
Git awareness: All fixes are made on the current branch. The skill does NOT create commits — the user decides when to commit.
Scope discipline: Only fix issues raised by CodeRabbit. Do not introduce unrelated refactors, improvements, or style changes.
Error Handling:
gh CLI not available or not authenticated: Stop with: "The gh CLI is not installed or authenticated. Run gh auth login before using this skill."[x] File removed — not applicable.[x] Not locatable in current code — requires manual review.Verify gh is available and authenticated:
gh auth status
Detect the repo:
gh repo view --json nameWithOwner -q '.nameWithOwner'
Capture the result as REPO (format: owner/repo).
CodeRabbit posts comments in two places — both must be fetched to get the complete picture:
# Source 1: Inline review comments (file-level, attached to diff lines)
# These are the comments directly on code lines — typically 2-5 per review
gh api "repos/{REPO}/pulls/{PR_NUMBER}/comments" --paginate \
--jq '.[] | select(.user.login == "coderabbitai[bot]") | {path, line: (.line // .original_line), body}'
# Source 2: Review-level comments (summary body with ALL findings)
# CRITICAL: This is where CodeRabbit puts the MAJORITY of its findings.
# The review body contains a summary with "Actionable comments posted: N"
# followed by an "Outside diff range comments" section that lists 10-30+
# additional findings that couldn't be posted inline.
gh api "repos/{REPO}/pulls/{PR_NUMBER}/reviews" --paginate \
--jq '.[] | select(.user.login == "coderabbitai[bot]") | {state, body}'
If the output is very large, use --jq filtering to extract only what is needed rather than loading raw JSON into context.
Source 1 — Inline comments: Extract for each one:
path: file path relative to repo rootline: line number (use line or fallback to original_line)**...**) or heading in the body✅ Addressed or similar markers, set pre_addressed: truesuggestion or diff, extract itSource 2 — Review body (outside-diff-range comments):
This is the most important source to parse correctly. CodeRabbit's review body contains a structured summary with findings grouped by file inside <details> blocks. The typical structure is:
> ⚠️ Outside diff range comments (N)
>
> <details>
> <summary>packages/path/to/file.ts (2)</summary>
>
> `42-50`: _🛠️ Refactor suggestion_ | _🟠 Major_
>
> **Title of the finding**
>
> Description of the issue...
>
> `112-120`: _⚠️ Potential issue_ | _🔴 Critical_
>
> **Another finding title**
>
> ...
> </details>
Parse each finding from the review body by:
<summary>packages/path/file.ext (N)</summary> blocks`LINES`: _CATEGORY_ | _SEVERITY_ followed by **TITLE**<summary> tag, lines from the backtick-quoted rangeSeverity Mapping (applies to both sources):
| CodeRabbit Marker | Severity |
|---|---|
🔴 or Critical | CRITICAL |
🟠 or Major | HIGH |
🟡 or Medium | MEDIUM |
🔵 or Minor / Low | LOW |
Refactor suggestion | MEDIUM |
Potential issue | Depends on paired severity emoji |
| No marker found | MEDIUM (default) |
Deduplication: Some inline comments also appear in the review body. Deduplicate by matching file path + line range + first 100 chars of title.
Discard: Comments that are purely metadata (walkthrough summaries, paused review notices, "Actionable comments posted" headers) — keep only actionable review findings.
Store as a structured list ordered by: severity (CRITICAL first) then file path.
If the total count after filtering is 0, stop with the "no comments" error.
Generate coderabbit-review.md in the project root following the structure defined in references/checklist-template.md.
Key points:
- [ ]), sequential number, severity tag, file:line, and titleProcess each checklist item. Group items by file to minimize file reads.
Read the current code at the referenced file and line (with ~30 lines of context)
Evaluate: Does the issue described still exist in the current code?
Decide:
| Situation | Action | Checklist Status |
|---|---|---|
| Issue does not exist (already fixed or code rewritten) | None | [x] — "Already fixed" |
| Issue exists, CodeRabbit suggestion is valid | Apply the fix | [x] — "Fixed" |
| Issue exists, better fix available | Apply alternative fix | [x] — "Fixed (alternative approach: {reason})" |
| Issue exists but code is actually correct | None | [x] — "Not applicable: {reason}" |
--dry-run mode | None (verify only) | [x] — "Verified: {needs fix / already fixed / not applicable}" |
Update the checklist file after each item (incremental progress)
Skip if --skip-tests was passed.
| Priority | Detection | Command |
|---|---|---|
| 1 | package.json has scripts.test | npm test |
| 2 | Monorepo with multiple package.json | npm test in each package with modified files |
| 3 | *.sln or *.csproj exists | dotnet test |
| 4 | Cargo.toml exists | cargo test |
| 5 | pyproject.toml or setup.py | pytest |
| 6 | go.mod exists | go test ./... |
| 7 | Makefile has test target | make test |
| 8 | None detected | Ask the user |
Execute the test command. Capture results.
Update the "Final Result" table in coderabbit-review.md with:
After all items are processed and tests pass, resolve all review threads on the PR.
Use the GraphQL API to get all review thread IDs and their resolution status:
gh api graphql -f query='
{
repository(owner: "{OWNER}", name: "{REPO_NAME}") {
pullRequest(number: {PR_NUMBER}) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) {
nodes {
author { login }
path
body
}
}
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {id, author: .comments.nodes[0].author.login, path: .comments.nodes[0].path}'
For each unresolved thread (from any reviewer — coderabbitai, gemini-code-assist, Copilot, etc.):
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "{THREAD_ID}"}) { thread { isResolved } } }'
Resolve threads in parallel when possible (multiple GraphQL calls).
Run the fetch query again to confirm zero unresolved threads remain. Report the count in the checklist:
### Conversations
- **Total threads**: {n}
- **Resolved in this run**: {n}
- **Previously resolved**: {n}
[x] and a justification. Never skip or ignore.npx claudepluginhub j0ruge/skills_commands_manager --plugin codereviewFetches unresolved CodeRabbit review comments from GitHub PRs and auto-fixes them interactively or in batch using GitHub CLI and git.
Fetches and processes CodeRabbit PR reviews and line comments via GitHub API for automation in custom workflows. Uses Octokit and gh CLI.
Loads GitHub PR review comments into the AI session for analysis, triage, and fix planning. Default is analysis-only; use --mode fix to enable auto-fixes.