Skip to content

Context-aware AI reviewer for Pull Requests. Instant summary, line-by-line comments, title generation and more

License

Notifications You must be signed in to change notification settings

presubmit/ai-reviewer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Presubmit - AI Code Reviewer

Context-aware, intelligent and instant PR reviews

GitHub Stars   GitHub last commit   GitHub License   X (formerly Twitter) Follow


Optimize your code review process with Presubmit's AI Code Reviewer that catches bugs, suggests improvements, and provides meaningful summary - all before human reviewers take their first look.

  • 🔍 Instant, In-depth PR Analysis: Catches bugs, security issues, and optimization opportunities in real-time
  • 🎯 Focus on What Matters: Let AI handle the basics while humans focus on architecture and complex logic
  • Title and description generation: Save time by having the AI generate meaningful title and description for your PR
  • 💬 Interactive & Smart: Responds to questions and generates code suggestions right in your PR
  • Lightning-Fast Setup: Up and running in 2 minutes with GitHub Actions

🤝 Note: Presubmit is designed to complement human reviewers, not replace them. It helps catch security issues and bugs early on while also providing context about the overall change, making the human review process more efficient.


See it in Action

💡 View full example PR review

Automated analysis detects potential issues and provides actionable insights:


Interactive discussions help clarify implementation details:


Usage

Step 1: Add LLM_API_KEY secret

  1. Go to your repository's Settings > Secrets and Variables > Actions
  2. Click "New repository secret"
  3. Add a new secret with:

Step 2: Create GitHub Workflow

Add this GitHub Action to your repository by creating .github/workflows/presubmit.yml:

name: Presubmit.ai

permissions:
  contents: read
  pull-requests: write
  issues: write

on:
  pull_request:
  pull_request_review_comment:
    types: [created]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: presubmit/ai-reviewer@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
          LLM_MODEL: "claude-3-5-sonnet-20241022"

The action requires:

  • GITHUB_TOKEN: Automatically provided by GitHub Actions
  • LLM_API_KEY: Your API key (added in step 1)
  • LLM_MODEL: Which LLM model to use. Make sure the model is supported and matches the LLM_API_KEY.

Features

🤖 Smart Reviews

  • In-depth Analysis: Line-by-line review with context-aware suggestions
  • Auto PR Summary: Concise, meaningful summaries of changes
  • Code Quality: Catches bugs, anti-patterns, and style issues
  • Interactive: Responds to questions and clarifications in comments

🛡️ Security & Quality

  • Vulnerability Detection: Catches security issues and leaked secrets
  • Best Practices: Enforces coding standards and security guidelines
  • Performance: Identifies potential bottlenecks and optimizations
  • Documentation: Ensures proper code documentation and clarity

⚙️ Configurable

  • Mention @presubmit in PR title for auto-generation
  • Disable reviews with @presubmit ignore comment
  • Configurable review depth and focus areas
  • Customizable rules and preferences

⚡ Seamless Integration

  • 2-minute setup with GitHub Actions
  • Works with all major LLM providers (Claude, GPT-4, Gemini)
  • Instant feedback on every PR
  • Zero maintenance required

Show Your Support! ⭐

If you find Presubmit helpful in improving the review process:

  • Star this repository to show your support and help others discover it
  • Share your experience by creating a GitHub Issue
  • Follow me on X/Twitter for updates
  • Consider contributing to make it even better