Agent skill

Domain Driven Design

by yonatangross in yonatangross/orchestkit

DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts.

MITAuto-check passedDevelopment

Install Domain Driven Design

skills CLI
$ npx skills add yonatangross/orchestkit --skill domain-driven-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yonatangross/orchestkit domain-driven-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/domain-driven-design .claude/skills/domain-driven-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
domain-driven-design
GitHub stars
290
Token cost
~2.3k tokens
SKILL.md length
613 words
Files
12 (incl. scripts, references)
Skills in repo
108
Repo updated
First seen
Licence
MIT

At a glance

DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts.

  • Building rich domain models
  • SKILL.md covers Overview, Building Blocks Overview, Quick Reference and Key Decisions, plus 7 more sections
  • Runs Python scripts from its folder
  • Enforcing invariants

What it does

Domain Driven Design is an agent skill from yonatangross/orchestkit. DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts. Python dataclass implementations with TypeScript alternatives. Use when building rich domain models, enforcing invariants, or separating domain logic from infrastructure.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts and reference files (for example `references/ork-delta.md`, `references/repositories.md` and `rules/_sections.md`). Compatibility notes: Claude Code 2.1.277+.

It sits in Development, covering Domain-driven design. It works with Python and TypeScript. The repository describes itself as: The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install ork for stable (v9.x), or ork-alpha for the v10 line, which ships daily. The licence is MIT.

When your agent uses it

  • Building rich domain models
  • Enforcing invariants
  • Separating domain logic from infrastructure

Example prompts

  • “/domain-driven-design”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Claude Code 2.1.277+.
  • Pre-approved tools (allowed-tools): Read, Glob, Grep, WebFetch, WebSearch

What it can do on your machine

Read from SKILL.md and the folder at commit 02bbf9a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • WebFetch
    • WebSearch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com
    • docs.python.org
    • postgresql.org
    • github.com
    • docs.stripe.com
    • redis.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code 2.1.277+.

    From compatibility in the SKILL.md frontmatter.

Context cost

Domain Driven Design loads about 2.3k tokens when it runs, and up to ~6.1k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 613 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from yonatangross/orchestkit at commit 02bbf9a, republished under its MIT licence (© yonatangross). 613 words, ~2,298 tokens.

Download SKILL.mdSave it as .claude/skills/domain-driven-design/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
domain-driven-design
description
DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts. Python dataclass implementations with TypeScript alternatives. Use when building rich domain models, enforcing invariants, or separating domain logic from infrastructure.
allowed-tools
Read, Glob, Grep, WebFetch, WebSearch
compatibility
Claude Code 2.1.277+.
license
MIT
user-invocable
false
disable-model-invocation
true
metadata.owner-agent
backend-system-architect
metadata.category
document-asset-creation
metadata.version
1.0.0
metadata.author
OrchestKit
metadata.complexity
medium
metadata.tags
ddd, domain-modeling, entities, value-objects, bounded-contexts, python

Domain-Driven Design Tactical Patterns

Model complex business domains with entities, value objects, and bounded contexts.

Overview

  • Modeling complex business logic
  • Separating domain from infrastructure
  • Establishing clear boundaries between subdomains
  • Building rich domain models with behavior
  • Implementing ubiquitous language in code

Building Blocks Overview

┌─────────────────────────────────────────────────────────────┐
│                    DDD Building Blocks                       │
├─────────────────────────────────────────────────────────────┤
│  ENTITIES           VALUE OBJECTS        AGGREGATES         │
│  Order (has ID)     Money (no ID)        [Order]→Items      │
│                                                              │
│  DOMAIN SERVICES    REPOSITORIES         DOMAIN EVENTS      │
│  PricingService     IOrderRepository     OrderSubmitted     │
│                                                              │
│  FACTORIES          SPECIFICATIONS       MODULES            │
│  OrderFactory       OverdueOrderSpec     orders/, payments/ │
└─────────────────────────────────────────────────────────────┘

Quick Reference

Entity (Has Identity)
python
from dataclasses import dataclass, field
from uuid import UUID
from uuid_utils import uuid7

@dataclass
class Order:
    """Entity: Has identity, mutable state, lifecycle."""
    id: UUID = field(default_factory=uuid7)
    customer_id: UUID = field(default=None)
    status: str = "draft"

    def __eq__(self, other: object) -> bool:
        if not isinstance(other, Order):
            return NotImplemented
        return self.id == other.id  # Identity equality

    def __hash__(self) -> int:
        return hash(self.id)

ID generation is a house rule, not a taste call: Read("references/ork-delta.md").

Value Object (Immutable)
python
from dataclasses import dataclass
from decimal import Decimal

@dataclass(frozen=True)  # MUST be frozen!
class Money:
    """Value Object: Defined by attributes, not identity."""
    amount: Decimal
    currency: str

    def __add__(self, other: "Money") -> "Money":
        if self.currency != other.currency:
            raise ValueError("Cannot add different currencies")
        return Money(self.amount + other.amount, self.currency)

Canonical Address / DateRange boilerplate is not restated here. See the upstream coverage table below.

Key Decisions

