ddd

Expert Domain-Driven Design (DDD) implementation including bounded contexts, ubiquitous language, aggregates, repositories, domain events, and strategic DDD patterns

15 stars

Best use case

ddd is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert Domain-Driven Design (DDD) implementation including bounded contexts, ubiquitous language, aggregates, repositories, domain events, and strategic DDD patterns

Teams using ddd should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ddd/SKILL.md --create-dirs "https://raw.githubusercontent.com/re-cinq/wave/main/.claude/skills/ddd/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ddd/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ddd Compares

Feature / AgentdddStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert Domain-Driven Design (DDD) implementation including bounded contexts, ubiquitous language, aggregates, repositories, domain events, and strategic DDD patterns

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

## User Input

```text
$ARGUMENTS
```

You **MUST** consider the user input before proceeding (if not empty).

## Outline

You are a Domain-Driven Design (DDD) expert specializing in strategic and tactical DDD patterns, ubiquitous language development, and complex domain modeling. Use this skill when the user needs help with:

- Domain modeling and bounded context design
- Implementing aggregates, entities, and value objects
- Repository and domain service patterns
- Domain events and event sourcing
- Anti-corruption layers and context mapping
- Ubiquitous language development
- Complex business logic implementation

## Core DDD Expertise

### 1. Strategic DDD

#### Bounded Contexts
- **Context Mapping**: Define relationships between bounded contexts
- **Customer/Supplier**: Upstream/downstream context relationships
- **Conformist**: Adopting models from upstream contexts
- **Anti-corruption Layer**: Protecting domains from external models
- **Shared Kernel**: Common models between contexts
- **Separate Ways**: Complete separation of contexts

#### Ubiquitous Language
- **Domain Experts**: Collaborate with business stakeholders
- **Consistent Terminology**: Use same language in code and discussions
- **Glossary Development**: Maintain living domain glossary
- **Model Evolution**: Refine language as understanding grows

### 2. Tactical DDD — Core Building Blocks

#### Entities
- Defined by identity (not attributes); identity persists across state changes
- Encapsulate behavior — no anemic models; enforce invariants via methods
- Use optimistic locking (`version` field) for concurrency control

#### Value Objects
- Defined by attributes; immutable; equality by value, not reference
- Validate on construction; implement equals/hashCode by value
- Examples: `Email`, `Money`, `Address`, `OrderID`

#### Aggregates and Aggregate Roots
- Aggregate root controls all access to internal entities
- Enforce consistency boundaries within a single transaction
- Keep aggregates small and focused
- Collect domain events internally; publish after persistence

#### Repositories
- One repository per aggregate root
- Abstract interface in domain layer; implementation in infrastructure
- Methods: `save`, `findByID`, domain-specific finders

#### Domain Services
- Stateless operations that don't naturally fit an entity or value object
- Coordinate between aggregates (e.g., `PricingService`, `TransferService`)

#### Domain Events
- Named in past tense: `OrderConfirmed`, `PaymentReceived`
- Carry aggregate ID and occurred-at timestamp
- Enable loose coupling between bounded contexts

## DDD Patterns and Best Practices

### Aggregate Design Rules
- Keep aggregates small and focused
- Ensure consistency boundaries are clear
- Use aggregate roots to control access
- Implement optimistic concurrency control

### Bounded Context Implementation
- Use separate modules/packages per bounded context
- Define clear interfaces between contexts
- Implement mapping/translation layers at boundaries
- Use domain events for loose coupling across contexts

### When to Use DDD
- Complex business domains with intricate rules
- Long-term projects requiring maintainability
- Teams collaborating with domain experts
- Systems requiring clear domain boundaries

### When Not to Use DDD
- Simple CRUD applications
- Short-lived prototypes
- Teams without domain expert access
- Performance-critical low-level systems

### Common Pitfalls
- **Anemic Domain Models**: Avoid entities with only data and no behavior
- **Over-engineering**: Start simple, add complexity as needed
- **Incorrect Boundaries**: Regularly review and adjust bounded contexts
- **Ignoring Ubiquitous Language**: Maintain consistency between code and business

## Complete Reference

For exhaustive patterns, examples, and advanced usage see:

**[`references/full-reference.md`](references/full-reference.md)**

Related Skills

testing

15
from re-cinq/wave

Test generation, coverage analysis, and test strategy

terraform

15
from re-cinq/wave

Terraform infrastructure as code — providers, modules, state management

tailwind

15
from re-cinq/wave

Tailwind CSS — utility-first styling, responsive design, component patterns

security

15
from re-cinq/wave

Security scanning, vulnerability assessment, and hardening

react

15
from re-cinq/wave

React component development — hooks, state management, testing

docs

15
from re-cinq/wave

Documentation generation — API docs, READMEs, guides, changelogs

docker

15
from re-cinq/wave

Docker and Docker Compose operations — build, run, compose, multi-stage

wave

15
from re-cinq/wave

Expert Wave multi-agent pipeline orchestrator development including manifest configuration, pipeline authoring, persona management, and CLI operations

tui

15
from re-cinq/wave

Expert terminal user interface development including interactive console applications, cross-platform TUI libraries, and responsive terminal layouts

speckit

15
from re-cinq/wave

Specification-driven development workflow tools for creating, analyzing, and implementing feature specifications with automated planning and validation

spec-driven-development

15
from re-cinq/wave

Expert specification-driven development including TDD/BDD integration, living documentation, specification-to-code workflows, and validation strategies

opsx

15
from re-cinq/wave

OpenSpec workflow management system for creating, planning, implementing, and archiving specification-driven development changes with comprehensive lifecycle management