agentsclimarketplace

Ddd strategic

Skill spec2ship/spec2ship/skills/ddd-strategic

This skill should be used when the user asks to 'model the domain', 'identify bounded contexts', 'map domain relationships', 'run event storming', 'define ubiquitous language', 'analyze domain complexity'. Provides DDD strategic patterns for requirements and design.From its SKILL.md

Install
npx -y skills add spec2ship/spec2ship --skill ddd-strategic

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

9.5 KB, as published. Nobody here has run it

DDD Strategic Patterns for Domain Modeling

Purpose

Domain-Driven Design (DDD) strategic patterns help teams understand complex business domains and define clear boundaries between system components. This skill focuses on strategic patterns used during requirements and architecture discussions, not implementation-level tactical patterns.

When to Use This Skill

  • During specs workflow to understand domain complexity
  • Identifying system boundaries in design workflow
  • Clarifying terminology and concepts
  • Analyzing integrations between systems
  • Decomposing monoliths or designing microservices

Core Concepts

  • Domain: The subject area the software addresses
  • Subdomain: A coherent part of the overall domain
  • Bounded Context: A boundary within which a domain model is defined and applicable
  • Ubiquitous Language: Shared vocabulary between developers and domain experts
  • Context Map: Visual representation of relationships between bounded contexts

Subdomains

Not all parts of a domain are equally important:

TypeImportanceInvestmentExample
CoreCompetitive advantageHigh - build customRecommendation engine, Pricing algorithm
SupportingNecessary but not differentiatingMedium - build or buyReporting, Notifications
GenericCommon across industriesLow - buy or use SaaSAuthentication, Payments, Email

Subdomain Identification Questions

  • What makes our business unique? → Core
  • What do we need but doesn't differentiate us? → Supporting
  • What does every company in our industry need? → Generic

Bounded Contexts

A Bounded Context is a semantic boundary where terms have specific meanings.

Key Properties

PropertyDescription
LinguisticSame term can mean different things in different contexts
TeamOften aligned with team ownership
DeploymentCan be deployed independently
DataOwns its data, doesn't share database

Example: "Customer" in Different Contexts

ContextCustomer MeansKey Attributes
SalesLead/ProspectContact info, Pipeline stage, Deal size
BillingAccountPayment method, Invoices, Credit limit
SupportUserTickets, SLA, Satisfaction score
ShippingRecipientAddress, Delivery preferences

Insight: Each context has its own Customer model. Don't force a "universal customer" entity.


Context Mapping

Context maps show how bounded contexts relate to each other.

Relationship Patterns

PatternDirectionDescriptionUse When
Partnership⟷Teams coordinate closelyMutual dependency, aligned goals
Shared Kernel⟷Shared code/model subsetLimited overlap, high trust
Customer-Supplier←Downstream depends on upstreamClear dependency direction
Conformist←Downstream adopts upstream modelNo influence over upstream
Anticorruption Layer (ACL)←Translation layer protects downstreamUpstream model doesn't fit
Open Host Service→Upstream exposes public APIMultiple consumers
Published Language→Documented interchange formatExternal consumers
Separate Ways✗No integrationCosts outweigh benefits

Context Map Diagram

┌─────────────────┐     Partnership      ┌─────────────────┐
│   Sales         │◄──────────────────►│   Marketing     │
└────────┬────────┘                     └─────────────────┘
         │
         │ Customer-Supplier
         ▼
┌─────────────────┐     ACL            ┌─────────────────┐
│   Billing       │◄───────────────────│  Legacy ERP     │
└────────┬────────┘                     └─────────────────┘
         │
         │ Open Host Service
         ▼
┌─────────────────┐
│   Reporting     │ (Conformist)
└─────────────────┘

Ubiquitous Language

A shared vocabulary that is:

  • Used consistently in code, documentation, and conversations
  • Defined within a specific bounded context
  • Evolved collaboratively with domain experts

Building Ubiquitous Language

ActivityOutput
Domain expert interviewsTerm definitions, Business rules
Event StormingEvents, Commands, Aggregates
Example mappingConcrete scenarios, Edge cases
Glossary creationCanonical definitions

Language Conflicts Signal Context Boundaries

When the same word means different things to different people:

  • Option A: Clarify within one context (refine language)
  • Option B: Recognize two contexts exist (split)

Event Storming

A collaborative workshop technique for domain exploration.

Event Storming Elements

ColorElementDescriptionQuestion
🟧 OrangeDomain EventSomething that happened"What happened?"
🟦 BlueCommandTrigger for an event"What caused this?"
🟨 YellowActorWho issues the command"Who did this?"
🟪 PurplePolicyReactive logic"When this happens, then..."
🟩 GreenRead ModelInformation needed"What info was needed?"
🟥 PinkExternal SystemOutside integration"Who else is involved?"
🔴 RedHot SpotProblem/Question"Something's unclear here"
🟫 TanAggregateConsistency boundary"What data changes together?"

Event Storming Flow

[Actor] ──triggers──> [Command] ──causes──> [Domain Event]
                                                  │
                                                  ▼
                                            [Policy] ──may trigger──> [Command]

Big Picture Event Storming Output

  1. Timeline of domain events
  2. Identified bounded contexts (clustered events)
  3. Hot spots (unknowns, conflicts)
  4. Key policies and business rules

Domain Complexity Heuristics

Conway's Law Consideration

"Organizations produce designs that mirror their communication structures."

Implication: Bounded context boundaries should consider team structure.

Complexity Indicators

SignalPossible Issue
Same term, different meaningsMissing context boundary
Long coordination cyclesToo many cross-context dependencies
Large shared databaseContexts not properly separated
Frequent breaking changesInsufficient ACL protection
"We need to sync with Team X first"Partnership or Customer-Supplier needed

Domain Modeling in Roundtables

Questions for specs Workflow

  • What are the core business capabilities?
  • Where does complexity live? (Core subdomains)
  • What terms do domain experts use?
  • Are there ambiguous terms that mean different things?
  • What events matter to the business?

Questions for design Workflow

  • How should we partition the system?
  • Which contexts need to communicate?
  • What integration patterns fit each relationship?
  • Where do we need anticorruption layers?
  • What can we buy vs. build?

Artifacts to Produce

WorkflowArtifactPurpose
specsSubdomain classificationInvestment decisions
specsGlossary / Ubiquitous LanguageShared vocabulary
specsDomain Events listBusiness capability mapping
designContext MapIntegration architecture
designContext boundariesService/module design

Anti-Patterns to Flag

Anti-PatternProblemBetter Approach
Universal Entity"Customer" used everywhere same waySeparate models per context
Shared DatabaseAll services read/write same tablesEach context owns its data
Big Ball of MudNo clear boundariesIdentify contexts, draw lines
Anemic Domain ModelLogic in services, dumb data objects(Tactical - but flag if seen)
Distributed MonolithMicroservices but tightly coupledProper context boundaries first

Quick Reference: Strategic vs Tactical DDD

LevelFocusRoundtable Relevance
StrategicContexts, Maps, Subdomains✅ High - discuss in specs/design
TacticalEntities, Aggregates, Repositories⚠️ Low - implementation detail

This skill focuses on strategic patterns for roundtable discussions.


References

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.