What problem does it solve?
This guide reduces architectural drift and tangled dependencies by prescribing clear, enforceable layer boundaries so teams can maintain separation of concerns and reduce coupling across services.
Core Features & Use Cases
- Defines five layers and their responsibilities: Handler (entry points and validation), Usecase (business orchestration, no external deps), Port (interface contracts), Gateway (anti-corruption and mapping), and Driver (database and external integrations).
- Provides file path patterns to identify layers and dependency rules to prevent direct imports that violate clean architecture, useful during development, code review, and refactoring.
- Highlights common violations to detect and remediate, such as handlers importing drivers directly or usecases depending on external packages.
Quick Start
Organize your service into Handler, Usecase, Port, Gateway, and Driver folders, apply the file naming patterns, and update imports to ensure usecases only depend on ports.