Loading...
Loading...
Domain-Driven Design system for software development. Use when designing new systems with DDD principles, refactoring existing codebases toward DDD, generating code scaffolding (entities, aggregates, repositories, domain events), facilitating Event Storming sessions, creating bounded context maps, or performing code reviews with a DDD lens. Covers both strategic design (bounded contexts, subdomains, context maps, ubiquitous language) and tactical design (entities, value objects, aggregates, domain services, repositories). Supports all major architecture patterns (Hexagonal/Ports & Adapters, CQRS, Event Sourcing, Clean Architecture) with language-agnostic guidance and concrete examples in Python and TypeScript.
npx skill4agent add svngoku/coding-agents-skills domain-driven-design| Task | Reference |
|---|---|
| Bounded contexts, subdomains, context maps | strategic-design.md |
| Entities, value objects, aggregates, repositories | tactical-design.md |
| Hexagonal, CQRS, Event Sourcing, Clean Architecture | architecture-patterns.md |
| Event Storming facilitation & documentation | event-storming.md |
| Python implementations (Pydantic, SQLAlchemy, FastAPI) | python-patterns.md |
| TypeScript implementations (NestJS, TypeORM, Prisma) | typescript-patterns.md |
| DDD code review criteria | code-review.md |
| Pattern | When to Use |
|---|---|
| Layered | Simple CRUD, low complexity |
| Hexagonal | Need to isolate domain from infrastructure |
| Clean Architecture | Complex business rules, multiple delivery mechanisms |
| CQRS | Different read/write models, complex queries |
| Event Sourcing | Audit trail required, temporal queries, event-driven |
| Building Block | Purpose |
|---|---|
| Entity | Identity matters, mutable, lifecycle |
| Value Object | Defined by attributes, immutable, no identity |
| Aggregate | Consistency boundary, transactional unit |
| Domain Service | Stateless operations spanning multiple aggregates |
| Repository | Collection-like interface for aggregate persistence |
| Domain Event | Record of something significant that happened |
| Factory | Complex object creation logic |
| Specification | Encapsulated business rules for querying/validation |
src/
├── domain/ # Pure domain logic (no dependencies)
│ ├── model/ # Entities, Value Objects, Aggregates
│ ├── service/ # Domain Services
│ ├── event/ # Domain Events
│ ├── repository/ # Repository interfaces (ports)
│ └── specification/ # Business rule specifications
├── application/ # Use cases, orchestration
│ ├── command/ # Command handlers (write)
│ ├── query/ # Query handlers (read)
│ ├── dto/ # Data transfer objects
│ └── service/ # Application services
├── infrastructure/ # External concerns
│ ├── persistence/ # Repository implementations
│ ├── messaging/ # Event bus, message queue
│ └── external/ # Third-party integrations
└── interface/ # Delivery mechanisms
├── api/ # REST/GraphQL controllers
├── cli/ # Command-line interface
└── event/ # Event consumers