ddd-domain-service
Installation
SKILL.md
One-line summary
A domain service is a stateless operation in the domain layer that doesn't naturally sit on a single entity or value object — usually because it coordinates multiple aggregates or involves a domain computation that isn't anchored to one thing.
When to use this skill
- A cohesive domain operation involves multiple aggregates (e.g., transferring money between two
Accountaggregates). - A calculation involves domain types but isn't naturally a method on any of them (e.g., currency conversion, given exchange rates).
- Forcing the behavior onto one of the participating entities would make that entity "know too much" about the others.
When NOT to use this skill
- The logic fits cleanly on a single entity — put it there.
- The work is application-layer orchestration (handling a use case, opening a transaction, calling repositories) — that is an application service, not a domain service.
- The work is infrastructure (HTTP calls, database access, message sending) — that is an infrastructure service.
Core content
Three kinds of services often coexist in a DDD codebase. Keep them distinct: