ddd
Skill12 starsChanged 23 days agoMITView on GitHub
Domain-Driven Design system for software development. Use when designing new systems with DDD principles, refactoring existing codebases toward DDD, generating code scaffolding (entities, aggregates, repositories, domain events), facilitating Event Storming sessions, creating bounded context maps, or performing code reviews with a DDD lens. Covers both strategic design (bounded contexts, subdomains, context maps, ubiquitous language) and tactical design (entities, value objects, aggregates, domain services, repositories). Supports all major architecture patterns (Hexagonal/Ports & Adapters, CQRS, Event Sourcing, Clean Architecture) with language-agnostic guidance and concrete examples in Python and TypeScript.
21 other projects use a version of this.
Adopted by
Most recently taken up by
- tcztzy/skillstheir own version, first seen Nov 8, 2026
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
- usetemi/skillstheir own version, first seen Nov 8, 2026
- zdanovichnick/dotnet-pilottheir own version, first seen Nov 6, 2026
- fabiandistler/agentstheir own version, first seen Nov 1, 2026
- grndlvl/software-patternstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use convention-learner, opentelemetry and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
codewithmukeshSkillconvention-learner
Detects and enforces project-specific coding conventions by analyzing existing codebase patterns. Learns naming conventions, folder structure, test organization, and coding style from the existing code. Load when: "conventions", "coding standards", "project patterns", "enforce style", "detect patterns", "learn conventions", "code consistency".
Also in 3 projects that use this
codewithmukeshSkillopentelemetry
OpenTelemetry observability for .NET 10 applications. Covers traces, metrics, and logs using the OpenTelemetry SDK with OTLP export. Includes custom ActivitySource, IMeterFactory metrics, resource configuration, and Aspire Dashboard integration. Load this skill when setting up distributed tracing, custom metrics, OTLP export, or when the user mentions "OpenTelemetry", "OTLP", "traces", "spans", "Activity", "ActivitySource", "metrics", "IMeterFactory", "Meter", "Counter", "Histogram", "Gauge", "telemetry", "observability", "distributed tracing", "OTEL", or "Aspire Dashboard".
Also in 3 projects that use this
MovGP0Skillmodern-csharp
Modern C# style guidance for Bendex and MicroSea code changes, including primary constructors, expression-bodied members, var usage, target-typed new, lambdas, and pattern matching.
Also in 3 projects that use this
MicrosoftSkillresilience
Apply resilience patterns (retry, backoff, circuit breaking) when writing or reviewing code that makes outbound HTTP/REST calls, database operations, or any I/O that can experience transient failures. Use this skill when: (1) writing new code that calls external services or APIs, (2) reviewing code that uses fetch, HTTP clients, or service-to-service calls, (3) adding queue consumers or workers that interact with remote systems, (4) debugging intermittent failures in production.
Also in 3 projects that use this
hongyuancSkillvertical-slice
Build and evaluate a production-quality vertical slice before advancing from Pre-Production to Production.
Also in 3 projects that use this
wpankSkillcaching
Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.
Also in 3 projects that use this
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- rome-os/rome★ 894same name
- codewithmukesh/dotnet-claude-kit★ 808same name
- systeminit/swamp★ 695same name
- Resgrid/Core★ 238same name
- NTCoding/living-architecture★ 139same name
- romiluz13/mifal★ 44same name
- DGouron/review-flow★ 42same name
- grndlvl/software-patterns★ 17same name
- jackjin1997/ClawForge★ 12same name
- usetemi/skills★ 6same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/genai-tk/references/agents.mdAGENTS.md
- skills/mastra/references/agents.mdAGENTS.md
- adaption-aiSkill
- api-designSkill
- clairicSkill
- database-designSkill
- genai-tkSkill
- langchainSkill
- linkup-extractSkill
- linkup-fetchSkill
- linkup-researchSkill
- linkup-searchSkill
- linkup-workflowSkill
- mastraSkill
- microservices-patternsSkill
- performance-optimizationSkill
- prime-rlSkill
- scalingoSkill
- security-best-practicesSkill
- smolagentsSkill
- testing-patternsSkill
- typesafe-aiSkill
- uiSkill
- unsloth-hf-jobsSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Always establish strategic design first:
- Distinctive: line 77
Use domain events for cross-aggregate communication
- Distinctive: line 80
Read python-patterns.md for Python with Pydantic, SQLAlchemy, FastAPI
- Distinctive: line 81
Read typescript-patterns.md for TypeScript with NestJS, TypeORM, Prisma
- Distinctive: line 115
Aggregate Reference by Object: Should reference by ID only
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Domain-Driven Design Skill
Apply DDD to build software that reflects deep understanding of the business domain.
Quick Reference
| Task | Reference |
| Bounded contexts, subdomains, context maps | strategic-design.md |
| Entities, value objects, aggregates, repositories | tactical-design.md |
| Hexagonal, CQRS, Event Sourcing, Clean Architecture | architecture-patterns.md |
| Event Storming facilitation & documentation | event-storming.md |
| Python implementations (Pydantic, SQLAlchemy, FastAPI) | python-patterns.md |
| TypeScript implementations (NestJS, TypeORM, Prisma) | typescript-patterns.md |
| DDD code review criteria | code-review.md |
Core Workflow
1. Identify the Task Type
Designing new system? → Start with strategic design, then tactical Refactoring existing code? → Assess current state, identify bounded contexts, refactor incrementally Generating scaffolding? → Determine patterns needed, generate code Event Storming? → Follow facilitation guide Code review? → Apply DDD checklist
2. Strategic Before Tactical
Always establish strategic design first:
- Identify subdomains (Core, Supporting, Generic)
- Define bounded contexts and their boundaries
- Map context relationships (upstream/downstream, conformist, ACL, etc.)
- Establish ubiquitous language per context
3. Select Architecture Pattern
Choose based on domain complexity and requirements:
| Pattern | When to Use |
| Layered | Simple CRUD, low complexity |
| Hexagonal | Need to isolate domain from infrastructure |
| Clean Architecture | Complex business rules, multiple delivery mechanisms |
| CQRS | Different read/write models, complex queries |
| Event Sourcing | Audit trail required, temporal queries, event-driven |
Patterns can be combined (e.g., Hexagonal + CQRS + Event Sourcing).
4. Apply Tactical Patterns
Select tactical building blocks based on needs:
| Building Block | Purpose |
| Entity | Identity matters, mutable, lifecycle |
| Value Object | Defined by attributes, immutable, no identity |
| Aggregate | Consistency boundary, transactional unit |
| Domain Service | Stateless operations spanning multiple aggregates |
| Repository | Collection-like interface for aggregate persistence |
| Domain Event | Record of something significant that happened |
| Factory | Complex object creation logic |
| Specification | Encapsulated business rules for querying/validation |
5. Implementation Guidelines
General principles:
- Domain layer has ZERO infrastructure dependencies
- Depend on abstractions (interfaces/protocols), not concretions
- One aggregate = one repository = one transaction
- Aggregates reference other aggregates by ID only
- Validate invariants within aggregate boundaries
- Use domain events for cross-aggregate communication
Language selection:
- Read python-patterns.md for Python with Pydantic, SQLAlchemy, FastAPI
- Read typescript-patterns.md for TypeScript with NestJS, TypeORM, Prisma
Project Structure Template
src/
├── domain/ # Pure domain logic (no dependencies)
│ ├── model/ # Entities, Value Objects, Aggregates
│ ├── service/ # Domain Services
│ ├── event/ # Domain Events
│ ├── repository/ # Repository interfaces (ports)
│ └── specification/ # Business rule specifications
├── application/ # Use cases, orchestration
│ ├── command/ # Command handlers (write)
│ ├── query/ # Query handlers (read)
│ ├── dto/ # Data transfer objects
│ └── service/ # Application services
├── infrastructure/ # External concerns
│ ├── persistence/ # Repository implementations
│ ├── messaging/ # Event bus, message queue
│ └── external/ # Third-party integrations
└── interface/ # Delivery mechanisms
├── api/ # REST/GraphQL controllers
├── cli/ # Command-line interface
└── event/ # Event consumersAnti-Patterns to Avoid
- Anemic Domain Model: Entities with only getters/setters, logic in services
- God Aggregate: Too many entities in one aggregate
- Shared Kernel Abuse: Overusing shared code between contexts
- Infrastructure Leak: Database concerns in domain layer
- Missing Ubiquitous Language: Technical terms instead of domain terms
- Aggregate Reference by Object: Should reference by ID only
- Transaction Across Aggregates: Violates consistency boundaries
When NOT to Use DDD
DDD adds complexity. Avoid for:
- Simple CRUD applications
- Technical/infrastructure projects without complex business logic
- Prototypes or throwaway code
- Teams unfamiliar with the domain (learn domain first)
Use DDD when:
- Complex, evolving business logic
- Long-lived systems requiring maintainability
- Multiple teams working on related domains
- Domain experts available for collaboration
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

