A powerful GUI plugin for Cursor that enables AI-powered code reviews by comparing source and destination branches. The plugin analyzes code changes, identifies bugs, issues, and suggestions, and provides actionable recommendations with one-click fixes.
Features โข Installation โข Usage โข Development โข Contributing
Cursor Code Review Assistant is an intelligent code review tool that helps developers maintain code quality by automatically analyzing changes between Git branches. It provides comprehensive reviews across 14 evaluation criteria, prioritized issues, and actionable fixes that can be applied directly from the interface.
- 14 Evaluation Criteria: Deep analysis across Design & Architecture, Complexity & Maintainability, Functionality & Correctness, Readability & Naming, Best Practices & Patterns, Test Coverage & Quality, Standardization & Style, Documentation & Comments, Security & Compliance, Performance & Scalability, Observability & Logging, Accessibility & Internationalization, CI/CD & DevOps, and AI-Assisted Code Review
- Prioritized Issues: Issues categorized by severity (Critical, Major, Minor, Enhancement)
- High-Level Summary: Automatically generates product impact and engineering approach summaries
- Beautiful GUI: Clean, modern interface with intuitive navigation
- Branch Search: Inline search functionality for quick branch selection
- Responsive Design: Optimized for different screen sizes
- Color-Coded Severity: Visual indicators for issue priority
- Before/After Code Comparison: See exactly what needs to change with highlighted code sections
- One-Click Apply: Apply suggested fixes directly to your codebase
- Full Line Context: View complete code lines with highlighted problematic sections
- Smart Line Detection: Intelligent line matching ensures accurate code changes
- Comprehensive Branch Comparison: Uses proper git commands (
git fetch origin,git diff origin/branch1...origin/branch2) to compare branches - Remote Branch Support: Automatically fetches and compares remote branches
- Diff Analysis: Analyzes only modified files with actual code changes
- Branch Switching: Seamless branch switching with confirmation dialogs
- File-by-File Analysis: Expandable sections for each modified file
- Issue Tracking: Track issues by category and severity
- Highlights Section: Positive findings and well-implemented patterns
- Statistics Dashboard: Overview of review results
Once published, you can install the extension directly from the VS Code Marketplace:
- Open Cursor
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "Cursor Code Review Assistant"
- Click Install
Or via command line:
cursor --install-extension afshmini.cursor-code-review- Cursor editor (version 1.80.0 or higher)
- Node.js (v20 or higher)
- Git repository initialized in your workspace
-
Clone the repository:
git clone https://github.com/afshmini/cursor-code-review.git cd cursor-code-review -
Install dependencies:
npm install
-
Compile TypeScript:
npm run compile
-
Launch Extension Development Host:
- Press
F5in Cursor - A new Extension Development Host window will open
- Press
-
Test the extension:
- In the new window, open a Git repository workspace
- Use the command palette (
Ctrl+Shift+P/Cmd+Shift+P) and run "Start Code Review"
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Start Code Review" and select it
- Open the Source Control panel
- Click on the "Start Code Review" button in the navigation bar
-
Select Branches:
- Choose the Source Branch (the branch you want to review)
- Choose the Destination Branch (the branch to compare against, typically
mainordevelop) - Use the inline search to quickly find branches
-
Start Review:
- Click the "Start Review" button
- The plugin will:
- Fetch all remote changes
- Calculate differences between branches
- Analyze code changes automatically
-
Review Results:
- High-Level Summary: Product impact and engineering approach
- Prioritized Issues: Grouped by severity (Critical, Major, Minor, Enhancement)
- Highlights: Positive findings and best practices
- File-by-File Analysis: Detailed issues for each modified file
For Critical and Major issues, you can apply fixes directly:
- Review the Before and After code sections
- The problematic code is highlighted in the Before section
- The suggested fix is highlighted in the After section
- Click the Apply button at the bottom of the code section
- The changes will be applied directly to your workspace
Note: The plugin uses intelligent line matching to ensure changes are applied to the correct location, even if the file has been modified since the review.
The plugin follows a comprehensive review format:
- Product Impact: What the change delivers for users/customers
- Engineering Approach: Key patterns, frameworks, and best practices used
Issues are grouped by severity:
- ๐ด Critical: Security vulnerabilities, hardcoded credentials, SQL injection risks, XSS vulnerabilities
- ๐ Major: Missing error handling, null/undefined access, N+1 query patterns, test quality issues
- ๐ก Minor: Code complexity, code smells, missing documentation, style inconsistencies
- ๐ต Enhancement: Naming improvements, magic numbers, accessibility improvements, i18n support
Each issue includes:
- File path and line range
- One-line summary
- Detailed description
- Specific fix recommendation
- Category classification
- Before/After code (for Critical and Major issues)
- Positive findings and well-implemented patterns
- Good practices observed in the code
- Commendable architectural decisions
The plugin uses Cursor's built-in settings and doesn't require additional configuration. However, you can customize the review process by modifying the analysis rules in src/codeReviewService.ts.
cursor-code-review/
โโโ src/
โ โโโ extension.ts # Main extension entry point
โ โโโ codeReviewPanel.ts # Webview panel and GUI
โ โโโ gitService.ts # Git operations
โ โโโ codeReviewService.ts # Code analysis and review logic
โโโ out/ # Compiled JavaScript files
โโโ package.json # Extension manifest
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # This file
โโโ PUBLISHING.md # Publishing guide
โโโ QUICK_PUBLISH.md # Quick publishing reference
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension (creates .vsix file)
npm run package- Open the project in Cursor
- Press
F5to launch Extension Development Host - Test the plugin in the new window
- Check the Debug Console for any errors
See PUBLISHING.md or QUICK_PUBLISH.md for detailed publishing instructions.
- Ensure you have a workspace folder open in Cursor
- The plugin requires an active workspace with a Git repository
- Verify that Git is initialized in your workspace
- Check that you have at least one branch
- Ensure Git is installed and accessible from the command line
- The selected branches might be identical
- Try selecting different branches
- Ensure both branches exist and have commits
- Verify that remote branches are fetched
- Check the Output panel for error messages
- Verify that both branches are selected
- Ensure you have network access (for fetching remote branches)
- Check that Node.js version is 20 or higher
- Ensure you're on the correct branch
- Check that the file hasn't been significantly modified
- Verify the file path is correct
- Check the Debug Console for error messages
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Maintain code style consistency
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Afshmini
- Email: afshmini@gmail.com
- GitHub: @afshmini
- Repository: cursor-code-review
- Integration with Cursor's native AI API for more advanced analysis
- Export review results to markdown/JSON
- Custom review rules configuration
- Integration with CI/CD pipelines
- Support for pull request reviews
- Historical review tracking
- Team collaboration features
- Review templates and presets
- Integration with issue trackers (Jira, GitHub Issues, etc.)
For issues, questions, or feature requests, please:
- Open an issue on GitHub
- Contact the author at afshmini@gmail.com