Architecture Review Skill
Step 1: Gather Architecture Context
Understand the current architecture by:
- Read project structure: Use Glob to map directory structure
- Identify key components: Find entry points, services, data layers
- Review dependencies: Check package.json, imports, module graph
- Understand data flow: Trace requests through the system
Step 2: Evaluate Design Principles
Check adherence to fundamental principles:
SOLID Principles:
- Single Responsibility: Does each class/module have one reason to change?
- Open/Closed: Can behavior be extended without modification?
- Liskov Substitution: Are subtypes substitutable for base types?
- Interface Segregation: Are interfaces focused and minimal?
- Dependency Inversion: Do high-level modules depend on abstractions?
Other Principles:
- DRY: Is logic duplicated unnecessarily?
- YAGNI: Are there unused or speculative features?
- Separation of Concerns: Are responsibilities properly divided?
Step 3: Check for Anti-Patterns
Identify common anti-patterns:
- God Class/Module: Classes doing too much
- Spaghetti Code: Tangled, hard-to-follow logic
- Circular Dependencies: Modules that reference each other
- Feature Envy: Classes that use other classes' data excessively
- Shotgun Surgery: Changes that require touching many files
- Leaky Abstractions: Implementation details exposed to consumers
Step 4: Assess Non-Functional Requirements
Evaluate against NFRs:
- Scalability: Can the system handle increased load?
- Maintainability: How easy is it to modify and extend?
- Testability: Can components be tested in isolation?
- Security: Are there potential vulnerabilities?
- Performance: Are there obvious bottlenecks?
- Observability: Can the system be monitored effectively?
Step 5: Generate Review Report
Create a structured report with:
- Summary: Overall assessment and key findings
- Strengths: What the architecture does well
- Concerns: Issues requiring attention (prioritized)
- Recommendations: Specific improvements with rationale
- Trade-offs: Acknowledge valid design trade-offs
- Be Constructive: Focus on improvements, not criticism
- Prioritize Issues: Not all problems are equally important
- Consider Context: Understand constraints and trade-offs
- Suggest Alternatives: Don't just identify problems
- Reference Patterns: Cite established patterns when relevant
Review the architecture of src/services/ for scalability and maintainability
Example Response Structure:
## Architecture Review: src/services/
### Summary
The service layer follows a reasonable structure but has some coupling issues...
### Strengths
- Clear separation between API handlers and business logic
- Good use of dependency injection
### Concerns
1. **High Priority**: UserService has 15 methods (God Class)
2. **Medium Priority**: Circular dependency between OrderService and InventoryService
3. **Low Priority**: Some magic numbers in validation logic
### Recommendations
1. Split UserService into UserAuthService and UserProfileService
2. Introduce EventBus to decouple Order and Inventory
3. Extract validation constants to configuration
Iron Laws
- ALWAYS review architecture before COMPLEX or EPIC implementation starts — architectural problems discovered after implementation cost 10-100x more to fix; review in the design phase.
- NEVER approve an architecture with undocumented single points of failure — every SPOF must be explicitly identified and have a documented mitigation plan.
- ALWAYS evaluate against non-functional requirements — performance, security, scalability, maintainability, and observability are non-optional; functional correctness without NFR compliance is incomplete.
- NEVER treat architectural trade-offs as implicit — every trade-off must be explicitly documented with rationale; hidden trade-offs become future surprises and unowned technical debt.
- ALWAYS check for circular dependencies before approving a design — circular module dependencies make testing, refactoring, and deployment order unpredictable and progressively harder to resolve.
Anti-Patterns
| Anti-Pattern |
Why It Fails |
Correct Approach |
| No NFR evaluation |
Design may pass functional tests but fail at scale or under attack |
Always evaluate performance, security, scalability, observability |
| Reviewing only the happy path |
Systems fail at error boundaries, not in the happy path |
Review failure modes, retry behavior, and circuit breakers |
| Approving without trade-off documentation |
Hidden trade-offs become future surprises |
Explicitly document all trade-offs with rationale |
| Single point of failure left undocumented |
System has silent fragility that surfaces under load |
Map all SPOFs; require mitigation plans for each |
| Checking SOLID without anti-pattern catalog |
Principle adherence doesn't guarantee absence of anti-patterns |
Check both principles AND concrete anti-patterns (God Class, Shotgun Surgery, etc.) |
| Architecture review after implementation starts |
Too late to fix structural issues without major rework |
Review in design phase, before any code is written |
Rules
- Always provide constructive feedback with actionable recommendations
- Prioritize issues by impact and effort to fix
- Consider existing constraints and trade-offs
Related Workflow
This skill has a corresponding workflow for complex multi-agent scenarios:
- Workflow:
.claude/workflows/architecture-review-skill-workflow.md
- When to use workflow: For comprehensive audits or multi-phase analysis requiring coordination between multiple agents (developer, architect, security-architect, code-reviewer)
- When to use skill directly: For quick reviews or single-agent execution
Memory Protocol (MANDATORY)
Before starting:
cat .claude/context/memory/learnings.md
After completing:
- New pattern ->
.claude/context/memory/learnings.md
- Issue found ->
.claude/context/memory/issues.md
- Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
1---2name: architecture-review3description: Architecture review and design validation. Evaluates system designs against best practices, identifies anti-patterns, and ensures architectural decisions align with non-functional requirements.4---56# Architecture Review Skill78<identity>9Architecture Review Skill - Evaluates system designs against best practices, identifies anti-patterns, and ensures architectural decisions align with non-functional requirements (scalability, maintainability, security, performance).10</identity>1112<capabilities>13- Reviewing system architecture designs14- Identifying anti-patterns and architectural smells15- Validating against SOLID, DRY, YAGNI principles16- Assessing non-functional requirements17- Recommending architectural improvements18</capabilities>1920<instructions>21<execution_process>2223### Step 1: Gather Architecture Context2425Understand the current architecture by:26271. **Read project structure**: Use Glob to map directory structure282. **Identify key components**: Find entry points, services, data layers293. **Review dependencies**: Check package.json, imports, module graph304. **Understand data flow**: Trace requests through the system3132### Step 2: Evaluate Design Principles3334Check adherence to fundamental principles:3536**SOLID Principles**:3738- **S**ingle Responsibility: Does each class/module have one reason to change?39- **O**pen/Closed: Can behavior be extended without modification?40- **L**iskov Substitution: Are subtypes substitutable for base types?41- **I**nterface Segregation: Are interfaces focused and minimal?42- **D**ependency Inversion: Do high-level modules depend on abstractions?4344**Other Principles**:4546- **DRY**: Is logic duplicated unnecessarily?47- **YAGNI**: Are there unused or speculative features?48- **Separation of Concerns**: Are responsibilities properly divided?4950### Step 3: Check for Anti-Patterns5152Identify common anti-patterns:5354- **God Class/Module**: Classes doing too much55- **Spaghetti Code**: Tangled, hard-to-follow logic56- **Circular Dependencies**: Modules that reference each other57- **Feature Envy**: Classes that use other classes' data excessively58- **Shotgun Surgery**: Changes that require touching many files59- **Leaky Abstractions**: Implementation details exposed to consumers6061### Step 4: Assess Non-Functional Requirements6263Evaluate against NFRs:6465- **Scalability**: Can the system handle increased load?66- **Maintainability**: How easy is it to modify and extend?67- **Testability**: Can components be tested in isolation?68- **Security**: Are there potential vulnerabilities?69- **Performance**: Are there obvious bottlenecks?70- **Observability**: Can the system be monitored effectively?7172### Step 5: Generate Review Report7374Create a structured report with:75761. **Summary**: Overall assessment and key findings772. **Strengths**: What the architecture does well783. **Concerns**: Issues requiring attention (prioritized)794. **Recommendations**: Specific improvements with rationale805. **Trade-offs**: Acknowledge valid design trade-offs8182</execution_process>8384<best_practices>85861. **Be Constructive**: Focus on improvements, not criticism872. **Prioritize Issues**: Not all problems are equally important883. **Consider Context**: Understand constraints and trade-offs894. **Suggest Alternatives**: Don't just identify problems905. **Reference Patterns**: Cite established patterns when relevant9192</best_practices>93</instructions>9495<examples>96<usage_example>97**Example Review Request**:9899```100Review the architecture of src/services/ for scalability and maintainability101```102103**Example Response Structure**:104105```markdown106## Architecture Review: src/services/107108### Summary109110The service layer follows a reasonable structure but has some coupling issues...111112### Strengths113114- Clear separation between API handlers and business logic115- Good use of dependency injection116117### Concerns1181191. **High Priority**: UserService has 15 methods (God Class)1202. **Medium Priority**: Circular dependency between OrderService and InventoryService1213. **Low Priority**: Some magic numbers in validation logic122123### Recommendations1241251. Split UserService into UserAuthService and UserProfileService1262. Introduce EventBus to decouple Order and Inventory1273. Extract validation constants to configuration128```129130</usage_example>131</examples>132133## Iron Laws1341351. **ALWAYS review architecture before COMPLEX or EPIC implementation starts** — architectural problems discovered after implementation cost 10-100x more to fix; review in the design phase.1362. **NEVER approve an architecture with undocumented single points of failure** — every SPOF must be explicitly identified and have a documented mitigation plan.1373. **ALWAYS evaluate against non-functional requirements** — performance, security, scalability, maintainability, and observability are non-optional; functional correctness without NFR compliance is incomplete.1384. **NEVER treat architectural trade-offs as implicit** — every trade-off must be explicitly documented with rationale; hidden trade-offs become future surprises and unowned technical debt.1395. **ALWAYS check for circular dependencies before approving a design** — circular module dependencies make testing, refactoring, and deployment order unpredictable and progressively harder to resolve.140141## Anti-Patterns142143| Anti-Pattern | Why It Fails | Correct Approach |144| ----------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |145| No NFR evaluation | Design may pass functional tests but fail at scale or under attack | Always evaluate performance, security, scalability, observability |146| Reviewing only the happy path | Systems fail at error boundaries, not in the happy path | Review failure modes, retry behavior, and circuit breakers |147| Approving without trade-off documentation | Hidden trade-offs become future surprises | Explicitly document all trade-offs with rationale |148| Single point of failure left undocumented | System has silent fragility that surfaces under load | Map all SPOFs; require mitigation plans for each |149| Checking SOLID without anti-pattern catalog | Principle adherence doesn't guarantee absence of anti-patterns | Check both principles AND concrete anti-patterns (God Class, Shotgun Surgery, etc.) |150| Architecture review after implementation starts | Too late to fix structural issues without major rework | Review in design phase, before any code is written |151152## Rules153154- Always provide constructive feedback with actionable recommendations155- Prioritize issues by impact and effort to fix156- Consider existing constraints and trade-offs157158## Related Workflow159160This skill has a corresponding workflow for complex multi-agent scenarios:161162- **Workflow**: `.claude/workflows/architecture-review-skill-workflow.md`163- **When to use workflow**: For comprehensive audits or multi-phase analysis requiring coordination between multiple agents (developer, architect, security-architect, code-reviewer)164- **When to use skill directly**: For quick reviews or single-agent execution165166## Memory Protocol (MANDATORY)167168**Before starting:**169170```bash171cat .claude/context/memory/learnings.md172```173174**After completing:**175176- New pattern -> `.claude/context/memory/learnings.md`177- Issue found -> `.claude/context/memory/issues.md`178- Decision made -> `.claude/context/memory/decisions.md`179180> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.