Provides strategic guidance on defining bounded contexts and ubiquitous language in modular applications.

Install

mkdir -p .claude/skills/ddd && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13187" && unzip -o skill.zip -d .claude/skills/ddd && rm skill.zip

Installs to .claude/skills/ddd

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Strategic DDD guide for this project. Use to split the domain into bounded contexts, define ubiquitous language, create new business modules, or analyze context boundaries. Tactical patterns follow Clean Architecture (see architecture skill).
242 charsno explicit “when” trigger
Advanced

Key capabilities

  • Split a domain into bounded contexts
  • Define a ubiquitous language for a domain
  • Create new business modules
  • Analyze relationships between contexts
  • Identify signs that a new bounded context is needed
  • Define public APIs for bounded contexts

How it works

The skill guides the user through identifying a new domain, defining its ubiquitous language, and specifying its public API. It then proposes a directory structure for the new bounded context.

Inputs & outputs

You give it
High-level domain decision or request for new module
You get back
A structured plan for new bounded contexts, ubiquitous language, and public APIs

When to use ddd

  • Split bounded contexts
  • Define domain language
  • Architect new modules

About this skill

Domain-Driven Design - Strategic Guide

Persona

Read .claude/roles/architect.md — adopt this profile and follow all its rules.

Activation

This skill activates for high-level domain decisions:

  • Splitting into Bounded Contexts
  • Defining the Ubiquitous Language
  • Creating a new business module
  • Analyzing relationships between contexts

Important clarification

Clean Architecture definitions take precedence over DDD tactical definitions.

We use DDD only at the strategic level (domain splitting, language). Tactical patterns (Entities, Use Cases, Gateways, Presenters) follow Clean Architecture.

What we take from DDDWhat we do NOT take
Bounded ContextsAggregates
Ubiquitous LanguageRepositories (we have Gateways)
Context MappingDomain Events
Module splittingComplex Value Objects

Bounded Context

"A Bounded Context delimits the applicability of a particular model." — Eric Evans

A Bounded Context = a module in modules/<context-name>/

Each BC is an autonomous package with its own public API.

Identifying a Bounded Context

Signs that a new BC is needed:

  • The same term has different meanings depending on context
  • A different team could manage this part
  • The model is becoming too complex
  • Business rules are diverging

ReviewFlow example:

Bounded ContextResponsibility
reviewCode review orchestration and result handling
trackingMR/PR assignment tracking and follow-up
webhookInbound webhook processing (GitLab/GitHub)
mcpModel Context Protocol server and tools
dashboardReview statistics and visualization
securitySecret detection and access control

Communication between Bounded Contexts

BCs communicate via their public APIs, like two independent packages.

// modules/tracking/index.ts (public API)
export { TrackAssignmentUseCase } from "./application/usecases/trackAssignment.usecase"
export { createTrackedMr } from "./domain/factories/trackedMrFactory"
export type { TrackingGateway } from "./application/ports/gateways/trackingGateway"

// modules/review/ imports from the public API
import { TrackAssignmentUseCase } from "@/modules/tracking"

Communication rules

AllowedForbidden
Import from another BC's index.tsDirectly import an internal file
Pass data (DTO, primitives)Share mutable entities
Call an exposed Use CaseAccess internal state

Concrete example

// modules/review/application/usecases/triggerReview.usecase.ts
import { TrackAssignmentUseCase } from "@/modules/tracking"  // Public API

export const triggerReview = async (data) => {
  const trackAssignment = new TrackAssignmentUseCase(trackingGateway);
  // ...
}
// FORBIDDEN - internal import
import { parseTrackingData } from "@/modules/tracking/domain/validators/trackingValidator"

Ubiquitous Language

"Use the model as the backbone of a language." — Eric Evans

Business vocabulary must be:

  • Consistent: same term = same concept within a given context
  • Explicit: no ambiguity
  • Shared: understood by devs AND business stakeholders

In code

// Ubiquitous Language respected
class ReviewContext { ... }
class TrackedMr { ... }
function triggerReview() { ... }
function trackAssignment() { ... }

// Technical or ambiguous vocabulary
class Data { ... }           // "Data" is not a business term
class ReviewRequest { }      // "Request" vs "ReviewContext"?
function doReview() { }      // "do" vs "trigger"?

Language documentation

Each BC maintains its glossary in /docs/business/glossary/<context>.md

# Glossary - Review

| Term | Definition |
|------|------------|
| ReviewContext | The full context for a code review (diff, MR metadata, threads) |
| TrackedMr | A merge request being tracked for review assignments |
| ReviewAction | An action to perform on the platform (comment, resolve, reply) |
| DiffMetadata | Parsed metadata from a merge request diff |

Workflow: Creating a new Bounded Context

Step 1: Identify the domain

DDD - Identification

New domain identified: [name]

Questions to validate:
1. What business problem does it solve?
2. What are the specific terms?
3. What are the main entities?
4. Which existing BCs will use it?

Shall we explore these questions?

Step 2: Define the language

DDD - Ubiquitous Language

Proposed glossary for [context]:

| Term | Definition |
|------|------------|
| ... | ... |

Are these terms aligned with the business vocabulary?

Step 3: Define the public API

DDD - Public API

Planned exports for [context]:

Entities: [list]
Use Cases: [list]
Types: [list]

Which other BCs will consume this API?

Step 4: Create the structure

DDD - Structure

I will create:
modules/[context]/
├── index.ts           # Public API
├── entities/
├── use-cases/
├── interface-adapters/
└── testing/

+ Glossary: docs/business/glossary/[context].md

Shall we create this structure?

After validation -> Switch to the Architecture skill for tactical details.


Anti-patterns to avoid

  • A single catch-all "domain" module
  • Mixing vocabulary from multiple contexts
  • Circular dependencies between contexts
  • Importing internal files from another BC
  • Naming modules by technical aspect ("services", "models")

References

  • Domain-Driven Design (Eric Evans, 2003) - Chapters 1-4 (strategic)
  • For tactical patterns -> see architecture skill (Clean Architecture)

When not to use it

  • When defining tactical patterns like Aggregates or Repositories
  • When defining Domain Events
  • When defining Complex Value Objects

Limitations

  • Only applies DDD at the strategic level
  • Does not define tactical patterns like Aggregates or Repositories
  • Does not define Domain Events or Complex Value Objects

How it compares

This skill provides a structured, strategic approach to Domain-Driven Design decisions, contrasting with ad-hoc or purely tactical development methods.

Compared to similar skills

ddd side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ddd (this skill)05moNo flagsAdvanced
software-architecture3336moNo flagsIntermediate
architect-review1094moNo flagsAdvanced
mcp-builder1363moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

software-architecture

davila7

Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.

333868

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

109320

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

codex

Lucklyric

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.

32238

architecture-patterns

wshobson

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

55214

Search skills

Search the agent skills registry