agentsclimarketplace

Ddd core

Skill kinhluan/skills/.agent-skills/ddd-core

πŸš€ Professional Multi-Agent Skills

Install
npx -y skills add kinhluan/skills --skill ddd-core

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

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Professional Strategic Domain-Driven Design (DDD) Hub. Use this skill for Event Storming, identifying Subdomains, defining Bounded Contexts, and mapping Domain Models to the heart of your architecture.

SKILL.md

15.4 KB, as published. Nobody here has run it

Domain-Driven Design (DDD): Strategic Hub & Workshop

"The heart of software is its ability to solve domain-related problems for its user." β€” Eric Evans, Domain-Driven Design (2003)

Strategic DDD is about taming complexity by identifying what to build, how to organize teams, and where to focus investment. It answers: What are the boundaries of our system? What is our competitive advantage? How do teams align with domains?


πŸŒͺ Event Storming: The Discovery Workshop

Event Storming, created by Alberto Brandolini, is a collaborative workshop where domain experts and developers explore business processes together. It's the fastest way to discover Bounded Contexts.

Before You Start

Participants (4-8 people ideal):

  • 1-2 Domain Experts (know the business inside-out)
  • 2-3 Developers (will build the system)
  • 1 Facilitator (keeps time, asks "why?")
  • Optional: UX designer, QA, product manager

Materials:

  • Large wall or whiteboard (6+ meters)
  • Orange sticky notes (Domain Events)
  • Blue sticky notes (Commands)
  • Yellow sticky notes (Actors/Users)
  • Pink sticky notes (Policies/Business Rules)
  • Green sticky notes (Views/Read Models)
  • Purple sticky notes (Aggregates)
  • Markers, timer (45-90 minutes)

Phase 1: Big Picture (Chaotic Exploration)

Goal: Dump ALL domain events onto the wall. No filtering.

Instructions:

  1. Everyone writes domain events on orange stickies β€” one event per sticky
  2. Events must be in past tense: OrderPlaced, PaymentReceived, InventoryReserved
  3. Place them on the wall in rough chronological order
  4. Rule: No discussion longer than 2 minutes per event. Move fast.

Example Events for E-Commerce:

UserRegistered, ProductAddedToCart, CartCheckedOut,
OrderPlaced, PaymentInitiated, PaymentConfirmed,
InventoryReserved, OrderConfirmed, ShippingLabelCreated,
OrderShipped, DeliveryConfirmed, OrderCompleted,
RefundRequested, RefundProcessed

Time: 15-20 minutes

Phase 2: Timeline & Hotspots

Goal: Organize events into a coherent timeline. Identify problems.

Instructions:

  1. Arrange events left-to-right in chronological order
  2. Add hotspots (red stickies) where:
    • People disagree on what happens
    • The process is unclear
    • There are known bugs or pain points
    • Multiple teams are involved
  3. Don't solve hotspots yet β€” just mark them

Time: 10-15 minutes

Phase 3: Actors & Commands

Goal: Identify WHO triggers WHAT.

Instructions:

  1. For each event, ask: "What command caused this?"
  2. Write commands on blue stickies, place before the event
  3. Ask: "Who issues this command?"
  4. Write actors on yellow stickies, place before the command
[Actor: Customer] β†’ [Command: PlaceOrder] β†’ [Event: OrderPlaced]
[Actor: System]   β†’ [Command: ProcessPayment] β†’ [Event: PaymentConfirmed]
[Actor: Warehouse]β†’ [Command: ShipOrder] β†’ [Event: OrderShipped]

Time: 15-20 minutes

Phase 4: Policies & Business Rules

Goal: Capture automated decisions.

Instructions:

  1. Look for events that trigger other events automatically
  2. Write policies on pink stickies
  3. Format: "Whenever [Event], then [Command/Action]"
[Policy: Whenever PaymentConfirmed, then ReserveInventory]
[Policy: Whenever InventoryReserved, then ConfirmOrder]
[Policy: Whenever OrderConfirmed, then CreateShippingLabel]

Time: 10 minutes

Phase 5: Aggregate Identification

Goal: Group related commands and events into consistency boundaries.

Instructions:

  1. Draw boundaries around clusters of events that change together
  2. Name each cluster β€” this is your Aggregate
  3. Ask: "Can these events be inconsistent with each other?" If yes, same aggregate.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ORDER AGGREGATE            β”‚
