AI-powered code review tool using Google Gemini with deep reasoning for React and TypeScript projects.
| Feature | GitHub Copilot | Gemini Code Review |
|---|---|---|
| Custom Rules | 70-80% consistency | 100% enforcement |
| Deep Reasoning | Surface-level checks | Deep architectural analysis |
| Explainability | Black box | Full reasoning traces |
| Customization | Limited to .copilot-instructions.md |
Fully extensible rule system |
| Focus | Generic code issues | React/TypeScript specialist |
| Cost Control | Fixed quota limits | Pay-per-use, no artificial limits |
| Enforcement | Comments can be dismissed | Can block CI/CD |
The Key Difference: Unlike Copilot which checks against a fixed list, Gemini discovers issues using deep reasoning:
- Finds issues beyond your rules: Uses pre-trained knowledge to spot problems you didn't specify
- Context-aware analysis: Understands trade-offs, edge cases, and architectural implications
- Reasoning traces: Shows WHY something is wrong, not just WHAT
- Scales with AI improvements: Gets smarter as Gemini models improve
Example: You write a principle about "performance optimization." Gemini:
- Uses that to guide its thinking
- Applies its vast knowledge of React internals
- Discovers specific issues like race conditions, memory leaks, unnecessary re-renders
- Explains the reasoning behind each finding
- 🎯 React & TypeScript Focus: Specialized for modern React + TS codebases
- 📋 Two-Tier Rule System: Principles for AI guidance + Requirements for strict enforcement
- 🔍 Detailed Explanations: Every issue includes deep reasoning and actionable suggestions
- 🎨 Beautiful CLI: Color-coded severity levels with modern terminal UI
- 🚀 Fast & Scalable: ~$0.003 per file review, enterprise-ready
- 🔧 Fully Customizable: Add your team's standards without code changes
# Install dependencies
bun install
# Copy environment template
cp .env.example .env
# Add your Google API key to .env
echo "GOOGLE_API_KEY=your_api_key_here" > .env- Go to Google AI Studio
- Click "Get API Key"
- Create a new API key or use an existing one
- Copy the key and add it to your
.envfile
Note: Free tier is perfect for personal projects. For enterprise/team usage, consider upgrading to Google Cloud for higher rate limits.
bun run review test-samples/UserProfile.tsxOr with custom options:
# Use specific model
bun run dev test-samples/UserProfile.tsx -- --model gemini-2.5-pro
# Filter rules by tags
bun run dev test-samples/UserProfile.tsx -- --tags react,hooks
# Disable deep thinking (faster but less thorough)
bun run dev test-samples/UserProfile.tsx -- --no-thinkingWe've included a sample file with intentional issues:
bun testThis will review test-samples/UserProfile.tsx which contains 7 intentional issues including async waterfall, missing dependencies, and type safety problems.
The tool supports multiple Gemini models with different trade-offs:
# Budget - Fast and cost-efficient
GEMINI_MODEL=gemini-2.5-flash-lite
# Balanced - Good quality (default)
GEMINI_MODEL=gemini-2.5-flash
# Premium - Best quality
GEMINI_MODEL=gemini-2.5-pro
# Latest Gen 3 - Cutting edge (experimental)
GEMINI_MODEL=gemini-3-pro-previewSee MODEL_SELECTION.md for detailed comparison and recommendations. Model capabilities and limits are guidelines - actual performance may vary.
gemini-deep-review/
├── src/
│ ├── cli.ts # CLI entry point
│ ├── gemini-reviewer.ts # Gemini API integration
│ ├── rule-loader.ts # Load and compile rules
│ ├── formatter.ts # Pretty print results
│ └── types.ts # TypeScript interfaces
├── rules/
│ ├── react/ # React-specific rules
│ │ ├── async-waterfall.md
│ │ └── hooks-best-practices.md
│ └── typescript/ # TypeScript rules
│ └── type-safety.md
├── test-samples/ # Sample files for testing
└── docs/ # Additional documentation
├── MODEL_SELECTION.md
├── TROUBLESHOOTING.md
└── RATE_LIMITS.md
This tool uses a hybrid approach combining two types of rules:
Principles provide conceptual guidance for Gemini to discover issues using its own expertise. They don't prescribe exact patterns—they guide thinking.
Example: Instead of "look for this exact code pattern", principles say "think about performance implications of async operations" and let Gemini discover issues.
---
id: performance-principles
title: React Performance Principles
type: principle
impact: HIGH
category: performance
tags: [react, performance]
---
## Core Principle
Minimize unnecessary work: parallel operations, accurate dependencies, memoization when beneficial.
## Questions to Guide Review
- Are independent operations running sequentially?
- Do effects properly declare dependencies?
- Are expensive computations memoized appropriately?Requirements are team-specific standards that must always be followed. These are enforced strictly.
Example: "Never use any type" or "Always clean up useEffect subscriptions"
---
id: team-standards
title: Team Code Standards
type: requirement
impact: HIGH
category: best-practice
tags: [team-standards]
---
## No `any` Type (STRICT)
❌ Never: `function foo(data: any)`
✅ Always: `function foo(data: unknown)` + type guards- Principles: Let Gemini discover issues you didn't think to specify. Uses AI's deep reasoning.
- Requirements: Enforce your team's non-negotiable standards. No exceptions.
Result: You get both AI-powered discovery AND team-specific enforcement.
Create a markdown file in rules/react/, rules/typescript/, or rules/team/:
---
id: your-rule-id
title: Your Rule Title
type: principle # or 'requirement'
impact: HIGH # LOW | MEDIUM | HIGH | CRITICAL
category: performance
tags: [react, custom]
---
## Your content here
For principles: Provide conceptual guidance and questions
For requirements: State exact standards to enforceThe rule will be automatically loaded and used in reviews.
Environment variables (.env):
# Required
GOOGLE_API_KEY=your_key_here
# Optional (with defaults)
GEMINI_MODEL=gemini-2.5-flash
ENABLE_DEEP_THINKING=true
MAX_TOKENS=8192
TEMPERATURE=0.1The CLI outputs:
- 📊 Overall metrics (files, score, issue count)
- 📝 Summary of code quality
- 🔖 From Team Rules: Issues matching your custom rules
- ✨ AI Insights: Additional issues discovered by AI reasoning
Each issue includes:
- Location: File and line number (clickable in supported terminals)
- Title: Short description
- Description: What's wrong
- Why: Deep reasoning explaining the problem
- Fix: Actionable suggestion to resolve it
Severity levels:
- 🔴 Critical: Will cause bugs/crashes
- 🟠 High: Major problems
- 🟡 Medium: Code smells
- 🟢 Low: Minor improvements
0- Review passed (no critical issues)1- Review failed (critical issues found)
Use in CI/CD to block merges on critical issues.
For common issues and solutions, see TROUBLESHOOTING.md.
Quick fixes:
- "GOOGLE_API_KEY is required": Create a
.envfile with your API key - "Rules directory not found": Run from project root directory
- JSON parse errors: See TROUBLESHOOTING.md for model recommendations
- Gemini integration with deep reasoning
- Hybrid rule system (principles + requirements)
- Modern CLI interface
- Comprehensive error handling
- Review only changed files in PR/branch
- Show diff context in reviews
- Smart chunking for large PRs
- PR comment integration
- Inline code annotations
- Blocking on critical issues
- Cost reporting
- Auto-fix suggestions (executable)
- Multi-file architectural analysis
- Custom rule testing framework
- Web dashboard for team analytics
Personal/Small Teams (Free Tier):
- 15 reviews/minute, 1,500/day
- Perfect for individual developers
- ~$0.003 per review
Enterprise (Paid Tier):
- 1,000+ reviews/minute
- No daily limits
- Scales to thousands of developers
- ~$225/month for 2,500 reviews/day (negligible vs. engineer costs)
See RATE_LIMITS.md for detailed analysis.
This tool is designed to analyze code that you own or have permission to review. Users are responsible for ensuring they have appropriate rights to any code submitted for review.
This tool:
- Analyzes code for quality, bugs, and best practices (transformative use)
- Does not store, redistribute, or create derivative works from reviewed code
- Processes code transiently through Google's Gemini API
- Returns original analysis and suggestions, not code reproduction
Users should:
- Only review code they own or have authorization to analyze
- Not use this tool to reverse-engineer proprietary software
- Comply with their organization's policies on code review tools
- Be aware that code is processed by Google's AI services (see Google's terms)
- Code is sent to Google Gemini API for analysis
- Google's data usage policies apply (review at ai.google.dev/terms)
- No code is stored by this tool itself
- For sensitive codebases, consider using Google Cloud with private endpoints
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. The tool provides suggestions and analysis but does not guarantee code correctness or security. Users are responsible for reviewing and validating all suggestions before implementation.
# Run in dev mode
bun run dev test-samples/UserProfile.tsx
# Build
bun run build
# Run tests
bun testContributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.
- Powered by Google Gemini
- Inspired by Vercel Agent Skills
- Built with Anthropic's Agent patterns
Note: Model capabilities, rate limits, and pricing are subject to change by Google. Refer to official documentation for the latest information.