What problem does it solve?
This Skill solves the common problem of application cores becoming tightly coupled to infrastructure details like databases, frameworks, and external services, which makes code hard to test, difficult to adapt to new delivery mechanisms, and expensive to modify when infrastructure needs change.
Core Features & Use Cases
- Port Definition Patterns: Clear rules for defining primary (driving) and secondary (driven) ports using only domain types, with code examples in Java, Python, and Kotlin.
- Adapter Implementation Guidance: Templates for thin primary adapters (REST, CLI, message consumers) and secondary adapters (database, email, payment gateways) that contain no business logic.
- Testing & Enforcement Strategies: Built-in testing approaches for unit testing use cases without infrastructure, plus ArchUnit rules to enforce architectural boundaries and prevent coupling.
- Use Case: Ideal for teams building long-lived applications with multiple delivery mechanisms, practicing TDD, or needing to swap infrastructure (e.g., switching from PostgreSQL to MongoDB) without modifying core business logic.
Quick Start
Use the ports-and-adapters skill to define primary and secondary ports for your new order processing use case, separating domain logic from REST API and database dependencies.