hexagonal-architecture
Installation
SKILL.md
Hexagonal Architecture
Hexagonal architecture (Alistair Cockburn, 2005) isolates domain logic from infrastructure concerns through explicit boundaries called ports (interfaces the domain exposes or requires) and adapters (implementations that connect ports to the outside world).
Core Invariants
These rules must hold throughout the codebase:
- Dependency rule: All dependencies point inward. Domain knows nothing of adapters.
- Port ownership: The domain defines port interfaces. Adapters implement them.
- Domain purity: No framework imports, I/O operations, or infrastructure types in domain code.
- Adapter isolation: Adapters never call each other directly; coordination happens through the domain.