nw-ddd-strategic

Strategic DDD — bounded context discovery, context mapping patterns, subdomain classification, ubiquitous language, and organizational alignment

322 stars

Best use case

nw-ddd-strategic is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Strategic DDD — bounded context discovery, context mapping patterns, subdomain classification, ubiquitous language, and organizational alignment

Teams using nw-ddd-strategic should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nw-ddd-strategic/SKILL.md --create-dirs "https://raw.githubusercontent.com/nWave-ai/nWave/main/nWave/skills/nw-ddd-strategic/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nw-ddd-strategic/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nw-ddd-strategic Compares

Feature / Agentnw-ddd-strategicStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Strategic DDD — bounded context discovery, context mapping patterns, subdomain classification, ubiquitous language, and organizational alignment

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Strategic DDD

Domain discovery and boundary definition at the organizational level. Strategic DDD answers: "Where are the boundaries?" and "How do contexts relate?"

## Subdomain Classification

Subdomains exist in the problem space. Classify before modeling.

| Type | Competitive advantage | Build or buy | DDD investment | Staffing |
|------|----------------------|--------------|----------------|----------|
| Core | Yes, unique differentiator | Build in-house | Full strategic + tactical | Senior talent |
| Supporting | No, enables core | Build (simplified) or outsource | Pragmatic tactical | Mid-level |
| Generic | No, commodity | Buy/integrate (Stripe, Auth0) | Minimal/none | Junior/integration |

**Decision heuristic**: If two competitors solve this the same way, it's Generic. If your approach gives you an edge, it's Core. Everything else is Supporting.

## Bounded Context Discovery

A bounded context is a software boundary within which a model is consistent. Different from subdomains (problem-space). They should align but are independent concepts.

### Discovery Techniques

**Language divergence** (primary signal): When the same word means different things to different groups, you've found a boundary. "Account" in billing vs. "Account" in identity. "Product" in catalog vs. "Product" in inventory.

**Organizational structure**: Teams that communicate frequently often share a context. Teams with formal handoffs often have separate contexts. Conway's Law applies.

**Consistency requirements**: Where true invariants must be maintained transactionally defines aggregate boundaries, which cluster into contexts.

**EventStorming Big Picture**: Domain events placed on timeline. When events cluster into distinct swimlanes with different actors and vocabulary, those are context candidates.

**Domain Storytelling**: Actors perform activities on work objects. When actors, activities, or work objects change meaning, you've crossed a boundary.

### Boundary Validation Checklist

- [ ] Each context has its own ubiquitous language (no term means two things)
- [ ] One team owns one context (no shared ownership)
- [ ] Context is independently deployable (no mandatory co-deployment)
- [ ] Internal model changes don't ripple to other contexts
- [ ] Data that crosses boundaries is explicitly mapped (no implicit sharing)

### Common Mistakes

1. **Context = microservice**: A context may contain multiple services; a service may handle a subdomain within a larger context
2. **Too large**: Conflicting models coexist, vocabulary is ambiguous -- split
3. **Too small**: Excessive cross-context communication, simple operations need sagas -- merge
4. **Database-first**: Sharing a database between contexts couples their models implicitly

## Context Mapping Patterns

Nine patterns describing how bounded contexts relate. Draw the context map before writing code.

### Mutually Dependent

**Partnership**: Two contexts evolve together. Both teams coordinate releases. Use when: genuinely reciprocal dependency, tight collaboration feasible. Risk: high coordination cost.

**Shared Kernel**: Small shared model subset both contexts depend on. Must be small, explicitly versioned, jointly owned. Changes require agreement from both teams.

### Upstream/Downstream

**Customer-Supplier**: Upstream serves downstream's needs. Downstream negotiates what upstream provides. Structured relationship with explicit API contracts.

**Conformist**: Downstream adopts upstream's model as-is. No negotiation. Use when: integration simplicity outweighs design freedom, or upstream won't accommodate.

**Anti-Corruption Layer (ACL)**: Downstream creates a translation layer to isolate its model from upstream's. Essential for: legacy integration, poor upstream models, protecting domain purity.

**Open Host Service (OHS)**: Upstream provides a well-defined API for multiple downstream consumers. Standardized protocol (REST, gRPC, GraphQL).

**Published Language**: Shared schema or format for inter-context communication. Examples: iCalendar, vCard, JSON Schema, Protocol Buffers.

### Independent

