Use when decomposing systems into modules with clear boundaries. Trigger with modularization or module boundary request. Loaded by ai-maestro-architect-agent-main-agent
Guides decomposition into modules with clear boundaries, minimal coupling, and high cohesion. Covers SOLID principles, boundary identification, API design, dependency management, and modularization validation.
Use when starting new projects, refactoring monoliths, analyzing coupling, designing inter-module APIs, or planning microservices migration.
See Detailed Procedures for the full phase checklist.
Copy this checklist and track your progress:
| Document | Contents |
|---|---|
| SOLID Principles | Overview, The Five SOLID Principles, Applying SOLID to Module Boundaries, Validation Checklist, Common Violations and Fixes, Summary |
| Boundary Patterns | Overview, Core Principle, Step 1: Map Domain Concepts, Step 2: Identify Change Vectors, Step 3: Find Natural Seams, Step 4: Define Bounded Contexts, Step 5: Validate Boundaries |
| API Design Guide | Overview, Core API Design Principles, API Contract Templates, Versioning Strategy, Compatibility Rules, Data Transfer Objects (DTOs), Error Handling Contracts |
| Detailed Procedures | What is a Module?, Why Modularization Matters, Detailed Phase Checklist, Examples, Troubleshooting, Next Steps |
Example: UserService (2000 LOC) → AuthModule, ProfileModule, RegistrationModule, PermissionsModule
| Problem | Solution |
|---|---|
| Module too large | Apply SRP, split by responsibility |
| Circular dependency | Extract shared interface or invert dependency |
| Cannot test in isolation | Apply DIP, inject dependencies |
| API breaks consumers | Implement semantic versioning |
| Shared code causes ripple changes | Reduce shared surface, consider duplication |
| Phase | Artifact |
|---|---|
| Principles | SOLID compliance assessment per module |
| Boundaries | Module boundary map with responsibilities |
| APIs | Interface definitions and contracts |
| Validation | Coupling/cohesion metrics and test strategy |
See Reference Documents table above.