This guide will help you set up the automated code review framework using Claude and MCP servers.
-
Claude Code CLI - Latest version with MCP support
# Install according to: https://docs.anthropic.com/en/docs/claude-code -
MCP Servers - The following servers must be installed:
- GitHub MCP: For repository and PR operations
- Sequential-thinking MCP: For complex code analysis
- Browser MCP: For documentation research (optional)
- GitHub access token with repo permissions
- Access to target repositories for review
- Claude Code properly authenticated
git clone https://github.com/VMWepinion/elixir-code-review.git
cd elixir-code-review./scripts/install.shThis script will:
- Check for Claude CLI and MCP servers
- Set up configuration files
- Make scripts executable
- Optionally create system-wide symlinks
Edit config/repositories.yaml:
default_repository:
owner: "YourOrg"
name: "your-repo"
branch: "main"
repositories:
your_project:
owner: "YourOrg"
name: "your-repo"
branch: "main"
patterns:
- "architectural/*"
- "file-level/*"
- "integrations/phoenix/*"
file_patterns:
- "*.ex"
- "*.exs"Test that MCP servers are working:
superclaude <<EOF
Please test the following MCP servers:
1. List my GitHub notifications (GitHub MCP)
2. Use sequential thinking to analyze a simple problem (Sequential-thinking MCP)
This confirms the servers are properly configured.
EOF- Target repositories and branches
- File patterns to analyze
- Pattern categories to apply
- Exclusion rules
- Define issue priority levels
- Set time estimates by severity
- Configure merge blocking rules
- Cost calculation settings
- PR comment templates
- Issue severity formatting
- Batching and grouping rules
- Summary report templates
# Test help system
./scripts/review-pr.sh --help
# Test configuration loading
./scripts/review-pr.sh --dry-run --verbose# Test GitHub MCP
superclaude "List open PRs in the configured repository using GitHub MCP"
# Test sequential thinking
superclaude "Use sequential-thinking MCP to analyze this pattern: What are the key considerations for implementing automated code review?"# Run against a small test PR
./scripts/review-pr.sh --pr-name "Test PR" --dry-run"superclaude not found"
- Install Claude Code CLI from official documentation
- Ensure it's in your PATH
"GitHub MCP not responding"
- Check MCP server installation
- Verify GitHub authentication in Claude settings
- Test with simple GitHub operations
"Repository config not found"
- Copy
config/repositories.yaml.exampletoconfig/repositories.yaml - Edit with your repository details
"No patterns found"
- Ensure pattern files exist in
patterns/directory - Check file permissions
- Verify YAML syntax in config files
# Enable verbose logging
./scripts/review-pr.sh --verbose --dry-run
# Check configuration
superclaude "Please validate the configuration files in the elixir-code-review project and identify any issues"Add to your GitHub Actions workflow:
- name: Automated Code Review
run: |
git clone https://github.com/VMWepinion/elixir-code-review.git
cd elixir-code-review
./scripts/review-pr.sh --pr-name "${{ github.event.pull_request.title }}"Add to your project's development workflow:
# Before creating PR
review-pr --interactive
# As part of pre-commit hook
review-pr --pr-name "$(git log -1 --pretty=%B)" --dry-runThe framework is designed to support IDE integration:
- Real-time pattern detection
- Inline suggestions
- Pattern documentation links
- Read Usage Guide: docs/usage.md
- Understand Architecture: docs/architecture.md
- Add Custom Patterns: docs/adding-patterns.md
- Run First Review:
./scripts/review-pr.sh --interactive
- Issues: Create issues in the GitHub repository
- Documentation: Check the
docs/directory - Examples: See
docs/examples/for real-world usage
Last updated: 2025-08-19