β”‚  ─────────────────          β”‚
β”‚  Events:                    β”‚
β”‚    OrderPlaced              β”‚
β”‚    PaymentConfirmed         β”‚
β”‚    OrderConfirmed           β”‚
β”‚    OrderShipped             β”‚
β”‚    OrderCompleted           β”‚
β”‚                             β”‚
β”‚  Commands:                  β”‚
β”‚    PlaceOrder               β”‚
β”‚    ConfirmPayment           β”‚
β”‚    ShipOrder                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  INVENTORY AGGREGATE        β”‚
β”‚  ─────────────────          β”‚
β”‚  Events:                    β”‚
β”‚    InventoryReserved        β”‚
β”‚    InventoryReleased        β”‚
β”‚    StockReplenished         β”‚
β”‚                             β”‚
β”‚  Commands:                  β”‚
β”‚    ReserveInventory         β”‚
β”‚    ReleaseInventory         β”‚
β”‚    ReplenishStock           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Time: 15-20 minutes

Phase 6: Bounded Context Mapping

Goal: Group aggregates into logical boundaries with their own Ubiquitous Language.

Instructions:

  1. Look at aggregates and ask: "Do they share the same language?"
  2. Example: Order in Sales means "a customer's purchase". Order in Warehouse means "a pick list". Different meanings = different contexts.
  3. Draw boundaries around aggregates that share language
  4. Name each boundary β€” this is your Bounded Context
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SALES CONTEXT                            β”‚
β”‚  Language: "Customer", "Order", "Cart", "Checkout"          β”‚
β”‚  Aggregates: Customer, Cart, Order                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   WAREHOUSE CONTEXT                         β”‚
β”‚  Language: "Pick List", "Shipment", "Inventory", "Bin"      β”‚
β”‚  Aggregates: Inventory, Shipment, PickList                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  PAYMENT CONTEXT                            β”‚
β”‚  Language: "Transaction", "Authorization", "Settlement"     β”‚
β”‚  Aggregates: Payment, Transaction, Refund                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Time: 15-20 minutes


🎯 Subdomain Types (ROI Focus)

Not all parts of your domain are equal. Prioritize investment based on business value.

TypeDescriptionStrategyTeam Allocation
Core DomainYour unique competitive advantage. Complex, high value. Differentiates you from competitors.Build in-house with top talent. Invest heavily in DDD.60-70% of best engineers
Supporting SubdomainNecessary but not differentiating. Medium complexity.Build or use open-source. Good quality, not perfect.20-30%
Generic SubdomainStandard problems with off-the-shelf solutions. Low complexity.Buy/SaaS. Don't build what you can buy.10%

Example: E-Commerce Platform

SubdomainTypeRationale
Product Recommendation EngineCoreProprietary ML algorithm drives conversion
Order ManagementCoreCustom workflows, complex business rules
Payment ProcessingGenericUse Stripe/PayPal β€” not our expertise
User AuthenticationGenericUse Auth0/Firebase Auth
Email NotificationsSupportingBuild thin wrapper around SendGrid
Inventory ManagementSupportingBuild, but keep simple

The Strategic Investment Rule

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Invest MOST in Core Domain                β”‚
β”‚  β”œβ”€β”€ Hire best domain experts              β”‚
β”‚  β”œβ”€β”€ Apply full DDD (Strategic + Tactical) β”‚
β”‚  β”œβ”€β”€ Continuous refinement                 β”‚
β”‚  └── Protect from generic solutions        β”‚
β”‚                                            β”‚
β”‚  Invest MODERATELY in Supporting           β”‚
β”‚  β”œβ”€β”€ Good enough quality                   β”‚
β”‚  β”œβ”€β”€ Standard patterns                     β”‚
β”‚  └── Open-source where possible            β”‚
β”‚                                            β”‚
β”‚  Invest LEAST in Generic                   β”‚
β”‚  β”œβ”€β”€ Buy/SaaS                              β”‚
β”‚  β”œβ”€β”€ Minimize custom code                  β”‚
β”‚  └── Focus integration, not implementation β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”— Context Mapping Patterns

Context Maps describe how Bounded Contexts interact. They're as important as the contexts themselves.

Relationship Types

Upstream (Power)          Downstream (Dependent)
    β”‚                            β”‚
    β”‚  ──── Published Language ─▢│
    β”‚  ──── Open Host Service ──▢│
    β”‚                            β”‚
    │◀──── Anti-Corruption Layer β”‚
    β”‚                            β”‚
    │◀──────── Conformist ──────│

Pattern Catalog

