Process and resolve CodeRabbit automated PR review comments. Use when the user says "check rabbit review", "handle coderabbit comments", "resolve rabbit feedback", or mentions CodeRabbit PR comments. Also use after PR creation when CodeRabbit has left automated review comments.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Process and resolve CodeRabbit's automated PR review comments systematically.
NEVER leave new comments directly on GitHub PRs. This is strictly forbidden:
gh pr review --comment - FORBIDDENgh pr comment - FORBIDDENPermitted operations:
addPullRequestReviewThreadReplyresolveReviewThreadUSE THIS SKILL PROACTIVELY when ANY of the following occur:
pr-reviewer agent completesCodeRabbit comments follow a structured markdown format:
_๐งน Nitpick_ | _๐ต Trivial_ <- Severity indicator (optional)
[Main feedback text]
<details>
<summary>๐ก Optional suggestion</summary>
[Expanded suggestion content]
</details>
<details>
<summary>๐ Committable suggestion</summary>
[Code block with suggested changes]
</details>
<details>
<summary>๐ค Prompt for AI Agents</summary>
[Explicit instructions for AI to follow]
</details>
Key elements to extract:
_๐งน Nitpick_ or _๐ต Trivial_ = auto-resolvableCRITICAL: Load the fx-dev:github skill FIRST before running any GitHub API operations. This skill provides essential patterns and error handling for gh CLI commands.
Before processing feedback, ensure CodeRabbit is configured to read .github/copilot-instructions.md.
CodeRabbit's knowledge_base.code_guidelines feature reads instruction files to understand project conventions. By default, it includes .github/copilot-instructions.md, but this may be disabled or overridden.
# Check if .coderabbit.yaml exists
if [ -f ".coderabbit.yaml" ]; then
cat .coderabbit.yaml
else
echo "No .coderabbit.yaml found - using defaults"
fi
| State | Action |
|---|---|
No .coderabbit.yaml exists | Defaults apply - .github/copilot-instructions.md IS read automatically |
Config exists with knowledge_base.code_guidelines.enabled: false | Update to enabled: true |
Config exists with custom filePatterns missing copilot-instructions.md | Add .github/copilot-instructions.md to filePatterns |
| Config exists with defaults or explicit copilot-instructions.md | No action needed |
If configuration needs updating, create or modify .coderabbit.yaml:
# .coderabbit.yaml
# Ensures CodeRabbit reads project conventions from copilot-instructions.md
knowledge_base:
code_guidelines:
enabled: true
# Default patterns include .github/copilot-instructions.md
# Add explicit pattern if using custom filePatterns:
# filePatterns:
# - .github/copilot-instructions.md
# - CLAUDE.md
Minimal config to ensure copilot-instructions.md is read:
knowledge_base:
code_guidelines:
enabled: true
This enables the default file patterns which include .github/copilot-instructions.md.
If CodeRabbit feedback conflicts with project conventions (INCORRECT category), update .github/copilot-instructions.md with the correct pattern. Since CodeRabbit reads this file, future reviews will respect the documented conventions.
Query review threads using GraphQL.
IMPORTANT: Use inline values, NOT $variable syntax. The $ character causes shell escaping issues (Expected VAR_SIGN, actual: UNKNOWN_CHAR).
# Replace OWNER, REPO, PR_NUMBER with actual values
gh api graphql -f query='
query {
repository(owner: "OWNER", name: "REPO") {
pullRequest(number: PR_NUMBER) {
reviewThreads(first: 100) {
nodes {
id
isResolved
path
line
comments(first: 10) {
nodes {
author { login }
body
}
}
}
}
}
}
}'
Filter for: isResolved: false AND author login contains coderabbitai
For each unresolved CodeRabbit comment:
| Category | Indicator | Action |
|---|---|---|
| Nitpick/Trivial | Contains _๐งน Nitpick_ or _๐ต Trivial_ | Auto-resolve immediately |
| Actionable with AI Prompt | Has ๐ค Prompt for AI Agents section | Extract prompt, delegate to coder |
| Actionable with Committable | Has ๐ Committable suggestion | Apply suggestion directly |
| General Feedback | No special sections | Analyze and delegate to coder |
When a comment contains ๐ค Prompt for AI Agents, extract and use it directly:
<summary>๐ค Prompt for AI Agents</summary> and the closing </details>Example extraction:
In src/lib/view-config.ts around lines 115 to 118, expand the JSDoc above
NUMERIC_OPERATORS to explicitly state that operators in this set expect numeric
values...
๐ Committable suggestion section.github/copilot-instructions.md to document the correct patternknowledge_base.code_guidelines)Use GraphQL mutation to resolve each processed thread.
IMPORTANT: Use inline values, NOT $variable syntax.
# Replace THREAD_ID with actual thread ID (e.g., PRRT_kwDONZ...)
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "THREAD_ID"}) {
thread { isResolved }
}
}'
For feedback that conflicts with conventions or is being declined.
IMPORTANT: Use inline values, NOT $variable syntax.
# Replace THREAD_ID and message with actual values
gh api graphql -f query='
mutation {
addPullRequestReviewThreadReply(input: {
pullRequestReviewThreadId: "PRRT_xxx",
body: "Your explanation here"
}) {
comment { id }
}
}'
To extract the AI prompt from a CodeRabbit comment:
# Extract content between ๐ค Prompt for AI Agents and </details>
echo "$COMMENT_BODY" | sed -n '/๐ค Prompt for AI Agents/,/<\/details>/p' | sed '1d;$d' | sed 's/^```$//'
Task is INCOMPLETE until ALL of these are done:
.github/copilot-instructions.md.github/copilot-instructions.md updated to prevent recurrenceisResolved: true for all processed threads| Thread ID | File:Line | Category | Action Taken | Status |
|-----------|-----------|----------|--------------|--------|
| PRRT_xxx | src/foo.ts:42 | Nitpick | Auto-resolved | Resolved |
| PRRT_yyy | src/bar.ts:15 | AI Prompt | Applied JSDoc fix | Resolved |
| PRRT_zzz | lib/util.js:8 | Committable | Applied suggestion | Resolved |