From envoy
CodeRabbit PR reviewer expert. ALWAYS invoke when a PR has CodeRabbit comments to address or when the /envoy:coderabbit-pr-review command fires. Fixes every finding, replies and resolves each thread. Do not ignore or cherry-pick findings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/envoy:coderabbit-pr-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
!`node ${CLAUDE_SKILL_DIR}/preflight.js`
!node ${CLAUDE_SKILL_DIR}/preflight.js
Parse GitHub CodeRabbit PR comments, apply fixes, reply with commit hash, and resolve each conversation thread. Address ALL findings including nitpicks.
Announce at start: "I'm using envoy:coderabbit-pr-review to address CodeRabbit PR comments."
| Flag | Effect |
|---|---|
<pr-number> | Required: PR number to process |
# Get all review comments on the PR
OWNER=$(gh repo view --json owner -q '.owner.login')
REPO=$(gh repo view --json name -q '.name')
gh api repos/$OWNER/$REPO/pulls/<pr-number>/comments \
--jq '.[] | select(.user.login == "coderabbitai" or .user.login == "github-actions[bot]") | {id, path, line, body, created_at, in_reply_to_id}'
Use lib/coderabbit-parser.js for regex-first parsing — avoids LLM tokens for 95%+ of comments:
const { parseComments } = require('../../lib/coderabbit-parser');
const result = parseComments(comments);
// result.parsed — array of { path, line, severity, suggestion, category, confidence, needsLLM }
// result.regexRate — e.g., "96%"
If lib/coderabbit-parser.js is not available or throws an error:
Fall back to LLM parsing for ALL comments — apply the Haiku fallback below to each comment. Do not fail silently; log: "coderabbit-parser unavailable — falling back to LLM parsing for all comments."
For comments where needsLLM: true (confidence < 0.95):
Send to a Haiku agent for structured extraction (cheap fallback):
Agent({
model: "haiku",
description: "Parse CodeRabbit comment",
prompt: `Extract from this CodeRabbit comment:
- file path
- line number
- severity (critical/warning/suggestion/nitpick)
- suggested fix
Comment: <body>
Output as JSON.`
})
Group by severity but address ALL of them:
No skipping. Every finding gets addressed.
Report parsing efficiency:
Parsed 12 comments: 11 by regex (92%), 1 by Haiku fallback
For each finding, in order of severity:
# 1. Read the file at the indicated line
# 2. Understand the context and suggestion
# 3. Apply the fix
# 4. Stage and commit
git add <file>
git commit -m "fix: <brief description of fix>
Addresses CodeRabbit comment on <file>:<line>"
Important: If a suggestion is wrong or inapplicable, still reply explaining why it was not applied.
After fixing, reply to the original comment:
# Reply with fix details + commit hash
COMMIT_HASH=$(git rev-parse --short HEAD)
gh api repos/$OWNER/$REPO/pulls/<pr-number>/comments/<comment-id>/replies \
--method POST \
--field body="Fixed in \`$COMMIT_HASH\`. <explanation of what was changed>"
For suggestions not applied:
gh api repos/$OWNER/$REPO/pulls/<pr-number>/comments/<comment-id>/replies \
--method POST \
--field body="Not applied: <explanation why>. The current approach <reason>."
After replying, resolve each conversation:
# Resolve the review thread using GraphQL
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "<thread-node-id>"}) {
thread { isResolved }
}
}
'
Note: You need the thread's node ID, which may require fetching via GraphQL:
gh api graphql -f query='
query {
repository(owner: "'$OWNER'", name: "'$REPO'") {
pullRequest(number: <pr-number>) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) {
nodes { body }
}
}
}
}
}
}
'
git push
# Check for any remaining unresolved threads
UNRESOLVED=$(gh api graphql -f query='
query {
repository(owner: "'$OWNER'", name: "'$REPO'") {
pullRequest(number: <pr-number>) {
reviewThreads(first: 100) {
nodes { isResolved }
}
}
}
}
' --jq '.data.repository.pullRequest.reviewThreads.nodes | map(select(.isResolved == false)) | length')
echo "Unresolved threads: $UNRESOLVED"
**CodeRabbit PR comments addressed**
| Severity | Count | Status |
|----------|-------|--------|
| 🔴 Critical | <N> | All fixed |
| 🟡 Warning | <N> | All fixed |
| 💡 Suggestion | <N> | <N> applied, <N> explained |
| 🔵 Nitpick | <N> | All fixed |
Commits: <N> fix commits pushed
Unresolved threads: 0
No CodeRabbit comments found on PR #<number>.
CodeRabbit may still be processing. Wait 2-3 minutes and try again:
/envoy:coderabbit-pr-review <pr-number>
Could not resolve thread for comment <id>.
This may require manual resolution on GitHub.
Thread URL: <link>
envoy:finalize during the review cycleenvoy:verification to verify fixes workenvoy:receiving-code-review principles (verify before implementing)npx claudepluginhub rutgerdijk/envoy --plugin envoy-bundle-copilot-adapterGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.