Analyzes bounded contexts and maps relationships using DDD context mapping patterns. PROACTIVELY use after event storming when bounded contexts are identified and integration strategies need to be defined. Produces Context Mapper DSL (CML) output with upstream/downstream relationships, integration patterns (ACL, OHS, SK), and team topology suggestions.
Analyzes bounded contexts from event storming and maps relationships using DDD patterns. Produces Context Mapper DSL (CML) output with upstream/downstream relationships, integration patterns (ACL, OHS, SK), and team topology suggestions.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install soft-skills@melodic-softwareopusAnalyze bounded contexts discovered during event storming and map their relationships using DDD context mapping patterns. Produces Context Mapper DSL (CML) output for documentation and tooling.
Bounded contexts to analyze. Can be provided as:
Optional parameters:
full (systematic), quick (obvious patterns), guided (interactive)cml (Context Mapper DSL), diagram (Mermaid), bothFirst, inventory all bounded contexts:
For each context, identify:
- Name and primary purpose
- Core aggregates/entities
- Domain events published
- Domain events consumed
- External dependencies
- Team ownership (if known)
Discovery sources:
Map dependencies between contexts:
Data Flow Analysis:
Event Flow Analysis:
Synchronous Dependencies:
For each relationship, determine the appropriate pattern:
Do contexts share code/libraries?
├── Yes → Consider Shared Kernel
│ └── Is coordination manageable? → SK or split
└── No → Continue
Is there clear upstream/downstream?
├── No (bidirectional) → Partnership
└── Yes → Continue to influence assessment
Can downstream influence upstream?
├── No (external, legacy, no leverage)
│ └── Does upstream model fit downstream?
│ ├── Yes → Conformist
│ └── No → Anti-Corruption Layer
└── Yes → Customer/Supplier
Does upstream serve multiple consumers?
├── Yes → Open Host Service
│ └── Need formal contract? → Add Published Language
└── No → Basic Customer/Supplier
Generate Context Mapper DSL output:
/* Context Map: [System Name]
* Generated from context mapping analysis
* Date: [ISO date]
*/
ContextMap [MapName] {
// Context declarations
contains [Context1]
contains [Context2]
// ...
/* Relationship: [Context1] → [Context2]
* Pattern: [Pattern Name]
* Rationale: [Why this pattern was chosen]
*/
[Downstream] [D,patterns]<-[U,patterns] [Upstream]
// ... more relationships
}
CML Syntax Reference:
| Pattern | Downstream | Upstream | Example |
|---|---|---|---|
| Customer/Supplier | [D,C] | [U,S] | Order [D,C]<-[U,S] Inventory |
| Conformist | [D,CF] | [U] | Report [D,CF]<-[U] Warehouse |
| ACL | [D,ACL] | [U] | Payment [D,ACL]<-[U] Gateway |
| OHS | [D] | [U,OHS] | Client [D]<-[U,OHS] Catalog |
| OHS + PL | [D] | [U,OHS,PL] | Client [D]<-[U,OHS,PL] API |
| Shared Kernel | [SK] | [SK] | Order [SK]<->[SK] Customer |
| Partnership | [P] | [P] | Order [P]<->[P] Shipping |
Suggest team structures based on patterns:
| Pattern | Team Structure | Interaction Mode |
|---|---|---|
| Shared Kernel | Same team or tight partnership | Collaboration |
| Partnership | Two stream-aligned teams | Collaboration |
| Customer/Supplier | Provider + Consumer teams | X-as-a-Service |
| Conformist | Consumer accepts external | X-as-a-Service |
| ACL | Consumer with translation layer | X-as-a-Service |
| OHS | Platform team serving others | X-as-a-Service |
CML File:
Save to docs/architecture/context-map.cml or user-specified location.
Mermaid Diagram:
graph LR
subgraph "Core Domain"
A[ContextA]
end
subgraph "Supporting"
B[ContextB]
C[ContextC]
end
B -->|"U:Supplier"| A
A -->|"D:Customer"| B
A <-->|"Partnership"| C
Summary Report:
## Context Map Summary
**Contexts Analyzed:** N
**Relationships Mapped:** M
### Pattern Distribution
- Customer/Supplier: X
- Partnership: Y
- ACL: Z
- ...
### Team Topology Suggestions
- [Team recommendations]
### Integration Points Identified
- [Key integration points requiring attention]
### Recommendations
- [Pattern-specific recommendations]
Always include:
## Analysis Scope Report
**Contexts Analyzed:**
- [List of contexts with sources]
**Relationships Mapped:**
- [Count by pattern type]
**Confidence Levels:**
- High: [relationships with clear evidence]
- Medium: [relationships requiring verification]
- Low: [relationships based on inference]
**Not Analyzed:**
- [Contexts/relationships skipped and why]
- [Information requiring human input]
**Limitations:**
- [What couldn't be determined]
- [Areas needing domain expert review]
Input from Event Storming:
Event Storming Output → Bounded Contexts → Context Mapping
Output to Other Skills:
modular-architecture skill for module boundariesadr-management for architecture decisionsDesigns feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences