AI Code Review
PR-Agent (Qodo Merge)
Commands
| Command | Purpose |
|---|---|
/describe |
Auto-generate PR title, description, labels |
/review |
Deep code review (logic, security, style) |
/improve |
Committable code suggestions |
/ask <q> |
Interactive Q&A about changes |
/test |
Suggest test cases |
/add_docs |
Generate docstrings |
Configuration (.pr_agent.toml)
[github_app]
pr_commands = ["/describe", "/review", "/improve --commitable_code_suggestions=true"]
[pr_reviewer]
extra_instructions = "Focus on error handling and null checks."
require_security_review = true
num_code_suggestions = 4
[pr_code_suggestions]
commitable_code_suggestions = true
GitHub Actions
name: PR-Agent
on:
pull_request:
types: [opened, reopened, ready_for_review]
jobs:
pr_agent:
runs-on: ubuntu-latest
steps:
- uses: qodo-ai/pr-agent@main
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CodeRabbit
Configuration (.coderabbit.yaml)
reviews:
profile: chill
high_level_summary: true
path_instructions:
- path: "src/api/**"
instructions: "Check error handling, auth, rate limiting."
- path: "**/*.test.*"
instructions: "Verify edge cases and assertion quality."
auto_review:
enabled: true
base_branches: [main, develop]
Chat Commands
@coderabbitai review— trigger full review@coderabbitai resolve— resolve all conversations@coderabbitai generate docstrings— add docstrings
GitHub Copilot Code Review
Setup
- Settings > Copilot > Code Review > Enable automatic review
- Optionally enable "Review new pushes" and "Review draft PRs"
Custom Instructions
.github/copilot-instructions.md:
- All public functions must have JSDoc
- Error handling: use custom error types
- Database queries must be parameterized
- Max function length: 50 lines
CLI
gh pr create --reviewer copilot
gh pr edit 123 --add-reviewer copilot
Best Practices
- Layer AI + human — AI as first pass, humans for architecture
- Customize instructions — tailor to team standards
- Path-based rules — different standards per directory
- Start small — 10-20 specific rules, iterate
- Integrate with CI — auto-trigger on PR creation