Skip to content

ReviewScope is an open-source AI PR reviewer for GitHub that goes beyond the diff. Uses AST-based analysis and issue validation to deliver low-noise, actionable code reviews. Bring your own API key.

Notifications You must be signed in to change notification settings

Review-scope/ReviewScope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

107 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReviewScope – AI-Powered Code Review Automation

Review Scope is an intelligent PR review platform that combines static analysis, semantic context, and AI reasoning to provide comprehensive, fast code reviews on GitHub.

856_1x_shots_so

Overview

Review Scope analyzes pull requests end-to-end, evaluating code quality, security, performance, and maintainability. It features smart model routing to leverage Free Gemini models for speed and cost-efficiency, while reserving capable models for complex logic.

Key Capabilities:

  • πŸ” Static Analysis – AST-based rule detection (no LLM required, always free)
  • 🧠 AI-Powered Reviews – Complexity-aware routing between fast (Gemini Flash) and capable (Gemini 3/GPT-5) models
  • πŸ“š Semantic RAG – Retrieves relevant code context from your repository's history
  • ⚑ Smart Batching – Handles large PRs by intelligently chunking files
  • 🎯 Rule Validation – LLM classifies static findings (valid/false-positive/contextual)
  • πŸ’° BYO API Keys – Transparent pricing, you pay only for what you use

Technology Stack

Frontend & Dashboard:

  • Next.js 16 (Turbopack)
  • TailwindCSS
  • NextAuth (GitHub OAuth)

Backend & Processing:

  • Node.js Worker (background review jobs)
  • Drizzle ORM + PostgreSQL
  • Redis (caching & rate limiting)

AI & LLM:

  • OpenAI GPT-4 class models (for complex reasoning)
  • Gemini Flash models (fast, low-cost reviews)
  • Context Engine (RAG + chunking)

Integration:

  • GitHub Webhooks (real-time PR events)
  • Dodo Payment Gateway (billing integration)
  • GitHub API (PR data, code retrieval)

Project Structure

ReviewScope/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/                    # REST API & webhooks
β”‚   β”œβ”€β”€ dashboard/              # Next.js web app (pricing, settings, auth)
β”‚   └── worker/                 # Node.js background job processor
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ context-engine/         # RAG, chunking, layer assembly
β”‚   β”œβ”€β”€ llm-core/               # LLM routing, prompting, response parsing
β”‚   β”œβ”€β”€ rules-engine/           # Static analysis (JavaScript/TypeScript)
β”‚   └── security/               # Encryption, masking utilities
└── tsconfig.base.json          # Shared TypeScript config

Documentation

  • User Guide - How to install, configure, and use ReviewScope.
  • Architecture - Deep dive into the system design and data flow.
  • Contributing - Guide for developers who want to contribute to the project.

Setup & Installation

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • Redis URL (docker-compose)
  • GitHub App (for webhooks)
  • LLM API keys (Gemini & OpenAI)

1. Clone & Install

git clone https://github.com/Review-scope/ReviewScope
cd ReviewScope
npm install

2. Environment Configuration

Create .env.local files in each app:

apps/api/.env.local

DATABASE_URL=postgresql://user:pass@localhost/reviewscope
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY..."
GITHUB_WEBHOOK_SECRET=your_webhook_secret

apps/worker/.env.local

DATABASE_URL=postgresql://user:pass@localhost/reviewscope
REDIS_URL=https://default:password@redis-url.upstash.io
GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key

apps/dashboard/.env.local

DATABASE_URL=postgresql://user:pass@localhost/reviewscope
NEXTAUTH_SECRET=generate_with_openssl_rand_base64_32
NEXTAUTH_URL=http://localhost:3000
GITHUB_ID=your_github_app_client_id
GITHUB_SECRET=your_github_app_secret

3. Database Setup

cd apps/api
npx drizzle-kit generate
npx drizzle-kit migrate

4. Run Development Servers

Terminal 1 – API:

cd apps/api
npm run dev

Terminal 2 – Worker:

cd apps/worker
npm run dev

Terminal 3 – Dashboard:

cd apps/dashboard
npm run dev

Dashboard available at http://localhost:3000

Pricing & Plans

Feature Free Pro Enterprise
Price $0 $15/mo Contact Sales
Repositories Unlimited Unlimited Unlimited
Reviews Limit 60 / month Unlimited Unlimited
RAG Context ❌ βœ… (5 snippets) βœ… (8+ snippets)
Custom Prompts ❌ βœ… βœ…
Support Community Email Priority

All tiers include:

  • Static analysis (always free)
  • AI reviews via your own API keys
  • Unlimited files per PR
  • DODO payments seamless upgrades

Architecture

Workflow

GitHub PR Event
    ↓
API Webhook Handler
    ↓
Extract PR diff + fetch repo context
    ↓
Queue Review Job (Redis/Bull)
    ↓
Worker: Complexity Scorer
    ↓
Run Static Rules (AST analysis)
    ↓
RAG Retriever (semantic search)
    ↓
Context Engine (assemble layers)
    ↓
LLM Router (Gemini vs GPT-4)
    ↓
Generate Review + Rule Validation
    ↓
Post Comment to GitHub PR

Key Components

Rules Engine (packages/rules-engine/)

  • JavaScript/TypeScript AST parser
  • Detects anti-patterns, security issues, code quality problems
  • Zero LLM cost, always runs

Context Engine (packages/context-engine/)

  • Semantic RAG using Upstash Redis
  • Retrieves relevant code snippets from PR history
  • Assembles system prompt with all context layers

LLM Core (packages/llm-core/)

  • Routes by PR complexity (Gemini for simple, GPT-4 for complex)
  • Injects rule violations into prompt
  • Parses response including rule validation classifications

Worker (apps/worker/)

  • Bull queue for async job processing
  • Executes complexity scorer, rules, RAG, LLM calls
  • Rate limiting per plan (Free=60/month, Pro/Team=Unlimited)

Configuration & Customization

Custom Review Prompts (Pro/Team)

Edit system prompt per repository:

Dashboard β†’ Repositories β†’ [Select] β†’ Settings β†’ Custom Prompt

Plan Limits

Edit apps/worker/src/lib/plans.ts:

FREE: { monthlyReviewsLimit: 60, ragK: 0, allowCustomPrompts: false },
PRO:  { monthlyReviewsLimit: Infinity, ragK: 8, allowCustomPrompts: true },

LLM Model Selection

Edit packages/llm-core/src/selectModel.ts:

// Complexity thresholds for model routing
if (complexity === "trivial" || complexity === "simple") {
  return "gemini-2.5-flash-lite"; // Lowest cost / Free
} else {
  return "gemini-3-flash"; // Better reasoning for complex changes
}

Support & Contact

πŸ“§ Email: parasverma7454@gmail.com
πŸ™ GitHub Issues: ReviewScope Issues

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

All PRs are reviewed by ReviewScope! πŸ€–

ReviewScope is proprietary software. See LICENSE file for details. -->


Built with ❀️ for developers who care about code quality.

About

ReviewScope is an open-source AI PR reviewer for GitHub that goes beyond the diff. Uses AST-based analysis and issue validation to deliver low-noise, actionable code reviews. Bring your own API key.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages