home / skills / basher83 / lunar-claude / coderabbit

This skill helps you perform automated code reviews with CodeRabbit, identifying race conditions, leaks, and security issues before commits.

npx playbooks add skill basher83/lunar-claude --skill coderabbit

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
4.5 KB
---
name: coderabbit
description: >
  AI-powered code review using CodeRabbit CLI and GitHub integration. Use when running
  local code reviews before commits ("run coderabbit", "review my changes"), configuring
  .coderabbit.yaml files, integrating CodeRabbit with Claude Code for autonomous review
  workflows, using @coderabbitai commands in pull requests, or setting up automated
  code review pipelines.
---

# CodeRabbit

AI code review tool that catches race conditions, memory leaks, and security vulnerabilities.
Integrates with Claude Code for autonomous review-and-fix workflows.

## Quick Start: Claude Code Integration

Run CodeRabbit as part of your development workflow:

```text
Implement the feature from the spec, then run coderabbit --prompt-only
in the background and fix any issues found.
```

Key flags for Claude Code:

- `--prompt-only` - Minimal output optimized for AI agents
- `--plain` - Plain text mode (no interactive UI)
- `--type uncommitted` - Review only uncommitted changes

## CLI Commands

```bash
# Install
curl -fsSL https://cli.coderabbit.ai/install.sh | sh

# Authenticate (run once per Claude Code session)
coderabbit auth login

# Review code
coderabbit                          # Interactive mode
coderabbit --plain                  # Plain text output
coderabbit --prompt-only            # AI-optimized output
coderabbit --type uncommitted       # Only uncommitted changes
coderabbit --base develop           # Compare against develop branch
```

## Claude Code Workflow

Recommended prompt pattern:

```text
Please implement [feature] and then run coderabbit --prompt-only,
let it run as long as it needs (run it in the background) and fix any issues.
```

CodeRabbit reviews take 7-30+ minutes. Run in background and check periodically.

**Fix prioritization:** Fix critical issues first, ignore nits. Run CodeRabbit
again after fixes to verify no new issues introduced. Limit to 2 iterations.

## GitHub Commands

Use `@coderabbitai` in PR comments:

| Command | Description |
|---------|-------------|
| `@coderabbitai review` | Incremental review of new changes |
| `@coderabbitai full review` | Complete review from scratch |
| `@coderabbitai pause` | Stop automatic reviews |
| `@coderabbitai resume` | Restart reviews |
| `@coderabbitai summary` | Regenerate PR summary |
| `@coderabbitai generate docstrings` | Generate function docs (Pro) |
| `@coderabbitai generate unit tests` | Generate tests (Pro) |
| `@coderabbitai resolve` | Resolve all CR comments |
| `@coderabbitai configuration` | Show current settings |

Add `@coderabbitai ignore` to PR **description** to disable reviews for that PR.

## Configuration (.coderabbit.yaml)

```yaml
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US
tone_instructions: "Be concise and focus on critical issues only"

reviews:
  profile: chill  # or "assertive" for comprehensive feedback
  high_level_summary: true
  auto_review:
    enabled: true
    drafts: false
    ignore_title_keywords:
      - "wip"
      - "draft"

knowledge_base:
  code_guidelines:
    enabled: true
    filePatterns:
      - "**/.cursorrules"
      - "**/claude.md"
```

CodeRabbit auto-reads `claude.md` and `.cursorrules` for coding standards.

## Supported Tools

CodeRabbit integrates 40+ linters and security analyzers:

- **JavaScript/TypeScript:** ESLint, Biome, Oxlint
- **Python:** Ruff, Pylint, Flake8
- **Go:** golangci-lint
- **Security:** Gitleaks, Semgrep, OSV Scanner
- **Infrastructure:** Checkov, Hadolint
- **CI/CD:** actionlint, CircleCI

**Full tools reference:** See [references/tools-reference.md](references/tools-reference.md)

## Troubleshooting

**CodeRabbit not finding issues:**

1. Check auth: `coderabbit auth status`
2. Verify git status: `git status`
3. Specify review type: `--type uncommitted`
4. Specify base branch: `--base develop`

**Claude Code not applying fixes:**

1. Use `--prompt-only` mode
2. Include "run in background" in prompt
3. Explicitly ask to "fix issues found by CodeRabbit"

## References

- **Overview:** [references/overview.md](references/overview.md)
- **Claude Code Integration:** [references/claude-code-integration.md](references/claude-code-integration.md)
- **YAML Configuration:** [references/yaml-configuration-guide.md](references/yaml-configuration-guide.md)
- **GitHub Commands:** [references/github-commands.md](references/github-commands.md)
- **Tools Reference:** [references/tools-reference.md](references/tools-reference.md)
- **Full Configuration:** [references/configuration.md](references/configuration.md)

Overview

This skill provides AI-powered code review using the CodeRabbit CLI with optional GitHub integration and Claude Code orchestration. It helps catch race conditions, memory leaks, security vulnerabilities, and other defects before commits or in pull requests. Use it locally or as part of autonomous review-and-fix workflows driven by Claude Code.

How this skill works

Run the CodeRabbit CLI to analyze uncommitted changes, compare branches, or perform full repository scans. Use flags like --prompt-only for AI-optimized output, --plain for machine-friendly text, and --type uncommitted to limit scope. Integrate with Claude Code by running CodeRabbit in the background so agents can read its prompts and apply fixes, or use @coderabbitai commands on GitHub to trigger automated PR reviews and summaries.

When to use it

  • Before committing local changes: run coderabbit or coderabbit --type uncommitted
  • As part of an autonomous Claude Code workflow to implement and verify features
  • During pull request reviews using @coderabbitai commands for incremental or full reviews
  • When configuring repository review behavior via a .coderabbit.yaml file
  • To generate docstrings or unit tests using Pro @coderabbitai commands

Best practices

  • Run CodeRabbit in the background with --prompt-only when using Claude Code so agents can iterate autonomously
  • Prioritize fixing critical issues first and ignore nits on the first pass; limit to two review-fix iterations
  • Keep a concise .coderabbit.yaml to control tone, profiles, and auto-review rules (ignore wip/draft titles)
  • Authenticate once per Claude Code session with coderabbit auth login and verify auth status when troubleshooting
  • Use plain or prompt-only output for CI or agent consumption to avoid interactive UI artifacts

Example use cases

  • Local pre-commit scan: developer runs coderabbit --type uncommitted to catch regressions before pushing
  • Claude Code autonomous loop: prompt the agent to implement a feature and run coderabbit --prompt-only in background to detect and fix issues
  • GitHub PR automation: add @coderabbitai review in PR comments for incremental feedback or @coderabbitai full review for a fresh analysis
  • CI pipeline step: run coderabbit --plain to produce machine-readable findings and fail builds on high-severity issues
  • Repository configuration: add .coderabbit.yaml to set review profile, auto-review rules, and knowledge base inclusion

FAQ

How long do reviews take?

CodeRabbit reviews typically run 7–30+ minutes depending on repo size and enabled analyzers; run it in background and check periodically.

What CLI flags are essential for agent workflows?

Use --prompt-only for AI-optimized output and --plain for machine-friendly logs; combine --type uncommitted to limit scope.

How do I disable reviews for a specific PR?

Add @coderabbitai ignore to the PR description to prevent automatic reviews on that PR.