DecisionRecommendation
Entity vs VOHas unique ID + lifecycle? Entity. Otherwise VO
Entity equalityBy ID, not attributes
Value object mutabilityAlways immutable (frozen=True)
Repository scopeOne per aggregate root
Domain eventsCollect in entity, publish after persist
Context boundariesBy business capability, not technical

Rules Quick Reference

RuleImpactWhat It Covers
aggregate-boundaries (load rules/aggregate-boundaries.md)HIGHAggregate root design, reference by ID, one-per-transaction
aggregate-invariants (load rules/aggregate-invariants.md)HIGHBusiness rule enforcement, specification pattern
aggregate-sizing (load rules/aggregate-sizing.md)HIGHRight-sizing, when to split, eventual consistency

When NOT to Use

Under 5 entities? Skip DDD entirely. The ceremony costs more than the benefit.

PatternInterviewHackathonMVPGrowthEnterpriseSimpler Alternative
AggregatesOVERKILLOVERKILLOVERKILLSELECTIVEAPPROPRIATEPlain dataclasses with validation
Bounded contextsOVERKILLOVERKILLOVERKILLBORDERLINEAPPROPRIATEPython packages with clear imports
CQRSOVERKILLOVERKILLOVERKILLOVERKILLWHEN JUSTIFIEDSingle model for read/write
Value objectsOVERKILLOVERKILLBORDERLINEAPPROPRIATEREQUIREDTyped fields on the entity
Domain eventsOVERKILLOVERKILLOVERKILLSELECTIVEAPPROPRIATEDirect method calls between services
Repository patternOVERKILLOVERKILLBORDERLINEAPPROPRIATEREQUIREDDirect ORM queries in service layer

Rule of thumb: DDD adds ~40% code overhead. Only worth it when domain complexity genuinely demands it (5+ entities with invariants spanning multiple objects). A CRUD app with DDD is a red flag.

Anti-Patterns (FORBIDDEN)

python
# NEVER have anemic domain models (data-only classes)
@dataclass
class Order:
    id: UUID
    items: list  # WRONG - no behavior!

# NEVER leak infrastructure into domain
class Order:
    def save(self, session: Session):  # WRONG - knows about DB!

# NEVER use mutable value objects
@dataclass  # WRONG - missing frozen=True
class Money:
    amount: Decimal

# NEVER have repositories return ORM models
async def get(self, id: UUID) -> OrderModel:  # WRONG - return domain!
Show full SKILL.md (322 more words)Show less

Upstream coverage (do not restate)

These topics are documented first-party. Read the source instead of re-deriving them here; only the house consequences are kept, in references/ork-delta.md.

TopicSource
Entity / value-object dataclass mechanics: frozen, __post_init__, inherited field ordering, kw_onlyhttps://docs.python.org/3/library/dataclasses.html
Domain event definition, deferred dispatch, handler wiring, dispatch before vs after commithttps://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/domain-events-design-implementation
Bounded contexts, context map, ubiquitous language, integration patterns (shared kernel, customer-supplier, conformist, open host service, published language)https://learn.microsoft.com/en-us/azure/architecture/microservices/model/domain-analysis
Anti-corruption layer: what it translates and what it costshttps://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer
UUIDv7 generation, server side and in Pythonhttps://www.postgresql.org/docs/18/functions-uuid.html and https://github.com/aminalaee/uuid-utils
Payment amounts in minor units, zero-decimal currencieshttps://docs.stripe.com/currencies
Publishing events to a Redis Stream (XADD field maps, pipelining)https://redis.io/docs/latest/commands/xadd/
Layered architecture enforcement, project-structure validation, test standardsthe architecture-patterns skill in this plugin

Two subjects deliberately stay in this skill rather than routing upstream: the repository and Unit of Work implementation, which lives in full in references/repositories.md, and aggregate boundaries, invariants, and sizing, which live in full in rules/.

  • rules/aggregate-boundaries.md, rules/aggregate-invariants.md, rules/aggregate-sizing.md - aggregate design, in this skill
  • ork:architecture-patterns - Layer boundaries and project structure validation
  • ork:distributed-systems - Cross-aggregate coordination
  • ork:database-patterns - Schema design for DDD

References

Load on demand with Read("references/<file>"):

FileContent
ork-delta.mdHouse rules: UUIDv7, event drain ordering, ACL boundary, source layout
repositories.mdRepository pattern, Unit of Work, SQLAlchemy mapping

Capability Details

entities

Keywords: entity, identity, lifecycle, mutable, domain object Solves: Identity equality by ID, and the house UUIDv7 ID rule in references/ork-delta.md. Dataclass mechanics route upstream.

value-objects

Keywords: value object, immutable, frozen, dataclass, structural equality Solves: When to use VO vs entity. frozen=True semantics and inherited field ordering route upstream.

domain-services

Keywords: domain service, business logic, cross-aggregate, stateless Solves: When to use domain service, logic spanning aggregates

repositories

Keywords: repository, persistence, collection, IRepository, protocol Solves: Implement repository pattern, abstract DB access, ORM mapping

bounded-contexts

