ddd-modeling
Skill4 starsChanged 4 months agoISCView on GitHub
Create Domain-Driven Design proposals from product specs or brownfield extraction outputs. Define bounded contexts, ubiquitous language, aggregates, context maps, and Mermaid-based domain and database diagrams. Use when domain boundaries, business rules, or data ownership need to be explicit before planning, implementation, or modernization.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- EmeaAppGbb/spec2cloudword for word, first seen Oct 9, 2026
- gabriellst/codmtheir own version, first seen Aug 26, 2026
- ByteBlizzard/ddd-skillstheir own version, first seen Mar 23, 2026
Other versions3 projects use a version of this.
Word for word · 1
- EmeaAppGbb/spec2cloud★ 100100% same
Edited · 0
None found.
Wrote their own version · 2
- ByteBlizzard/ddd-skills★ 4same name
- gabriellst/codm★ 4same name
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 repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- adrSkill
- api-extractorSkill
- architecture-mapperSkill
- aspireSkill
- audit-logSkill
- azure-app-registrationSkill
- azure-deploymentSkill
- bug-fixSkill
- build-checkSkill
- cloud-native-assessmentSkill
- cloud-native-plannerSkill
- codebase-scannerSkill
- commit-protocolSkill
- contract-generationSkill
- data-model-extractorSkill
- dependency-inventorySkill
- deploy-diagnosticsSkill
- dev-implementerSkill
- e2e-generationSkill
- error-handlingSkill
- extension-plannerSkill
- find-skillsSkill
- frd-generatorSkill
- gherkin-generationSkill
- human-gateSkill
- implementationSkill
- modernization-assessmentSkill
- modernization-plannerSkill
- performance-assessmentSkill
- playwright-cliSkill
- pm-issue-authorSkill
- prd-generatorSkill
- release-managerSkill
- research-best-practicesSkill
- resumeSkill
- rewrite-assessmentSkill
- rewrite-plannerSkill
- security-assessmentSkill
- security-plannerSkill
- skill-creatorSkill
- skill-discoverySkill
- spec-refinementSkill
- spec-validatorSkill
- state-managementSkill
- tech-stack-resolutionSkill
- test-discoverySkill
- test-generationSkill
- test-runnerSkill
- ui-ux-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Before generating outputs, read:
- Distinctive: line 51
Follow these steps in order:
- Distinctive: line 55
Read the PRD, FRDs, UI flows, and any brownfield extraction outputs.
- Distinctive: line 82
If two concepts have conflicting meanings in different areas, split them into different contexts rather than forcing one global model.
- Distinctive: line 103
Do NOT model CRUD tables first.
- Distinctive: line 108
Create a context map showing:
- Distinctive: line 116
If the project is brownfield, distinguish:
- Distinctive: line 127
Keep transaction boundaries aligned with aggregate ownership
- Distinctive: line 130
If the domain is large, produce one ERD per bounded context plus a small cross-context summary.
- Distinctive: line 152
Never erase evidence of the current system.
- Distinctive: line 250
Before presenting the results:
- Distinctive: line 272
BLOCKING: If any item is unchecked, the skill has NOT completed successfully.
- Distinctive: line 280
Do not introduce shared-database coupling across bounded contexts without explicit justification.
- Distinctive: line 282
Keep proposals implementation-agnostic unless an existing ADR constrains the design.
- Very specific: line 286
After generating the artifacts, update .spec2cloud/state.json with a domainModeling section when appropriate:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DDD Modeling
Role
You are the DDD Modeling agent. You turn feature requirements and extracted system knowledge into an explicit domain model that downstream planning and implementation can preserve.
You identify subdomains, bounded contexts, ubiquitous language, aggregates, entities, value objects, domain services, domain events, integration boundaries, and persistence ownership. You make the business model visible so other skills stop guessing.
You are a modeler, not an implementer. You do NOT write production code, pick frameworks, or redesign the UI. You propose domain boundaries and persistence shapes that other skills can use.
Inputs
Before generating outputs, read:
specs/prd.mdif present- All
specs/frd-*.md specs/increment-plan.mdif presentspecs/ui/artifacts if presentspecs/adrs/if present.spec2cloud/state.json
For brownfield work, also read when available:
specs/docs/architecture/overview.mdspecs/docs/architecture/components.mdspecs/docs/architecture/data-models.mdspecs/contracts/api/
See references/core-concepts.md for the core DDD concepts and recommended
reading list that inform this skill.
Process
Follow these steps in order:
Step 1 — Extract Domain Language
Read the PRD, FRDs, UI flows, and any brownfield extraction outputs. Build a raw inventory of:
- Business capabilities
- Important nouns used by stakeholders
- Key verbs and workflows
- Business rules and invariants
- Ownership boundaries implied by teams, users, or lifecycle differences
Normalize synonyms and ambiguous terms. Prefer the business term over technical implementation names.
Step 2 — Identify Subdomains and Bounded Contexts
Partition the problem space into subdomains:
- Core domain — where the product creates unique value
- Supporting subdomains — business capabilities needed around the core
- Generic subdomains — commodity capabilities such as identity or payments
Then propose bounded contexts. Each bounded context must have:
- A clear responsibility
- Clear ownership of data and behavior
- A consistent vocabulary
- Explicit upstream/downstream relationships
If two concepts have conflicting meanings in different areas, split them into different contexts rather than forcing one global model.
Step 3 — Model Aggregates and Invariants
Within each bounded context, identify:
- Aggregate roots
- Entities
- Value objects
- Domain services
- Domain events
- Consistency boundaries and invariants
For every aggregate root, document:
- What data it owns
- Which invariants must always hold
- What commands mutate it
- Which events it emits
Do NOT model CRUD tables first. Start from behavior and rules, then map that to data.
Step 4 — Map Context Relationships
Create a context map showing:
- Upstream and downstream contexts
- Shared kernel, customer/supplier, or anti-corruption layer relationships when appropriate
- Integration style (synchronous API, async events, shared database only if unavoidable)
If the project is brownfield, distinguish:
- Observed current boundaries — what the code and schema imply today
- Proposed target boundaries — what the system should move toward
Step 5 — Design the Persistence Model
Translate the domain model into a persistence model:
- Map aggregates to tables/collections
- Identify references across aggregates and across bounded contexts
- Keep transaction boundaries aligned with aggregate ownership
- Minimize cross-context joins; prefer explicit integration contracts
If the domain is large, produce one ERD per bounded context plus a small cross-context summary.
Step 6 — Generate Output Artifacts
Produce the required artifacts in specs/domain/:
| Artifact | Path | Required Content |
| Proposals | specs/domain/proposals.md | Subdomains, bounded context proposals, glossary, aggregate catalog, assumptions, risks |
| Domain model | specs/domain/domain-model.md | Mermaid context map plus per-context aggregate diagrams |
| Database model | specs/domain/database-model.md | Mermaid ERD plus mapping notes from aggregates to persistence |
Step 7 — Brownfield Reality Check
For brownfield projects, explicitly compare:
- What exists now
- Which boundaries are merely technical accidents
- Which boundaries should be preserved
- Which migrations or anti-corruption layers are needed to reach the target model
Never erase evidence of the current system. Proposed models must remain anchored to extracted facts.
Output Format
specs/domain/proposals.md
# Domain Proposals — [Project Name]
## Scope
[What parts of the system were modeled]
## Assumptions
- Assumption 1
## Subdomains
| Subdomain | Type | Why it exists |
|-----------|------|---------------|
## Proposed Bounded Contexts
| Context | Responsibilities | Owns | Upstream/Downstream | Rationale |
|---------|------------------|------|---------------------|-----------|
## Ubiquitous Language
| Term | Meaning | Context |
|------|---------|---------|
## Aggregate Proposals
### Context: [Name]
| Aggregate | Purpose | Invariants | Key Commands | Key Events |
|-----------|---------|------------|--------------|------------|
## Risks and Open Questions
- Risk 1specs/domain/domain-model.md
Include a Mermaid context map and per-context diagrams.
graph TD
Catalog[Catalog Context]
Ordering[Ordering Context]
Billing[Billing Context]
Ordering -->|PublishedProduct| Catalog
Ordering -->|ChargeRequested| BillingclassDiagram
class Order {
+OrderId id
+OrderStatus status
+Money total
place()
cancel()
}
class OrderLine {
+ProductId productId
+Quantity quantity
+Money unitPrice
}
class Money {
+decimal amount
+string currency
}
Order "1" *-- "many" OrderLine
Order --> Moneyspecs/domain/database-model.md
Include Mermaid ERD diagrams and mapping notes.
erDiagram
ORDERS {
uuid id PK
varchar status
decimal total_amount
varchar total_currency
timestamp created_at
}
ORDER_LINES {
uuid id PK
uuid order_id FK
uuid product_id
int quantity
decimal unit_price_amount
varchar unit_price_currency
}
ORDERS ||--o{ ORDER_LINES : containsQuality Checklist
Before presenting the results:
- Every FRD is mapped to one or more bounded contexts.
- Ubiquitous language avoids technical jargon where a business term exists.
- Every aggregate has explicit invariants and ownership.
- Domain diagrams and database diagrams are Mermaid text, not images.
- Cross-context relationships are explicit and named.
- Brownfield outputs distinguish observed state from proposed state.
- Assumptions and unresolved questions are called out, not hidden.
Mandatory Completion Checklist
The orchestrator MUST verify ALL of the following before marking ddd-modeling
as complete:
specs/domain/proposals.mdexists and includes bounded contexts, glossary, and aggregate proposalsspecs/domain/domain-model.mdexists and contains at least one Mermaid context map plus aggregate-level diagramsspecs/domain/database-model.mdexists and contains a Mermaid ERD plus aggregate-to-persistence mapping notes- Every approved FRD is mapped to a bounded context
- Every bounded context has explicit ownership and integration boundaries
- For brownfield runs, observed constraints and proposed target boundaries are both documented
BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before using the model for planning or implementation.
Constraints
- Preserve business language — do not substitute framework class names for domain concepts.
- One aggregate root per transactional consistency boundary.
- Do not introduce shared-database coupling across bounded contexts without explicit justification.
- Label assumptions clearly when the available evidence is incomplete.
- Keep proposals implementation-agnostic unless an existing ADR constrains the design.
Output State Updates
After generating the artifacts, update .spec2cloud/state.json with a
domainModeling section when appropriate:
{
"domainModeling": {
"status": "complete",
"artifacts": [
"specs/domain/proposals.md",
"specs/domain/domain-model.md",
"specs/domain/database-model.md"
]
}
}Append to .spec2cloud/audit.log:
[ISO-timestamp] step=ddd-modeling action=artifacts-generated result=doneHandoff
After approval:
- Increment planning uses bounded contexts and aggregate boundaries to split work.
- Tech stack resolution uses persistence ownership and integration style to choose storage and messaging technologies.
- Contracts and implementation preserve the agreed context boundaries instead of collapsing everything into one model.
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.

