AI Code Reviewer
An intelligent VS Code extension that provides automated code review using GitHub Copilot. Get instant feedback on your code quality, security, and best practices.
Features
🤖 AI-Powered Reviews: Leverages GitHub Copilot for intelligent code analysis
📊 Quality Scoring: Get numeric scores for code quality (1-10 scale)
🔍 Multi-Review Modes: Review changesets, selected code, or entire files
💡 Inline Suggestions: See review comments directly in your code
⚙️ Customizable: Use project-specific review prompts and rules
📋 Export Reports: Generate markdown reports of review results
Requirements
- VS Code 1.85.0 or higher
- GitHub Copilot extension (active subscription required)
Installation
- Install the extension from the VS Code marketplace
- Ensure GitHub Copilot is installed and authenticated
- Open a workspace with a Git repository
Usage
Review Options
The extension provides multiple ways to review your code:
1. Review Changeset 🔄
- Reviews all staged and unstaged changes in your Git repository
- Access via Command Palette:
AI Code Reviewer: Review Current Changeset
- Or use the Git SCM panel button
2. Review Selected Code ✂️
- Select any code block and right-click → "Review Selected Code"
- Perfect for reviewing specific functions or code sections
3. Review Entire File 📄
- Right-click in any file → "Review Entire File"
- Analyzes the complete file in manageable chunks
UI Options
Choose how you want to see review results:
- Dedicated sidebar with comprehensive review results
- Shows scores, issues, and suggestions
- Interactive file navigation
- Export and refresh options
Inline Decorations
- Review comments appear directly over problematic code
- Hover to see detailed explanations
- Visual indicators for different issue severities:
- ❌ Errors (red wavy underline)
- ⚠️ Warnings (orange wavy underline)
- ℹ️ Info (blue underline)
- 💡 Suggestions (green dotted underline)
Project Configuration
Custom Review Prompts
Create project-specific review guidelines:
- Create
.github/code-review-prompt.md in your project root
- Write your custom review instructions:
# Custom Review Guidelines
Please focus on:
- Security best practices for our authentication system
- Performance optimization for database queries
- Compliance with our coding standards
- Error handling patterns
Ignore:
- Minor style issues (handled by our linter)
- TODO comments (tracked in our issue system)
GitHub Integration
The extension automatically reads project configuration from:
.github/ folder contents
CONTRIBUTING.md guidelines
- Workflow files and templates
- Package.json scripts and configurations
Configuration
Access settings via File > Preferences > Settings > Extensions > AI Code Reviewer:
| Setting |
Default |
Description |
enableInlineDecorations |
true |
Show review comments as inline decorations |
enableHoverComments |
true |
Show detailed comments on hover |
reviewPromptPath |
.github/code-review-prompt.md |
Path to custom review prompt |
scoringEnabled |
true |
Enable code quality scoring |
autoReviewOnSave |
false |
Automatically review files when saved |
Scoring System
The extension provides a 10-point scoring system:
- 9-10: Excellent code quality
- 7-8: Good code with minor improvements needed
- 5-6: Fair code with several issues to address
- 3-4: Poor code requiring significant improvements
- 1-2: Critical issues that need immediate attention
Scoring considers:
- Code quality and readability (25%)
- Performance and efficiency (25%)
- Security best practices (25%)
- Maintainability and design (25%)
Commands
| Command |
Description |
AI Code Reviewer: Start Review |
Open the review panel |
AI Code Reviewer: Review Current Changeset |
Analyze Git changes |
AI Code Reviewer: Review Selected Code |
Review highlighted code |
AI Code Reviewer: Review Entire File |
Analyze current file |
AI Code Reviewer: Clear Review Results |
Clear all review data |
AI Code Reviewer: Refresh |
Refresh the review panel |
Troubleshooting
GitHub Copilot Not Available
- Ensure GitHub Copilot extension is installed
- Check that you're signed in to GitHub Copilot
- Verify your Copilot subscription is active
No Git Repository
- The extension requires a Git repository for changeset reviews
- Initialize Git in your project:
git init
- Individual file reviews work without Git
- Large files are automatically chunked for review
- Consider reviewing specific selections instead of entire large files
- Disable auto-review on save for large projects
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
License
This extension is licensed under the MIT License. See LICENSE for details.
Support
Happy Coding! 🚀