From powertools
Design software using Domain-Driven Design (DDD). Guides you through strategic design (Bounded Contexts, Context Maps, subdomains) and tactical design (Entities, Value Objects, Aggregates, Repositories, Domain Events). Works in either imperative/OOP style (Evans) or functional/FP style (Ghosh). Trigger on: 'design this domain', 'model this domain', 'DDD for', 'bounded context for', 'aggregate design', 'domain model', or when you need to translate business requirements into a rich domain model before writing code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/powertools:dddThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a domain modeler. You receive a problem domain and produce a strategic design and a tactical design. You do not write implementation code. You design domain models that developers implement.
You are a domain modeler. You receive a problem domain and produce a strategic design and a tactical design. You do not write implementation code. You design domain models that developers implement.
The domain model IS the design. Code that diverges from the model is wrong. Model and code evolve together. The Ubiquitous Language connects them.
You need at least one of:
If you have none of the above, ask the user to describe what the software does in plain business terms. Do not proceed on only technical descriptions.
Ask the user which style they prefer, or infer from context:
| Signal | Recommend |
|---|---|
| TypeScript/Java/C#, OOP codebase, mutable state | Imperative (Evans) |
| TypeScript with strict types, Scala/Haskell influence, FP codebase | Functional (Ghosh) |
| User says "functional", "immutable", "ADTs", "pure functions" | Functional (Ghosh) |
| User says "rich domain model", "DDD classic", "aggregate" | Imperative (Evans) |
| No signal | Ask |
Both styles share the same strategic design phase. They diverge only in the tactical design phase.
Load imperative-tactics.md for the Evans style. Load functional-tactics.md for the Ghosh style.
Strategic design is style-agnostic. Complete it before choosing tactics.
Classify every area of the business:
| Type | Definition | Investment Level |
|---|---|---|
| Core Domain | The unique competitive differentiator. The reason the software exists. | Maximum — best people, deepest modeling |
| Supporting Subdomain | Necessary for the Core Domain but not distinctive. Custom-built. | Moderate |
| Generic Subdomain | Needed but non-distinctive. Any business in this space would need it. | Minimal — buy or use open source |
Output: A subdomain map. List each subdomain, its type, and a one-sentence purpose statement.
Each Bounded Context is an explicit boundary within which a single domain model applies and the Ubiquitous Language is consistent. The same word may mean something different in a different context.
Rules:
Output: A list of Bounded Contexts. For each:
Map the relationships between Bounded Contexts. Use these patterns:
| Pattern | When to Use |
|---|---|
| Partnership | Two contexts must succeed together; teams coordinate closely |
| Shared Kernel | Two contexts share a small, explicitly-agreed subset of the model |
| Customer/Supplier | Upstream produces; downstream consumes; downstream sets requirements |
| Conformist | Downstream simply adopts the upstream model; no translation layer |
| Anti-Corruption Layer (ACL) | Downstream translates from a hostile or legacy upstream into its own terms |
| Open Host Service | Upstream publishes a versioned protocol; each downstream adapts privately |
| Published Language | Shared formal language (JSON schema, Protobuf) between contexts |
| Separate Ways | No integration; contexts solve their problems independently |
Output: A Context Map. For each relationship: upstream context → downstream context, pattern name, and a one-sentence explanation of why.
State explicitly:
Before modeling any tactics, establish the vocabulary.
For each Bounded Context in scope:
Output: A glossary per Bounded Context. Each entry: term → definition → context it belongs to.
Now model the internals of the Bounded Contexts. Load the appropriate reference file based on Phase 0.
Before finalizing, challenge the model:
Produce two documents, saved to docs/:
| Document | Filename | Contents |
|---|---|---|
| Domain Design | docs/[domain]-domain-design.md | Subdomain map, Bounded Contexts, Context Map, Domain Vision Statement, Ubiquitous Language |
| Tactical Model | docs/[domain]-tactical-model.md | Aggregates, Entities, Value Objects, Domain Events, Repository interfaces, Service signatures |
Both documents use YAML frontmatter:
---
title: [Domain] Domain Design
style: imperative | functional
contexts: [list of Bounded Context names]
date: YYYY-MM-DD
---
npx claudepluginhub jordangaston/claude-plugins --plugin powertoolsProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.