Prai is an AI-powered code review tool that streamlines pull request workflows by providing automated, intelligent feedback using leading language models. It integrates seamlessly with GitHub to deliver structured, actionable code reviews while supporting multiple AI providers.
-
Multi-AI Support
- OpenAI GPT-4
- Anthropic Claude 3
-
Structured Reviews
- Native GitHub suggestions
- Conventional Comments format
- Multiple severity levels
-
Two-Step Analysis
- Comprehensive initial analysis
- Detailed file-by-file review
-
Advanced Features
- Skip validation via comments
- PR blocking for critical issues
- Customizable cookbook
- Add API keys as GitHub Secrets:
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
- Create the workflow file:
name: AI Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: AI Review
uses: your-username/ai-code-reviewer@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
AI_PROVIDER: "openai" # or "anthropic"
COOKBOOK_URL: ${{ secrets.COOKBOOK_URL }}
AI_PROVIDER
: AI provider to use ("openai" or "anthropic")COOKBOOK_URL
: URL to your validation rules cookbookSKIP_VALIDATION
: Comment to skip validation (// @skip-validation
)
- Analyzes modified files in the PR
- Performs two-step analysis:
- Comprehensive initial context analysis
- Detailed file-by-file review
- Generates suggestions using GitHub's native format
- Applies appropriate severity (critical, warning, info)
- Allows skipping validations via special comment
Follows the Conventional Comments pattern:
<label> [decorations]: <subject>
[discussion]
Labels: praise, nitpick, suggestion, issue, todo, question, thought, chore, note
Decorations: (blocking), (non-blocking), (if-minor)