**Separate Ways**: No integration. Contexts have no meaningful dependency. Duplication is acceptable when coupling cost exceeds duplication cost.

**Big Ball of Mud**: Recognition pattern only. Demarcate and quarantine legacy systems. Draw a boundary around them, communicate through ACL.

### Selection Heuristic

```
Do the teams need to coordinate releases?
  YES -> Do both depend on each other equally?
    YES -> Partnership (if feasible) or Shared Kernel (if small overlap)
    NO  -> Customer-Supplier (negotiate API)
  NO  -> Is upstream model acceptable?
    YES -> Conformist (adopt as-is)
    NO  -> Anti-Corruption Layer (translate)
  Independent? -> Separate Ways
  Legacy mess? -> Big Ball of Mud + ACL
```

## Ubiquitous Language

A rigorous vocabulary shared between developers and domain experts, scoped per bounded context.

### Rules

1. Domain terms in code: class names, method names, variable names reflect domain language
2. Same term, different context: "Order" in Sales vs. "Order" in Fulfillment are different concepts -- this is expected and healthy
3. When the model is hard to express in code, the language needs refinement
4. Resolve conflicts immediately: if developers and domain experts use different words for the same concept, pick one and enforce it

### Building the Language

- Maintain a glossary per bounded context (not per system)
- Review glossary during modeling sessions
- When new terms emerge, add them; when terms change, update code
- Code review should catch language violations ("this variable should be called X, not Y")

## Context Map Visualization

Use Mermaid flowchart for context maps:

```mermaid
flowchart LR
    subgraph Core
        OrderCtx[Order Context]
        CatalogCtx[Catalog Context]
    end
    subgraph Supporting
        NotifCtx[Notification Context]
    end
    subgraph Generic
        PaymentCtx[Payment Context]
        AuthCtx[Identity Context]
    end

    OrderCtx -->|Customer-Supplier| CatalogCtx
    OrderCtx -->|ACL| PaymentCtx
    OrderCtx -->|OHS| NotifCtx
    CatalogCtx -.->|Conformist| AuthCtx
```

Label every arrow with the context mapping pattern. Core contexts in the center.

Related Skills

nw-ux-web-patterns

322
from nWave-ai/nWave

Web UI design patterns for product owners. Load when designing web application interfaces, writing web-specific acceptance criteria, or evaluating responsive designs.

nw-ux-tui-patterns

322
from nWave-ai/nWave

Terminal UI and CLI design patterns for product owners. Load when designing command-line tools, interactive terminal applications, or writing CLI-specific acceptance criteria.

nw-ux-principles

322
from nWave-ai/nWave

Core UX principles for product owners. Load when evaluating interface designs, writing acceptance criteria with UX requirements, or reviewing wireframes and mockups.

nw-ux-emotional-design

322
from nWave-ai/nWave

Emotional design and delight patterns for product owners. Load when designing onboarding flows, empty states, first-run experiences, or evaluating the emotional quality of an interface.

nw-ux-desktop-patterns

322
from nWave-ai/nWave

Desktop application UI patterns for product owners. Load when designing native or cross-platform desktop applications, writing desktop-specific acceptance criteria, or evaluating panel layouts and keyboard workflows.

nw-user-story-mapping

322
from nWave-ai/nWave

User story mapping for backlog management and outcome-based prioritization. Load during Phase 2.5 (User Story Mapping) to produce story-map.md and prioritization.md.

nw-tr-review-criteria

322
from nWave-ai/nWave

Review dimensions and scoring for root cause analysis quality assessment

nw-tlaplus-verification

322
from nWave-ai/nWave

TLA+ formal verification for design correctness and PBT pipeline integration

nw-test-refactoring-catalog

322
from nWave-ai/nWave

Detailed refactoring mechanics with step-by-step procedures, and test code smell catalog with detection patterns and before/after examples

nw-test-organization-conventions

322
from nWave-ai/nWave

Test directory structure patterns by architecture style, language conventions, naming rules, and fixture placement. Decision tree for selecting test organization strategy.

nw-test-design-mandates

322
from nWave-ai/nWave

Four design mandates for acceptance tests - hexagonal boundary enforcement, business language abstraction, user journey completeness, walking skeleton strategy, and pure function extraction

nw-tdd-review-enforcement

322
from nWave-ai/nWave

Test design mandate enforcement, test budget validation, 5-phase TDD validation, and external validity checks for the software crafter reviewer