clean-architecturelisted
Install: claude install-skill andr-ca/agentharness
# Clean Architecture (Hexagonal / Ports & Adapters)
**Core rule:** business logic must not depend on infrastructure. Infrastructure depends on business logic.
```
┌─────────────────────────────────────────┐
│ Infrastructure │
│ (HTTP, DB, Queue, Email, S3, ...) │
│ │
│ ┌───────────────────────────┐ │
│ │ Application Layer │ │
│ │ (Use cases, Commands) │ │
│ │ │ │
│ │ ┌─────────────────┐ │ │
│ │ │ Domain Layer │ │ │
│ │ │ (Entities, │ │ │
│ │ │ Value Objects, │ │ │
│ │ │ Domain Events) │ │ │
│ │ └─────────────────┘ │ │
│ └───────────────────────────┘ │
└─────────────────────────────────────────┘
Dependencies only point INWARD →
```
---
## Layers
### Domain (innermost)
- Entities: objects with identity and lifecycle (`Order`, `User`)
- Value Objects: immutable, defined by value (`Money`, `Email`)
- Domain Events: things that happened (`OrderPlaced`, `PaymentFailed`)
- Domain Services: stateless logic that spans entities
- **Zero infrastructure imports** — no SQLAlchemy, FastAPI, Stripe, etc.
### Application
- Use cases / handlers: orchestrate domain objects
- Input/output ports (interfaces): what the use case needs from outside
-