# AI Code Review

> AI-powered code review tools -- PR-Agent (Qodo), CodeRabbit, Copilot code review, Graphite, configuration files, CI/CD integration, and best practices.

- Skill: `leolin990405/ai-code-review` (Agent Skill)
- Install (CLI): `npx get-skill add leolin990405/ai-code-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/leolin990405/ai-code-review/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: LeoLin990405 (https://skillmd.com/u/leolin990405)
- Updated: 2026-11-11
- Page: https://skillmd.com/skills/leolin990405/ai-code-review

---


# 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`)
```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
```yaml
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`)
```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
1. Settings > Copilot > Code Review > Enable automatic review
2. Optionally enable "Review new pushes" and "Review draft PRs"

### Custom Instructions
`.github/copilot-instructions.md`:
```markdown
- All public functions must have JSDoc
- Error handling: use custom error types
- Database queries must be parameterized
- Max function length: 50 lines
```

### CLI
```bash
gh pr create --reviewer copilot
gh pr edit 123 --add-reviewer copilot
```

## Best Practices

1. **Layer AI + human** — AI as first pass, humans for architecture
2. **Customize instructions** — tailor to team standards
3. **Path-based rules** — different standards per directory
4. **Start small** — 10-20 specific rules, iterate
5. **Integrate with CI** — auto-trigger on PR creation

## Sources

- [PR-Agent](https://github.com/qodo-ai/pr-agent)
- [CodeRabbit](https://docs.coderabbit.ai/)
- [Copilot Code Review](https://docs.github.com/en/copilot/concepts/agents/code-review)

