From coderabbit-pack
Sets up CodeRabbit CLI for local pre-commit AI code reviews on staged changes, git hooks, and interactive feedback. Use for integrating reviews into git commit workflows.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin coderabbit-packThis skill is limited to using the following tools:
Use CodeRabbit CLI to review code locally before opening a PR. The CLI provides the same AI-powered review as the GitHub App but runs in your terminal against staged or unstaged changes. This creates a multi-layered review process: local CLI review before commit, then automated PR review after push.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Use CodeRabbit CLI to review code locally before opening a PR. The CLI provides the same AI-powered review as the GitHub App but runs in your terminal against staged or unstaged changes. This creates a multi-layered review process: local CLI review before commit, then automated PR review after push.
curl -fsSL https://cli.coderabbit.ai/install.sh | sh).coderabbit.yaml configurationset -euo pipefail
# Install CodeRabbit CLI
curl -fsSL https://cli.coderabbit.ai/install.sh | sh
# Verify installation
cr --version
# Authenticate (opens browser for OAuth)
cr auth login
set -euo pipefail
# Review all staged changes (most common workflow)
git add -A
cr review
# Review specific files only
cr review src/api/routes.ts src/middleware/auth.ts
# Interactive mode: ask follow-up questions about review feedback
cr review --interactive
# Plain output mode (pipe to other tools or AI agents)
cr review --prompt-only
#!/bin/bash
# .git/hooks/pre-push (make executable: chmod +x .git/hooks/pre-push)
set -euo pipefail
echo "Running CodeRabbit pre-push review..."
# Get list of changed files vs remote
CHANGED_FILES=$(git diff --name-only @{push}.. 2>/dev/null || git diff --name-only HEAD~1)
if [ -n "$CHANGED_FILES" ]; then
echo "$CHANGED_FILES" | xargs cr review
# Non-blocking: show review but don't prevent push
# To make blocking, check exit code:
# echo "$CHANGED_FILES" | xargs cr review || {
# echo "CodeRabbit found issues. Push anyway? (y/n)"
# read -r response
# [ "$response" != "y" ] && exit 1
# }
fi
# .coderabbit.yaml - Settings that affect both CLI and PR reviews
language: "en-US"
reviews:
profile: "assertive"
path_instructions:
- path: "src/**"
instructions: "Check for proper error handling and type safety."
- path: "tests/**"
instructions: "Verify edge cases and assertion completeness."
path_filters:
- "!**/*.lock"
- "!dist/**"
- "!**/*.generated.*"
auto_review:
enabled: true
drafts: false
chat:
auto_reply: true
// .vscode/tasks.json - Run CodeRabbit review from VS Code
{
"version": "2.0.0",
"tasks": [
{
"label": "CodeRabbit: Review Current File",
"type": "shell",
"command": "cr review ${file}",
"presentation": { "reveal": "always", "panel": "shared" },
"problemMatcher": []
},
{
"label": "CodeRabbit: Review Staged Changes",
"type": "shell",
"command": "cr review",
"presentation": { "reveal": "always", "panel": "shared" },
"problemMatcher": []
}
]
}
Developer writes code
│
▼
┌──────────────────┐
│ cr review (local) │ ← Layer 1: Fast feedback before commit
│ Fix obvious issues│
└────────┬─────────┘
│
▼
git commit + push
│
▼
┌──────────────────┐
│ CodeRabbit App │ ← Layer 2: Full context review on PR
│ (automated PR │
│ review) │
└──────────────────┘
| Issue | Cause | Solution |
|---|---|---|
cr: command not found | CLI not in PATH | Re-run install script or add to PATH |
| Auth token expired | Session timeout | Run cr auth login again |
| "No credits remaining" | Usage-based billing exhausted | Purchase credits at app.coderabbit.ai |
| Review hangs on large file | File too large for AI context | Review specific files instead of all |
| Empty review output | No changed files detected | Stage changes with git add first |
See coderabbit-sdk-patterns for PR interaction automation patterns.