| name | clean-architecture-modular-design |
| description | Use this skill when structuring the project, defining layers, or enforcing architectural boundaries. |
When applying Clean Architecture:
-
Enforce strict layers:
- domain
- application
- infrastructure
- api
-
Dependency rules:
- Domain depends on nothing
- Application depends on domain
- Infrastructure depends on application
- API depends on application
-
Rules:
- No Spring annotations in domain
- No JPA entities leaking into API
- Use interfaces (ports) at boundaries
-
Business logic:
- Lives in use cases
- Not in controllers
- Not in repositories
Violations must be considered architectural bugs.
Always write tests to verify layer boundaries are respected.