Skip to content
Back to skills

Domain Driven Design

ASecurity

DDD — ubiquitous language, bounded contexts and context maps, aggregates and invariants, entities and value objects, domain events, anti-corruption layers, strategic vs tactical design. Use to model a domain, draw service or module boundaries, or design aggregates (DDD, bounded context, aggregate, ubiquitous language, context map, domain events).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgoreact

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill domain-driven-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Domain Driven Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Domain Driven Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-domain-driven-design/badge)](https://www.skillsdirectory.com/skills/vectora-os-domain-driven-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: domain-driven-design
description: DDD — ubiquitous language, bounded contexts and context maps, aggregates and invariants, entities and value objects, domain events, anti-corruption layers, strategic vs tactical design. Use to model a domain, draw service or module boundaries, or design aggregates (DDD, bounded context, aggregate, ubiquitous language, context map, domain events).
metadata:
  category: design-patterns
---

# Domain-driven design

## Purpose

Align software structure with the business domain so that boundaries and rules are explicit.

**Use when:** modelling complex business rules or deciding module/service boundaries.

**Not for:** CRUD-only areas where DDD overhead does not pay off.

## Inputs

- Domain knowledge, glossary, business rules.

## Outputs

- Context map, aggregate designs with invariants, glossary additions.

## Read first

- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "domain-driven design"` for prior decisions, patterns and anti-patterns.
- [Glossary](../../../docs/glossary.md)
- [Architecture standard](../../../standards/architecture.md)

## Steps

1. **Language.** Collect terms with domain experts; add to the glossary.
   Done when terms are unambiguous within a context.
2. **Contexts.** Identify bounded contexts and draw the context map (partnership, customer/supplier, ACL, shared kernel).
   Done when every context has an owner and relationships.
3. **Aggregates.** Design aggregates around invariants that must be consistent in one transaction; keep them small.
   Done when each aggregate lists its invariants.
4. **Events.** Define domain events for cross-aggregate and cross-context reactions.
   Done when events are past-tense facts with payload contracts.

## Best practices

- Reference other aggregates by id, not object.
- One aggregate per transaction.
- Use an anti-corruption layer against legacy or external models.

## Common mistakes

- Anemic models with logic in services.
- Giant aggregates causing contention.
- One "Customer" model shared across all contexts.

## Example

Ordering vs Billing contexts: `Order` aggregate enforces line-item rules; `OrderPlaced` event drives invoice creation in Billing through an ACL.

## Reusable prompt

```text
Apply the Domain-driven design skill (.agents/skills/domain-driven-design/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Produce the ubiquitous language, context map and aggregate designs with invariants and domain events for the described domain.
Return: Context map, aggregate designs with invariants, glossary additions..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.