domain-driven-design

Model complex business domains with bounded contexts, aggregates, and domain events.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/I2olanD/dotfiles --skill domain-driven-design-i2oland
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-driven-design
Source: https://github.com/I2olanD/dotfiles/tree/main/.config/opencode/skill/domain-driven-design
Command: npx skills add https://github.com/I2olanD/dotfiles --skill domain-driven-design-i2oland

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain-Driven Design (DDD) provides a structured approach to modeling complex business domains by defining bounded contexts, entities, value objects, aggregates, and domain events to maintain invariants across systems and teams.

Core Features & Use Cases

  • Tactical patterns: Entities, Value Objects, Aggregates, and Domain Events to enforce invariants within bounded boundaries.
  • Strategic patterns: Bounded Contexts and Context Maps to align teams and enable clean integration across microservices.
  • Use Case: Model a sales domain with an Order aggregate, a Customer context, and domain events to coordinate cross-context behavior.

Quick Start

Define a bounded context, create a basic domain model with an Order aggregate root and Money as a value object, and implement a simple repository pattern to reconstitute aggregates from persistence.

Frequently Asked Questions about domain-driven-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I model complex business domains with clear boundaries across microservices?

You model complex business domains by defining bounded contexts, aggregates, and domain events. This approach enforces transactional and eventual consistency across systems and teams, ensuring clear domain boundaries and maintaining invariants within bounded boundaries.

What is the difference between an aggregate and a value object in domain-driven design?

In domain-driven design, an aggregate acts as a root entity enforcing invariants within a bounded boundary, while a value object represents a domain concept without identity, such as Money. These tactical patterns maintain invariants across systems and teams.

How do I start implementing a domain model with an Order aggregate and repository?

To start implementing a domain model, define a bounded context, create a model with an Order aggregate root and Money as a value object, then implement a simple repository pattern to reconstitute aggregates from persistence.

When do I need domain events in a bounded context?

You need domain events in a bounded context when coordinating cross-context behavior, such as linking an Order aggregate to a Customer context. They address eventual consistency by enabling clean integration across microservices and teams.

Does domain-driven design work for systems requiring transactional and eventual consistency?

Yes, domain-driven design works for systems requiring transactional and eventual consistency by applying domain modeling constructs like aggregates, entities, and domain events to address both consistency types across distributed services.