Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Detects anemic domain models, validates and refactors them into rich domain models, and enforces tactical DDD patterns (Entities, Value Objects, Aggregates, Domain Services, Domain Events). Use when the user asks to validate, review, or check domain models or DDD code; detect anemia; refactor domain objects; improve encapsulation; or mentions terms like "anemic model", "rich domain", "aggregate", "value object", "domain event", "ubiquitous language", "is this good DDD", "does this follow DDD", o
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-03 | ✓→✗ | ▼ Worse | -36% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 15% | 0% |
Determine the user's intent first:
| Intent | Phases to run | |--------|--------------| | "validate / review / check / is this correct?" | Phase 1 + 2 only → report findings, ask before refactoring | | "fix / refactor / improve / clean up" | Phase 1 + 2 + 3 | | "how should I design / model this?" | Load reference.md directly |
Load detection.md and scan the target code for anemia signals. Produce a severity score and list of affected classes.
For each affected class, determine the correct building block:
| Has unique identity tracked over time? | Has invariants tying multiple objects? | → Building Block | |----------------------------------------|----------------------------------------|-----------------| | Yes | — | Entity | | No | — | Value Object | | Yes (root) + children with shared invariants | Yes | Aggregate | | Operation spans multiple Aggregates/doesn't belong to any | — | Domain Service |
Prefer Value Objects over Entities. Prefer small Aggregates over large ones.
If intent was validate/review: stop here. Report findings using the output format below. Ask "Would you like me to apply these fixes?" before proceeding.
Load refactoring.md for step-by-step moves. Apply in this order:
For deep pattern questions (boundary design, event modeling, service vs. entity decision), load reference.md.
public setX() / public setY() → behaviour should be encapsulated
service.doX(entity, ...) → logic likely belongs in entity
entity.setA(); entity.setB(); ... → setter chain = missing intent method
no domain methods beyond getters → pure data bagcommitTo, not setStatus)When reviewing code, report:
## Anemia Diagnosis: <ClassName>
Severity: [None | Mild | Moderate | Severe]
Issues:
- <description of problem>
Recommended refactoring:
- <specific move from refactoring.md>When refactoring, show a before/after diff for each class touched.
Other measured skills in the registry, with their headline benchmark lift.