Welcome to the CodeReviewCrewForGithubPullRequest project, powered by crewAI. This project sets up a multi-agent AI system designed to perform comprehensive code reviews for GitHub pull requests.
This crew consists of two main agents:
- Quick Review Assistant: Provides rapid initial assessments of code changes and identifies basic patterns and potential issues in pull requests.
- Code Review Expert: Analyzes code changes in detail and provides comprehensive review reports highlighting code quality issues and suggestions for improvements.
- Automated code analysis for GitHub Pull Requests
- Identification of related files and potential impacts
- Analysis of historically related Pull Requests
- Generation of detailed, markdown-formatted code review comments
Ensure you have Python >=3.10 <=3.13 installed. This project uses UV for dependency management. Follow the installation guide for CrewAI.
Next, navigate to your project directory and install the dependencies:
(Optional) Lock the dependencies and install them by using the CLI command:
crewai install
- Add your
OPENAI_API_KEY
to the.env
file as we use gpt-4o-mini to perform fetching PRs, files, etc. - Add your
ANTHROPIC_API_KEY
to the.env
file - this project uses Anthropic's models for code review.
src/code_review_crew_for_github_pull_request/config/agents.yaml
: Define agent roles and configurationssrc/code_review_crew_for_github_pull_request/config/tasks.yaml
: Specify tasks for code review processsrc/code_review_crew_for_github_pull_request/crew.py
: Customize logic, tools, and argumentssrc/code_review_crew_for_github_pull_request/main.py
: Add custom inputs for agents and tasks
Run the code review crew:
crewai run
This command initializes the crew, assigns tasks, and generates a comprehensive code review report.
- Analyze Code Changes: Evaluate modified files for quality issues and suggest improvements
- Find Related PRs: Search for and analyze previous related pull requests
- Analyze Related Files: Identify and analyze files functionally or logically related to the changes
- Generate Review Comment: Synthesize insights into a comprehensive code review comment
For support or questions:
- Visit our documentation
- Check our GitHub
- Chat with our docs
Leverage the power of AI for efficient and thorough code reviews with this crew!