SKILL.md
CodeRabbit Reference Architecture
Overview
Complete reference architecture for CodeRabbit AI code review in a production team. Covers the full configuration file, path-specific review instructions per project type, tool integrations, CI pipeline integration, and the review lifecycle. Use this as a starting template and customize for your team.
Architecture Diagram
Developer pushes code
│
▼
┌─────────────────────────┐
│ Pull Request │
│ (targets base branch) │
└─────────┬───────────────┘
│
▼
┌─────────────────────────┐
│ CodeRabbit AI Review │
│ Reads: .coderabbit.yaml│
│ from base branch │
│ │
│ Outputs: │
│ ├── Walkthrough summary│
│ ├── Sequence diagrams │
│ ├── Line-level comments│
│ └── Review state │
└─────────┬───────────────┘
│
┌─────┴──────┐
│ │
▼ ▼
┌────────┐ ┌────────────┐
│ APPROVED│ │ CHANGES │
│ │ │ REQUESTED │
└────┬───┘ └─────┬──────┘
│ │
▼ ▼
Merge Developer fixes
(if branch and pushes
protection (incremental
passes) re-review)
Instructions
Step 1: Full Reference Configuration
# .coderabbit.yaml - Production Reference Architecture
# Copy this file and customize for your project.
language: "en-US"
early_access: false
# Tone customization
tone_instructions: |
Be concise and direct. Use bullet points for multiple suggestions.
Include code examples for non-obvious fixes.
Rate severity: Critical > Warning > Suggestion > Nitpick.
reviews:
# Review behavior
profile: "assertive"
request_changes_workflow: true
high_level_summary: true
high_level_summary_in_walkthrough: true
review_status: true
collapse_walkthrough: false
sequence_diagrams: true
poem: false
# Automatic review triggers
auto_review:
enabled: true
drafts: false
base_branches:
- main
- develop
- "release/*"
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
- "chore: bump"
- "chore(deps)"
# File exclusions (skip files with no review value)
path_filters:
- "!**/*.lock"
- "!**/package-lock.json"
- "!**/pnpm-lock.yaml"
- "!**/yarn.lock"
- "!**/*.snap"
- "!**/*.generated.*"
- "!**/generated/**"
- "!dist/**"
- "!build/**"
- "!**/*.min.js"
- "!**/*.min.css"
- "!vendor/**"
- "!**/__mocks__/**"
- "!**/fixtures/**"
# Path-specific review instructions
path_instructions:
# API layer
- path: "src/api/**"
instructions: |
Review for:
- Input validation on all request parameters
- Proper HTTP status codes (don't use 200 for errors)
- Auth middleware applied to protected routes
- Error response format (consistent structure)
- Rate limiting on public endpoints
Flag: missing error handling, unvalidated input, SQL injection
# Database layer
- path: "src/db/**"
instructions: |
Review for:
- Parameterized queries (no string concatenation in SQL)
- Transaction boundaries on multi-table mutations
- Connection cleanup (no connection leaks)
- Index usage for complex queries
Flag: N+1 query patterns, raw SQL with user input
# Authentication
- path: "src/auth/**"
instructions: |
SECURITY-CRITICAL. Review for:
- Password hashing (bcrypt/argon2 only, never MD5/SHA)
- Token expiry configuration
- Session management and fixation prevention
- CSRF protection on state-changing operations
- Brute force protection
# Frontend components
- path: "src/components/**"
instructions: |
Review for:
- Accessibility (aria labels, keyboard navigation, screen reader support)
- Performance (memoization, lazy loading, bundle size impact)
- Proper state management (no prop drilling beyond 2 levels)
Ignore: CSS naming conventions, import order
# Tests
- path: "**/*.test.*"
instructions: |
Review for:
- Assertion completeness (not just checking status codes)
- Edge case coverage (null, empty, boundary values)
- Proper async handling (await, done callbacks)
- Test isolation (no shared mutable state)
Do NOT comment on: test naming conventions, import order
# CI/CD pipelines
- path: ".github/workflows/**"
instructions: |
Review for:
- Pin action versions to SHA commit hash (not tags)
- No secrets in step names, echo, or log output
- timeout-minutes on all jobs
- Use OIDC for cloud provider auth
- Minimal permissions on GITHUB_TOKEN
# Infrastructure
- path: "**/*.tf"
instructions: |
Review for:
- No hardcoded credentials or keys
- Encryption enabled on storage and databases
- Security groups: no 0.0.0.0/0 ingress except 443
- IAM: least privilege, no wildcard actions
# Finishing touches (Pro+)
finishing_touches:
docstrings:
enabled: true
# Linter tool integrations
tools:
eslint:
enabled: true
biome:
enabled: true
shellcheck:
enabled: true
markdownlint:
enabled: true
chat:
auto_reply: true