Keywords: bounded context, context map, ACL, subdomain, ubiquitous language Solves: The house ACL boundary and context-first source layout in references/ork-delta.md. Context mapping and integration patterns route upstream.

© yonatangross, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references) in src/skills/domain-driven-design of yonatangross/orchestkit.

  • SKILL.md
  • references/ork-delta.md
  • references/repositories.md
  • rules/_sections.md
  • rules/_template.md
  • rules/aggregate-boundaries.md
  • rules/aggregate-invariants.md
  • rules/aggregate-sizing.md
  • scripts/entity-template.py
  • scripts/repository-template.py
  • scripts/value-object-template.py
  • test-cases.json

Open the folder on GitHubat commit 02bbf9a

Compare with similar skills

Domain Driven Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Domain Driven Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Domain Driven Design this skillyonatangross/orchestkit290—~2.3kAutomated safety check: PassMIT
Build Teaql Appteaql/teaql-agent-kit2.8k—~4.6kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Skyvern Version BumpSkyvern-AI/skyvern23k—~1kAutomated safety check: NotesAGPL-3.0
Mirage VFS Adapter Authoringstrukto-ai/mirage3.7k—~2.5kAutomated safety check: PassApache-2.0
Evolutionary Modular Architecturetech-leads-club/agent-skills7k—~3.7kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Build Teaql App

    teaql/teaql-agent-kit

    Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries.

    2.8k GitHub stars~4.6k tokensUpdated 12 days ago
    MobileAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Skyvern Version Bump

    Skyvern-AI/skyvern

    Walks through a Skyvern open-source release bump: update the version, rebuild the Python and TypeScript SDKs with Fern, commit, and open a pull request.

    23k GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check: notes
  • Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

    3.7k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.4k GitHub stars~5k tokensUpdated today
    DevelopmentAuto-check passed

More from yonatangross/orchestkit

All 108 skills in this repo
  • API Design

    yonatangross/orchestkit

    API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs.

    290 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Architecture Decision Record

    yonatangross/orchestkit

    ADR templates in the Nygard format with context, decision, consequences, and alternatives.

    290 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Audit Full

    yonatangross/orchestkit

    Single-pass codebase analysis leveraging a 1M-token context window for comprehensive security scanning, architecture review, and dependency auditing.

    290 GitHub stars~3.5k tokensUpdated today
    Auto-check: notes
  • Code Review Playbook

    yonatangross/orchestkit

    Structured review processes, conventional comments, language-specific checklists, and feedback templates.

    290 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create PR

    yonatangross/orchestkit

    Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation.

    290 GitHub stars~4.5k tokensUpdated today
    Auto-check: notes
  • Explore

    yonatangross/orchestkit

    Multi-angle codebase exploration spawning 3-5 parallel agents for code structure, data flow, architecture patterns, and health assessment.

    290 GitHub stars~3.9k tokensUpdated today
    Auto-check: notes

Categories

Questions about Domain Driven Design

What does Domain Driven Design do?

DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts. Domain Driven Design is an agent skill from yonatangross/orchestkit. DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts.

When should I use Domain Driven Design?

Domain Driven Design fits situations like: building rich domain models; enforcing invariants; separating domain logic from infrastructure.

How do I install Domain Driven Design in Claude Code?

Run `npx skills add yonatangross/orchestkit --skill domain-driven-design -a claude-code`. Or copy the skill folder (src/skills/domain-driven-design in yonatangross/orchestkit) into .claude/skills/domain-driven-design in your project. Claude Code loads it when a task matches its description.

How do I install Domain Driven Design in Codex?

Run `npx skills add yonatangross/orchestkit --skill domain-driven-design -a codex`. Or copy the skill folder (src/skills/domain-driven-design in yonatangross/orchestkit) into .agents/skills/domain-driven-design in your project. Codex loads it when a task matches its description.

Can I use Domain Driven Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yonatangross/orchestkit --skill domain-driven-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/domain-driven-design, .gemini/skills/domain-driven-design, .github/skills/domain-driven-design and .opencode/skills/domain-driven-design in your project.

What does Domain Driven Design need to run?

Going by SKILL.md and its folder, Domain Driven Design needs Python for the scripts in its folder. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Glob, Grep, WebFetch, WebSearch. Compatibility (from SKILL.md): Claude Code 2.1.277+..

Does Domain Driven Design access the network?

SKILL.md names 6 domains. As links in the text: learn.microsoft.com, docs.python.org, postgresql.org, github.com, docs.stripe.com and redis.io. This is read from the text; nothing was executed.

Is Domain Driven Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Domain Driven Design use?

Domain Driven Design is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Domain Driven Design use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Domain Driven Design?

Skills that share tags, products or a category with Domain Driven Design: Build Teaql App (teaql/teaql-agent-kit, 2.8k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Skyvern Version Bump (Skyvern-AI/skyvern, 23k stars) and Mirage VFS Adapter Authoring (strukto-ai/mirage, 3.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Domain Driven Design?

yonatangross (a GitHub user) maintains it in yonatangross/orchestkit, which has 290 GitHub stars. The repository holds 108 skills in this directory. The repository was last updated on October 9, 2026.

Source: yonatangross/orchestkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.