Skip to content
Back to skills

Applying Ddd

ASecurity

Use when modelling a business domain in code or drawing the boundaries between parts of a system around that domain. Triggers on DDD, ubiquitous language, bounded context, context map, anti-corruption layer, aggregate or aggregate root, entity vs value object, domain event, repository, strategic vs tactical design, or an anemic domain model, even when the user doesn't say 'DDD'.

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentsgoawsapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add xonovex/platform --skill applying-ddd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Applying Ddd?

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

Security grade badge for Applying Ddd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xonovex-applying-ddd/badge)](https://www.skillsdirectory.com/skills/xonovex-applying-ddd)

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: applying-ddd
description: "Use when modelling a business domain in code or drawing the boundaries between parts of a system around that domain. Triggers on DDD, ubiquitous language, bounded context, context map, anti-corruption layer, aggregate or aggregate root, entity vs value object, domain event, repository, strategic vs tactical design, or an anemic domain model, even when the user doesn't say 'DDD'."
---

# Domain-Driven Design

Find the boundaries in a domain, name everything inside them rigorously, and model each boundary with building blocks that keep business invariants honest. Strategic design draws the map; tactical design fills it in.

## Essentials

- **Build one ubiquitous language per context** - bind agreed terms into both the model and the code, see [references/strategic-design.md](references/strategic-design.md)
- **Draw bounded contexts before classes** - each context is a boundary of model consistency where words mean exactly one thing, see [references/strategic-design.md](references/strategic-design.md)
- **Map contexts and shield with an anti-corruption layer** - translate foreign models both directions into your own terms, see [references/strategic-design.md](references/strategic-design.md)
- **Distinguish entity from value object** - identity-over-time versus defined-by-attributes-and-immutable, see [references/tactical-building-blocks.md](references/tactical-building-blocks.md)
- **Keep aggregates small with one root** - protect true invariants in a transaction, reference other aggregates by id, see [references/tactical-building-blocks.md](references/tactical-building-blocks.md)
- **Hand whole aggregates through a repository** - persistence-ignorant, collection-like access to roots only, see [references/tactical-building-blocks.md](references/tactical-building-blocks.md)

## Gotchas

- A bounded context is not a microservice or a subdomain: it is a solution-space model boundary; a subdomain is a problem-space area; a service is a deployment unit. They often align but are not the same thing.
- Ubiquitous language is not "a glossary". It only counts when the agreed terms live in the model AND the code; a wiki nobody compiles against is not a ubiquitous language.
- A thin ORM/DAO wrapper is not a repository, and an upstream-API client is not an anti-corruption layer: a repository hands out whole aggregate roots and is persistence-ignorant; an ACL translates foreign concepts both directions, not just forwards calls.
- Code-level coupling metrics belong to **analyzing-connascence**, class/inheritance mechanics to **applying-oop**, and undo/serialization machinery to **designing-data-models**: DDD names the domain boundaries, not those.

## Example

```text
Bounded context: Ordering
  Ubiquitous language: Customer, Order, OrderLine, place, fulfil
  Aggregate Order (root)
    invariant: total == sum(orderLines.subtotal)   // enforced in one transaction
    orderLines: OrderLine[]                          // value objects, no identity
    references Shipment by id, never by object       // cross-aggregate = eventual consistency
  emits OrderPlaced (domain event, carries identifiers)
  Repository: orders.save(order) / orders.byId(id)   // whole aggregate, persistence-ignorant

Bounded context: Shipping
  "Customer" here means Recipient: name + address + phone
  anti-corruption layer translates OrderPlaced -> Recipient   // does not import the Ordering model
```

## Progressive Disclosure

- Read [references/strategic-design.md](references/strategic-design.md) - Load when finding boundaries: ubiquitous language, bounded contexts, context maps, context-mapping patterns, anti-corruption layer, subdomains
- Read [references/tactical-building-blocks.md](references/tactical-building-blocks.md) - Load when modelling inside a context: entity, value object, aggregate + root, domain event, repository, domain/application service

Files in this skill

  • SKILL.md3.8 KB
  • eval-output.json3.5 KB
  • eval-trigger.json5 KB
  • moon.yml86 B
  • references/strategic-design.md4.1 KB
  • references/tactical-building-blocks.md4 KB
  • sources.json5 KB

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.