DDD Rules
Status: Canonical
Last updated: 2026-07-05
Layer model
Every product module follows:
Domain/ → entities, value objects, domain services, events
Application/ → actions, services, DTOs, queries
Infrastructure/ → persistence, external APIs
Http/ → controllers, requests (thin)
Providers/ → DI registration
Database/ → migrations, seeders, factories
Tests/ → unit + feature per moduleRules
| Rule | Detail |
|---|---|
| D-01 | Domain has no framework imports except allowed primitives |
| D-02 | Application orchestrates; Domain decides business invariants |
| D-03 | Infrastructure implements repository interfaces defined in Domain or Application |
| D-04 | No cross-module Infrastructure imports |
| D-05 | Writes go through Actions or Application Services |
| D-06 | Reads may use Queries; return DTOs at boundaries |
Bounded context map
See product-specific module index: MODULES/README.md.
Related
- cqrs-rules.md
- dto-rules.md
- Skill: DDD (materialized in consumer
.cursor/skills/ddd/)
Breadcrumbs: Home → Engineering → DDD Rules