Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DOM-001Domain Model QualityAnemic domain model
Flags domain objects that appear to expose data without owning behavior or invariants.
warningviolationNo auto-fix
How to fix
- Move invariant checks into the domain object or focused domain service.
- Keep DTOs separate from domain behavior.
- Add tests around the domain rule being protected.
What it means
Business rules are scattered around a data structure instead of living with the domain concept.
Why it matters
Anemic models make invariants harder to protect and duplicate business rules across layers.
Common causes
- DTOs or ORM entities are treated as domain objects.
- Services contain all domain decisions.
- The domain model has not been extracted yet.
Example bad pattern
Every service checks subscription status differently before changing billing state.Example good pattern
A Subscription domain object owns allowed status transitions.Related files/config
apps/api/src/modulespackages
Related CLI commands
archpilot validatearchpilot validate --ci