clean-architecture
Installation
SKILL.md
Clean Architecture
Protect stable policy from volatile details. Apply the dependency rule at meaningful component/module boundaries; do not reproduce a fixed four-layer folder tree in every application.
Workflow
- Identify business policy, use cases, inputs/outputs, and volatile details.
- Inspect source-code dependencies, runtime calls, data shapes, and ownership.
- Choose boundaries where independent testing or replacement has real value.
- Define inward-owned ports using domain/use-case language.
- Implement outward adapters for web, database, messaging, UI, and vendors.
- Translate boundary DTOs rather than leaking framework or persistence types inward.
- Wire dependencies at a composition root.
- Test policy through ports and add adapter contract/integration tests.
- Measure whether the boundary reduces change cost; remove abstractions that only forward calls.
Runtime control may flow outward while source dependencies point inward.