🚀 Developed using Cursor and vibe coding 🚀
Special thanks to:
- code2prompt - For code structure analysis
- cloc - For counting lines of code
An AI-powered code review agent that analyzes your codebase using large language model (LLM) for in-depth analysis and recommendations.
- Project Structure Analysis - Uses code2prompt to generate detailed file structure of the project
- Technology Detection - Automatically identifies project type, languages, frameworks, and dependencies
- Intelligent Key File Detection - Identifies the most important files for in-depth review
- Context-Aware Analysis - Intelligently gathers related code when more context is needed
- Comprehensive Code Review - Analyzes code for:
- Code quality issues
- Architectural concerns
- Security vulnerabilities
- Performance implications
- Best practices compliance
- Commented code
- Project Size Evaluation - Uses cloc to count lines of code and categorize project size
- Detailed, Actionable Reports - Generates comprehensive reports with:
- Project overview and structure
- Prioritized issues with severity levels
- Project strengths and positive practices
- Specific, actionable recommendations
- Dependency analysis
- Written in TypeScript for improved code quality and maintainability
Choose your preferred installation method below, each with its specific prerequisites.
The easiest way to run the code review agent is with Docker, which includes all required dependencies:
-
Clone this repository
-
Copy
.env.example
to.env
and add your Anthropic API key:
cp .env.example .env
Then edit the .env
file to add your Anthropic or Google Gemini API key.
- Build the Docker image:
docker build \
--pull \
--rm \
-f "Dockerfile" \
-t project-review-agent:latest \
.
- Run the container, mounting your project directory and the desired directory for the output:
docker run \
-v "<PATH_TO_YOUR_PROJECT_DIRECTORY>:/project" \
-v "<PATH_TO_THE_DESIRED_DIRECTORY_FOR_THE_OUTPUT>:/app/output" \
project-review-agent:latest
- Node.js (v22)
- Code2Prompt - v3.0.2
- cloc (Count Lines of Code)
If you prefer to run the tool without Docker:
- Install all prerequisites listed above
- Clone this repository
- Install dependencies:
npm install
- Copy
.env.example
to.env
and add your Anthropic API key:
cp .env.example .env
Then edit the .env
file to add your Anthropic API key.
- Build the TypeScript project:
npm run build
- Run the code review agent:
npm start -- [path-to-project]
Note: You must provide a path to the project directory to analyze.
For a quick test with the included test project:
npm run test
The reports will be generated in the output
directory, in a timestamped subfolder containing:
project_review.md
- A comprehensive analysis with all findings
-
Project Structure Analysis - The agent first analyzes your project structure:
- Uses code2prompt to generate a detailed file structure
- Creates a comprehensive map of your codebase
-
Technology Detection - Based on the file structure:
- Identifies project type (web application, mobile app, CLI tool, etc.)
- Detects programming languages used
- Determines frameworks and key dependencies
-
Key File Detection - The agent intelligently:
- Identifies the most important files for review
- Prioritizes files based on their purpose and potential impact
- Creates a dependency map to understand relationships
-
Code Review - The agent then:
- Uses Code2Prompt to prepare each file for analysis
- Leverages the LLM for in-depth code review
- Analyzes code quality, security, and architectural concerns
- Examines related files when more context is needed
-
Project Size Evaluation - The agent:
- Uses cloc to count lines of code
- Categorizes the project size (small, medium, large)
-
Report Generation - Finally, it generates a comprehensive report with:
- Project overview and technical details
- Prioritized list of issues with severity ratings
- Project strengths and positive practices
- Specific, actionable recommendations
- Dependency analysis and project statistics
The generated report includes:
- Introduction - Overview of the project type, purpose, and technologies
- Issues - Detailed analysis of problems found with severity levels
- Strengths - Positive aspects and well-implemented practices
- Miscellaneous - Project size, dependencies, and other metrics
- Recommendations - Actionable suggestions for improvement
The following environment variables can be set in your .env
file:
GOOGLE_API_KEY
- Your Google API key (required)- LangSmith configuration (optional)
LANGCHAIN_TRACING_V2
LANGCHAIN_ENDPOINT
LANGCHAIN_API_KEY
LANGCHAIN_PROJECT
MIT License. See LICENSE file for details.