Skip to content

Elixir code review tools and utilities

VMWepinion/elixir-code-review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elixir Code Review Framework

An AI-powered code review framework for Elixir/Phoenix applications using Claude and MCP servers. This framework provides automated detection of anti-patterns, architectural issues, and code quality problems with targeted suggestions and GitHub integration.

🎯 Overview

This repository provides:

  • 26+ individual anti-pattern detection rules organized by category
  • Automated PR review workflow using GitHub MCP integration
  • Sequential-thinking AI analysis for complex architectural issues
  • Real-time cost/time tracking (avg. $2-3k savings per major PR)
  • Standardized pattern templates for easy extensibility

📁 Repository Structure

elixir-code-review/
├── patterns/                    # Individual pattern files
│   ├── architectural/          # System-wide patterns
│   ├── file-level/            # Single-file issues  
│   ├── one-liners/            # Quick mechanical fixes
│   └── integrations/          # 3rd party library patterns
├── scripts/                   # Automation tools
├── config/                   # Configuration files
├── docs/                     # Documentation
└── templates/                # Pattern file templates

🚀 Quick Start

# 1. Clone and setup
git clone https://github.com/VMWepinion/elixir-code-review.git
cd elixir-code-review
./scripts/install.sh

# 2. Configure target repository
cp config/repositories.yaml.example config/repositories.yaml
# Edit config/repositories.yaml with your repo details

# 3. Run automated review
./scripts/review-pr.sh --pr-name "Your PR Name"
# Or interactively select from open PRs
./scripts/review-pr.sh --interactive

🎯 Pattern Categories

Architectural Patterns (System-wide)

  • Manual authorization bypassing Bodyguard policies
  • PubSub data leak vulnerabilities
  • Race condition detection
  • Configuration anti-patterns
  • Import statement violations

File-level Patterns

  • Boolean logic errors and tautologies
  • Function complexity issues
  • Error handling pattern violations
  • Module organization problems

One-liner Patterns

  • Formatting and style issues
  • Variable naming conventions
  • Simple mechanical refactors

Integration Patterns

  • Ecto: Schema, migration, query anti-patterns
  • Phoenix: Controller, PubSub, view patterns
  • Mock: Testing and mocking anti-patterns
  • Bodyguard: Authorization pattern enforcement
  • Postgrex: Database connection and Aurora DSQL patterns

🤖 AI Integration

This framework leverages:

  • Claude Code MCP: File system and repository operations
  • GitHub MCP: PR analysis and automated commenting
  • Sequential-thinking MCP: Complex architectural analysis
  • Browser MCP: Documentation and research capabilities

📊 Impact Metrics

  • Pattern Library: 26+ documented anti-patterns
  • Time Savings: ~8.5 hours per major PR review
  • Cost Savings: $2,250-$3,000 per review cycle
  • Issue Categories: 4-tier complexity classification
  • Detection Methods: Regex, AST analysis, semantic analysis

🔧 Configuration

Key configuration files:

  • config/repositories.yaml - Target repositories
  • config/severity-levels.yaml - Issue severity definitions
  • config/github-templates.yaml - PR comment templates
  • config/review-workflow.yaml - Automation workflow settings

📚 Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add new patterns using templates/pattern-template.md
  4. Test with scripts/test-patterns.sh
  5. Submit a pull request

📈 Roadmap

  • VS Code extension for real-time detection
  • CI/CD pipeline integration
  • Multi-language support expansion
  • Advanced metrics dashboard
  • Machine learning pattern discovery

📄 License

MIT License - see LICENSE for details.


Generated by Claude Code with MCP server integration
Saving time, improving code quality, one pattern at a time

About

Elixir code review tools and utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages