Architecture Review
Analyze the overall architecture and design patterns of any codebase to assess maintainability, scalability, and adherence to best practices.
Usage
/architecture-review # Full review of current codebase
/architecture-review data-flow # Focus on data flow only
/architecture-review security,scalability # Multiple focus areas
Instructions
Review the codebase architecture with the following scope: $ARGUMENTS
If $ARGUMENTS specifies a focus area, limit the review to the relevant sections below. If no focus is given, perform a full review but keep each section concise — breadth over depth.
1. Discovery
Before analyzing, establish context:
- Identify the tech stack, frameworks, and runtime environment
- Read project config files (
package.json, go.mod, requirements.txt, etc.)
- Map the directory structure and identify architectural boundaries
- Check for existing architecture docs, ADRs, or CLAUDE.md files
2. Structural Analysis
- Patterns: Identify architectural patterns in use (MVC, Clean Architecture, hexagonal, event-driven, etc.)
- Module boundaries: Review separation of concerns and layer structure
- Dependencies: Analyze coupling between modules, check for circular dependencies, assess dependency direction
- Component design: Check single responsibility adherence, interface design, and abstraction levels
3. Data Flow & State
- Trace data flow through the application end-to-end
- Review state management patterns and implementation
- Analyze data persistence, storage strategies, and caching layers
- Check for proper data validation and transformation at boundaries
4. Resilience & Operations
- Error handling: Review strategy consistency, propagation, and recovery patterns
- Scalability: Assess horizontal/vertical scaling capabilities, stateless design, bottlenecks
- Observability: Review logging, monitoring, and alerting integration
- Configuration: Check separation of config from code, environment management, feature flags
5. Security Architecture
- Review security boundaries and trust zones
- Check authentication and authorization architecture
- Analyze data protection and encryption practices
- Assess input validation at system boundaries
6. Testability & Quality
- Review test structure and organization across architectural layers
- Check for testability in design (dependency injection, interface-based design)
- Assess test coverage distribution and identify undertested layers
- Review mocking and dependency isolation strategies
7. Evolution & Debt
- Assess the architecture's ability to accommodate change
- Identify technical debt and modernization opportunities
- Review technology stack alignment with current requirements
- Check for proper versioning and backward compatibility
8. Recommendations
Produce a scored report:
## Architecture Review Report
### Overall Score: [X]/100
| Dimension | Score | Status |
|---------------------|-------|--------|
| Structure & Patterns| X/100 | 🟢/🟡/🔴 |
| Data Flow & State | X/100 | 🟢/🟡/🔴 |
| Resilience & Ops | X/100 | 🟢/🟡/🔴 |
| Security | X/100 | 🟢/🟡/🔴 |
| Testability | X/100 | 🟢/🟡/🔴 |
| Evolution & Debt | X/100 | 🟢/🟡/🔴 |
### Key Strengths
- [Top 3 things done well]
### Critical Issues
- [Issues requiring immediate attention]
### Recommended Improvements
1. [Highest impact, with specific file/module references]
2. [...]
3. [...]
### Architecture Evolution Roadmap
- Short-term: [Quick wins]
- Medium-term: [Structural improvements]
- Long-term: [Strategic changes]
Focus on actionable insights with specific file paths and code references. Every recommendation should include why it matters and what to do about it.
1---2name: architecture-review3description: Analyze codebase architecture and design patterns to assess maintainability, scalability, and adherence to best practices4---56# Architecture Review78Analyze the overall architecture and design patterns of any codebase to assess maintainability, scalability, and adherence to best practices.910## Usage1112```13/architecture-review # Full review of current codebase14/architecture-review data-flow # Focus on data flow only15/architecture-review security,scalability # Multiple focus areas16```1718## Instructions1920Review the codebase architecture with the following scope: **$ARGUMENTS**2122If `$ARGUMENTS` specifies a focus area, limit the review to the relevant sections below. If no focus is given, perform a full review but keep each section concise — breadth over depth.2324### 1. Discovery2526Before analyzing, establish context:27- Identify the tech stack, frameworks, and runtime environment28- Read project config files (`package.json`, `go.mod`, `requirements.txt`, etc.)29- Map the directory structure and identify architectural boundaries30- Check for existing architecture docs, ADRs, or CLAUDE.md files3132### 2. Structural Analysis3334- **Patterns**: Identify architectural patterns in use (MVC, Clean Architecture, hexagonal, event-driven, etc.)35- **Module boundaries**: Review separation of concerns and layer structure36- **Dependencies**: Analyze coupling between modules, check for circular dependencies, assess dependency direction37- **Component design**: Check single responsibility adherence, interface design, and abstraction levels3839### 3. Data Flow & State4041- Trace data flow through the application end-to-end42- Review state management patterns and implementation43- Analyze data persistence, storage strategies, and caching layers44- Check for proper data validation and transformation at boundaries4546### 4. Resilience & Operations4748- **Error handling**: Review strategy consistency, propagation, and recovery patterns49- **Scalability**: Assess horizontal/vertical scaling capabilities, stateless design, bottlenecks50- **Observability**: Review logging, monitoring, and alerting integration51- **Configuration**: Check separation of config from code, environment management, feature flags5253### 5. Security Architecture5455- Review security boundaries and trust zones56- Check authentication and authorization architecture57- Analyze data protection and encryption practices58- Assess input validation at system boundaries5960### 6. Testability & Quality6162- Review test structure and organization across architectural layers63- Check for testability in design (dependency injection, interface-based design)64- Assess test coverage distribution and identify undertested layers65- Review mocking and dependency isolation strategies6667### 7. Evolution & Debt6869- Assess the architecture's ability to accommodate change70- Identify technical debt and modernization opportunities71- Review technology stack alignment with current requirements72- Check for proper versioning and backward compatibility7374### 8. Recommendations7576Produce a scored report:7778```79## Architecture Review Report8081### Overall Score: [X]/1008283| Dimension | Score | Status |84|---------------------|-------|--------|85| Structure & Patterns| X/100 | 🟢/🟡/🔴 |86| Data Flow & State | X/100 | 🟢/🟡/🔴 |87| Resilience & Ops | X/100 | 🟢/🟡/🔴 |88| Security | X/100 | 🟢/🟡/🔴 |89| Testability | X/100 | 🟢/🟡/🔴 |90| Evolution & Debt | X/100 | 🟢/🟡/🔴 |9192### Key Strengths93- [Top 3 things done well]9495### Critical Issues96- [Issues requiring immediate attention]9798### Recommended Improvements991. [Highest impact, with specific file/module references]1002. [...]1013. [...]102103### Architecture Evolution Roadmap104- Short-term: [Quick wins]105- Medium-term: [Structural improvements]106- Long-term: [Strategic changes]107```108109Focus on actionable insights with specific file paths and code references. Every recommendation should include *why* it matters and *what* to do about it.