PatternDirectionWhen to UseRisk
PartnershipMutualTwo teams collaborate closely, shared goalsMedium β€” requires trust
Shared KernelMutualSmall shared model, high coordinationHigh β€” changes affect both
Customer/SupplierUpstream→DownstreamUpstream prioritizes downstream needsLow — clear contract
ConformistDownstream→UpstreamDownstream accepts upstream model as-isLow — but limits downstream
Anti-Corruption Layer (ACL)DownstreamDownstream translates upstream modelMedium β€” translation overhead
Open Host Service (OHS)UpstreamUpstream publishes well-defined APILow β€” standard integration
Published LanguageUpstreamUpstream defines shared data formatLow β€” with versioning
Separate WaysNoneContexts don't need to integrateNone β€” but missed opportunities
Big Ball of Mudβ€”Legacy system with no clear boundariesVery High β€” contain with ACL

Context Map Example: E-Commerce

graph LR
    subgraph Sales
        S[Sales Context]
    end
    subgraph Warehouse
        W[Warehouse Context]
    end
    subgraph Payment
        P[Payment Context]
    end
    subgraph CRM
        C[CRM Context]
    end

    S -->|Customer/Supplier| W
    S -->|Anti-Corruption Layer| P
    C -->|Open Host Service| S
    W -->|Conformist| P

Legend:

  • Sales β†’ Warehouse: Sales is customer, Warehouse is supplier. Warehouse team prioritizes Sales needs.
  • Sales β†’ Payment: Sales uses ACL to translate Payment's model (transactions, settlements) into Order language.
  • CRM β†’ Sales: CRM exposes OHS with published API. Sales consumes it.
  • Warehouse β†’ Payment: Warehouse conforms to Payment's model directly (simple enough).

🚫 Strategic Anti-Patterns

Anti-PatternSymptomFix
The Generic CoreBuilding auth, logging, or email in-houseBuy SaaS. Focus engineering on Core Domain only
Context LeakageUsing Order model from Sales in Warehouse directlyCreate translation layer (ACL) or separate model
Anemic Bounded ContextContext with no clear responsibility or languageRe-do Event Storming. Merge with adjacent context if too small
One Model to Rule Them AllTrying to unify all contexts into single modelAccept multiple models. Use Context Map to manage
Premature Boundaries20 microservices for a 3-person teamStart with monolith + modular boundaries. Extract later
Missing Ubiquitous LanguageDevelopers use different terms than businessCreate glossary. Code should use business terms

πŸ“‹ Event Storming Output Template

After the workshop, document findings:

# Event Storming: [Domain Name]

## Date: YYYY-MM-DD
## Participants: [Names and roles]

## Domain Events (Chronological)
1. UserRegistered
2. ProductAddedToCart
3. ...

## Aggregates Identified
| Aggregate | Events | Commands |
|-----------|--------|----------|
| Order | OrderPlaced, PaymentConfirmed, OrderShipped | PlaceOrder, ConfirmPayment, ShipOrder |
| Inventory | InventoryReserved, StockReplenished | ReserveInventory, ReplenishStock |

## Bounded Contexts
| Context | Aggregates | Language | Type |
|---------|-----------|----------|------|
| Sales | Customer, Cart, Order | Customer, Order, Checkout | Core |
| Warehouse | Inventory, Shipment, PickList | Pick List, Bin, Shipment | Supporting |
| Payment | Payment, Transaction, Refund | Transaction, Authorization | Generic |

## Context Map
```mermaid
graph LR
    Sales -->|Customer/Supplier| Warehouse
    Sales -->|ACL| Payment

Hotspots (Unresolved)

  • How does partial refund affect inventory?
  • Who owns the "customer" aggregate β€” Sales or CRM?

Next Steps

  • Validate Bounded Contexts with domain experts
  • Start tactical design for Core Domain (Sales)
  • Evaluate SaaS for Payment context

---

## πŸ”— Integration with Other Skills

| Skill | Integration Point |
|-------|-------------------|
| `c4-model` | Bounded Contexts β†’ C4 L1 System Context |
| `c4-level2-container` | Each Context β†’ independently deployable container |
| `ddd-tactical` | Aggregates β†’ Entities, Value Objects, Domain Services |
| `ddd-patterns` | Context boundaries β†’ ACL, OHS implementation |
| `business-product-leadership` | Core Domain β†’ JTBD (primary job) |
| `why-strategic-rationale` | Subdomain types β†’ Value Proposition Canvas |

---

## πŸ“š References

- [Domain-Driven Design](https://www.domainlanguage.com/ddd/) β€” Eric Evans
- [Implementing Domain-Driven Design](https://www.virginia.edu/) β€” Vaughn Vernon
- [Introducing Event Storming](https://www.eventstorming.com/) β€” Alberto Brandolini
- [Team Topologies](https://teamtopologies.com/) β€” Matthew Skelton, Manuel Pais
- [DDD Community](https://dddcommunity.org/)

Keep looking

Skills are one crate of 328,083. 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.