Stop guessing about architecture decisions. Get AI-powered recommendations for your actual code.
The AI Architecture Advisor analyzes your codebase and provides expert recommendations on design patterns, architectural decisions, and refactoring opportunities. Powered by sequential thinking AI and trained on comprehensive pattern knowledge.
- π§ Analyzes your actual code - Not just theory, real analysis of your projects
- π― Recommends specific patterns - With confidence levels and reasoning
- π‘οΈ Prevents anti-patterns - Catches overengineering before it happens
- π Finds refactoring opportunities - Identifies code that would benefit from patterns
- π Provides implementation guidance - Step-by-step pattern application
Prerequisites: Claude Code CLI installed
# 1. Clone and setup
git clone https://github.com/ahmadhasan2k8/ai-architecture-advisor.git
cd ai-architecture-advisor
./setup.sh # Installs commands globally
# 2. Use from ANY directory - no need to stay in ai-architecture-advisor!
cd /path/to/your/project
claude .
# 3. Start getting AI recommendations
/dp::analyze Your architectural challenge description here
# 4. Analyze your existing code
/dp::refactor main.py
# 5. Validate pattern decisions
/dp::check singleton for database connection poolβ Full Quick Start Guide β Start here!
For complex architectural decisions
/dp::analyze Payment system with multiple providers, different validation rules, and varying processing timesGet 8-step AI analysis with pattern recommendations, alternatives, and implementation roadmap
For specific pattern decisions
/dp::check factory for creating different database connectionsFast β /β validation with clear reasoning
For existing code improvement
/dp::refactor /path/to/your/codebase/Identifies pattern opportunities with priority scores
For avoiding architectural mistakes
/dp::validate Making all service classes singletons for consistencyPrevents overengineering and common mistakes
β Generic advice and theoretical examples
β "Here's how to implement X pattern"
β No analysis of your specific code
β No guidance on when NOT to use patterns
β
Analyzes YOUR specific code and problems
β
Tells you WHEN to use patterns (and when not to)
β
Prevents anti-patterns and overengineering
β
Provides confidence levels and reasoning
β
Sequential thinking for complex decisions
Your Problem:
/dp::analyze E-commerce platform with user auth, product catalog, shopping cart, order processing, payment handling, inventory management. Team of 8 developers.AI Analysis:
π§ Pattern Analysis: E-commerce Platform Architecture
## Problem Assessment
- Complexity: High (6+ domains, team coordination)
- Scale: Multi-domain system requiring modularity
- Growth Potential: High (e-commerce evolves rapidly)
## Primary Recommendations:
### 1. Repository Pattern (Confidence: HIGH)
β 6+ data domains justify separate repositories
β Team of 8 needs independent development paths
β Testing isolation critical for this complexity
### 2. Strategy Pattern for Payments (Confidence: HIGH)
β Multiple payment methods with different logic
β Runtime selection based on user/region
β Expected growth (crypto, BNPL, etc.)
### 3. Observer Pattern for Order Events (Confidence: MEDIUM)
β Inventory updates, notifications, analytics
β Decoupled event handling across domains
## Anti-Pattern Warnings:
π¨ Avoid generic repository (IRepository<T>)
π¨ Don't make everything singleton
β οΈ Watch for god objects in order processing
## Implementation Priority:
1. Repository pattern (foundational)
2. Payment strategies (business critical)
3. Event system (quality improvement)
[... detailed implementation steps ...]
ai-architecture-advisor/
βββ π README.md # You are here
βββ β‘ QUICK_START.md # Get started in 5 minutes
βββ π€ commands/ # Primary AI interface
β βββ analyze.md # Deep architectural analysis
β βββ check.md # Quick pattern validation
β βββ refactor.md # Code improvement analysis
β βββ validate.md # Anti-pattern prevention
βββ π§ ai-engine/ # Intelligence core
β βββ pattern_knowledge.py # Comprehensive pattern database
β βββ code_analyzer.py # AST-based code analysis
β βββ repo_analyzer.py # Repository-wide insights
β βββ refactoring_templates.py # Implementation guidance
βββ π learning-resources/ # Educational materials
β βββ notebooks/ # Interactive pattern tutorials
β βββ guides/ # Documentation and decision trees
β βββ examples/ # Implementation examples & tests
βββ π§ .claude/ # AI command configuration
βββ π CLAUDE.md # AI assistant guidelines
For developers with real projects
- Start with
/dp::analyzeon your current architectural challenges - Use
/dp::refactorto improve existing code - Learn patterns through AI recommendations and targeted study
- Validate understanding with
/dp::check
For systematic pattern education
- Study interactive notebooks in
learning-resources/notebooks/ - Practice with implementation examples
- Apply patterns to real projects
- Use AI commands to validate your decisions
The AI uses advanced sequential thinking to:
- Break down complex architectural problems into steps
- Consider multiple pattern options systematically
- Evaluate trade-offs and alternatives
- Provide reasoning for recommendations
- Extracted from 10 comprehensive pattern tutorials
- Threshold-based recommendations (e.g., Strategy for 3+ algorithms)
- Anti-pattern detection with specific warnings
- Context-aware analysis (team size, complexity, growth)
- AST-based Python code analysis
- Pattern opportunity detection
- Complexity metrics and thresholds
- Priority scoring for refactoring suggestions
- Python 3.11+ (optional, for notebooks)
- Claude Code CLI (required for dp:: commands)
# Clone the repository
git clone https://github.com/ahmadhasan2k8/ai-architecture-advisor.git
cd ai-architecture-advisor
# Run the setup script to enable dp:: commands
./setup.sh
# Or manually copy commands
mkdir -p .claude/commands
cp commands/*.md .claude/commands/# Open Claude Code
claude .
# Test a command
/dp::analyze I need a payment processing systemThat's it! The dp:: commands are now available in Claude Code.
β Detailed Setup Guide for troubleshooting and manual setup.
- 4 Smart Commands for comprehensive architecture guidance
- Sequential Thinking for complex decision analysis
- Anti-Pattern Detection with risk assessment
- Code Analysis with refactoring recommendations
- Confidence Scoring for all recommendations
- 10 Design Patterns with interactive tutorials
- Real-world Examples and implementation guides
- Decision Trees and visual guides
- Comprehensive Test Suites with >90% coverage
Creational: Singleton, Factory, Builder
Structural: Adapter, Decorator
Behavioral: Observer, Strategy, Command, State
Architectural: Repository
We welcome contributions to improve the AI recommendations and expand pattern coverage!
- Pattern knowledge enhancement - Add more advanced scenarios
- Code analysis improvements - Better pattern detection algorithms
- New language support - Extend beyond Python
- AI prompt refinement - Improve recommendation quality
See CONTRIBUTING.md for guidelines.
MIT License - See LICENSE for details.
β Quick Start Guide - Get recommendations in 5 minutes
β Interactive Tutorials - Comprehensive pattern education
The AI Architecture Advisor helps teams make consistent, well-reasoned architectural decisions. No more endless debates about whether to use a pattern - get expert AI analysis instead.
π If this helps you write better code, please give it a β
Questions? Open an issue or check the documentation.
Stop wondering. Start knowing. π