Prompt file imported from asabocinski/bravo-edd (
.codex/prompts/review.md). Copyright stays with the author.
Review Command
Dual AI code review with CodeRabbit + Claude Code for maximum coverage
Usage
/review # Review all changes vs main
/review uncommitted # Review only uncommitted changes
/review committed # Review only committed changes
/review --base develop # Compare to specific branch
/review --quick # CodeRabbit only (faster)
/review --deep # Claude only (no CodeRabbit)
Overview
This command orchestrates a dual AI review combining:
| Reviewer | Strengths |
|---|---|
| CodeRabbit | Static analysis, security scanning (Gitleaks, Semgrep), linting (Ruff, Pylint), pattern detection |
| Claude | Architectural review, business logic, design patterns, contextual understanding |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DUAL AI REVIEW PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββ βββββββββββββββββ β
β β CodeRabbit β β Claude β β
β β CLI β β Code β β
β βββββββββ¬ββββββββ βββββββββ¬ββββββββ β
β β β β
β βββββββββΌββββββββ βββββββββΌββββββββ β
β β β’ Security β β β’ Architectureβ β
β β β’ Linting β β β’ Logic β β
β β β’ Patterns β β β’ Design β β
β β β’ Style β β β’ Intent β β
β βββββββββ¬ββββββββ βββββββββ¬ββββββββ β
β β β β
β ββββββββββββββ¬ββββββββββββββ β
β β β
β βββββββββΌββββββββ β
β β UNIFIED β β
β β REPORT β β
β βββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Process
Step 1: Determine Scope
# Check current state
git status
git diff --stat HEAD
git log origin/main..HEAD --oneline 2>/dev/null || echo "No commits ahead of main"
Scope Selection:
| User Input | Scope |
|---|---|
/review |
All changes vs main |
/review uncommitted |
Working directory only |
/review committed |
Committed changes only |
/review --base <branch> |
Compare to specific branch |
Step 2: Run CodeRabbit Analysis
# Source shell to ensure CLI is available
source ~/.zshrc
# Check CLI availability
coderabbit --version || echo "CodeRabbit CLI not available"
# Run review based on mode
# For all changes:
coderabbit review --plain
# For uncommitted only:
coderabbit review --type uncommitted --plain
# For committed only:
coderabbit review --type committed --plain
# For specific base branch:
coderabbit review --base <branch> --plain
Note: Requires CodeRabbit GitHub App installed on the repository.
Parse CodeRabbit Output:
SEVERITY MAPPING
ββ [CRITICAL] β Must fix before merge
ββ [ERROR] β Should fix before merge
ββ [WARNING] β Recommended to fix
ββ [INFO] β Nice to have
Step 3: Run Claude Deep Analysis
Use the code-reviewer agent capabilities:
Focus Areas:
| Category | Check For |
|---|---|
| Architecture | Project pattern alignment, separation of concerns |
| Business Logic | Correct implementation, edge cases, error handling |
| Design Patterns | Project conventions, established patterns, consistency |
| Maintainability | Self-documenting code, type hints, DRY principle |
Step 4: Synthesize Findings
Combine results from both reviewers:
- Deduplicate β Same issue found by both β keep one, note "Both"
- Prioritize β Critical > Error > Warning > Info
- Categorize β Security, Quality, Performance, Style
- Action β Must fix vs Should fix vs Nice to have
Step 5: Generate Report
Output Format
## π Dual AI Review Report
**Reviewers:** CodeRabbit + Claude Code
**Scope:** {scope_description}
**Files:** {count} files, {lines} lines changed
**Date:** {timestamp}
---
### π Summary
| Source | π΄ Critical | π Error | π‘ Warning | π΅ Info |
|--------|-------------|----------|------------|---------|
| CodeRabbit | {n} | {n} | {n} | {n} |
| Claude | {n} | {n} | {n} | {n} |
| **Total** | {n} | {n} | {n} | {n} |
---
### π΄ Critical Issues
> Must fix before merge
#### [C1] {Title}
- **Source:** {CodeRabbit|Claude|Both}
- **File:** `{path}:{line}`
- **Issue:** {description}
- **Fix:**
```{lang}
{code}
π Errors
Should fix before merge
[E1] {Title}
- Source: {source}
- File:
{path}:{line} - Issue: {description}
π‘ Warnings
Recommended to fix
- [{source}]
{file}: {description}
π΅ Suggestions
- {suggestion 1}
- {suggestion 2}
β Positive Observations
- {good practice 1}
- {good practice 2}
π Action Checklist
- Fix: {critical 1}
- Fix: {critical 2}
- Consider: {warning 1}
Merge Status: {β Ready | β οΈ Fix warnings first | π« Fix critical issues}
---
## Error Handling
### CodeRabbit CLI Not Available
```text
IF coderabbit command not found:
1. Attempt: source ~/.zshrc && coderabbit --version
2. If still fails: Proceed with Claude-only review
3. Note in report: "CodeRabbit unavailable"
CodeRabbit Not Authenticated
IF authentication error:
1. Inform user: "Run 'coderabbit auth login' to authenticate"
2. Proceed with Claude-only review
3. Note in report: "CodeRabbit not authenticated"
Large Changeset
IF > 50 files changed:
1. Suggest: "Large changeset detected. Use '/review uncommitted' for faster feedback"
2. Proceed with review but note potential timeout
Quick Mode (--quick)
CodeRabbit only β for fast feedback:
/review --quick
Process:
- Run
coderabbit review --plain - Parse and format results
- Skip Claude analysis
- Return immediately
Use When:
- Quick sanity check
- Pre-commit validation
- CI/CD integration
Deep Mode (--deep)
Claude only β for thorough analysis:
/review --deep
Process:
- Skip CodeRabbit
- Full Claude analysis with all capabilities
- Detailed architectural review
- Extended recommendations
Use When:
- CodeRabbit unavailable
- Need deeper contextual analysis
- Reviewing design decisions
Integration
Before PR Creation
# Review first, then create PR
/review
# If all good:
/create-pr
With create-pr Command
# Automatically runs review before PR
/create-pr --review
In Development Loop
# Quick feedback on work in progress
/review uncommitted
# Full review before commit
git add .
/review committed
Configuration
Optionally respects .coderabbit.yaml settings (create this file if needed):
| Setting | Effect |
|---|---|
reviews.path_instructions |
Custom rules per path |
reviews.tools |
Which linters are enabled |
reviews.pre_merge_checks |
Quality gates |
Examples
Example 1: Standard Review
/review
# Output:
## π Dual AI Review Report
...
π΄ Critical: 0
π Error: 2
π‘ Warning: 5
Merge Status: β οΈ Fix errors first
Example 2: Quick Check
/review --quick uncommitted
# Output:
## CodeRabbit Quick Review
...
β
No critical issues
β οΈ 3 warnings to consider
Example 3: Branch Comparison
/review --base develop
# Output:
## π Dual AI Review Report
Comparing: HEAD vs develop
...
Tips
- Review Early β Run
/review uncommittedfrequently during development - Fix Critical First β Always address critical and error issues before PR
- Learn from Feedback β Both AIs provide educational explanations
- Use Quick Mode β For rapid iteration,
/review --quickis your friend - Pre-PR Habit β Always
/reviewbefore/create-pr
Related
- Agent:
.codex/skills/python/code-reviewer.md - Config:
.coderabbit.yaml(optional, create if needed) - Create PR:
.codex/prompts/create-pr.md
