Map relationships between bounded contexts using DDD context mapping patterns. Typically follows event storming to define integration strategies between discovered contexts.
Maps relationships between bounded contexts using DDD patterns like Customer/Supplier or Shared Kernel. Use after event storming to define integration strategies between your discovered contexts.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install soft-skills@melodic-softwareMap relationships between bounded contexts using DDD context mapping patterns. Typically follows event storming to define integration strategies between discovered contexts.
[bounded-contexts-file]: Optional path to file containing bounded contexts (e.g., event storming output)
--mode: Analysis mode (default: guided)
full: Systematic analysis of all relationships (~10K tokens)quick: Identify obvious patterns only (~3K tokens)guided: Interactive, confirm each relationship (variable)--output: Output format (default: both)
cml: Context Mapper DSL file onlydiagram: Mermaid diagram onlyboth: Both CML and diagram--input-dir: Directory to search for event storming output (default: docs/event-storming/)
--dir: Output directory for context map (default: docs/architecture/)
Extract bounded contexts source, mode, and output format from arguments.
If no source provided:
docs/event-storming/docs/architecture/Default mode is guided. Default output is both.
Invoke the context-mapping skill to access:
Parse the input to extract bounded contexts:
For each bounded context, capture:
- Name
- Primary purpose/responsibility
- Core aggregates (if known)
- Domain events published (if known)
- Domain events consumed (if known)
- Team ownership (if known)
If input lacks detail, use Glob/Grep to discover additional context from:
Spawn the context-mapper agent for comprehensive analysis:
Analyze these bounded contexts and map all relationships:
[List of bounded contexts with details]
Requirements:
1. Identify all communication patterns between contexts
2. Determine upstream/downstream for each relationship
3. Select appropriate pattern (SK, C/S, ACL, OHS, PL, CF, P, SW)
4. Provide rationale for each pattern choice
5. Suggest team topology alignment
6. Generate CML output with detailed comments
The agent will:
Perform rapid analysis without spawning agent:
Work interactively through relationships:
For each pair of contexts that might relate:
After all relationships mapped, generate CML.
/* Context Map: [System/Domain Name]
* Generated: [ISO Date]
* Mode: [full|quick|guided]
* Source: [Input file or "Interactive"]
*/
ContextMap [SystemName]Map {
// Bounded Context Declarations
contains [Context1]
contains [Context2]
// ...
/* [Context1] ← [Context2]
* Pattern: Customer/Supplier
* Direction: Context2 supplies data to Context1
* Rationale: [Why this pattern fits]
*/
[Context1] [D,C]<-[U,S] [Context2]
// ... more relationships
}
graph LR
subgraph "Core Domain"
A[Context1]
end
subgraph "Supporting"
B[Context2]
C[Context3]
end
subgraph "Generic"
D[Context4]
end
B -->|"Supplier"| A
A <-->|"Partnership"| C
D -.->|"ACL"| A
## Context Map Summary
**System:** [Name]
**Date:** [ISO Date]
**Contexts Mapped:** N
**Relationships Defined:** M
### Pattern Distribution
| Pattern | Count | Contexts |
|---------|-------|----------|
| Customer/Supplier | X | A→B, C→D |
| Partnership | Y | E↔F |
| ACL | Z | G←External |
### Team Topology Suggestions
Based on the context map, consider:
- **Stream-aligned teams**: [Contexts with clear ownership]
- **Platform team candidates**: [Contexts serving multiple consumers]
- **Shared Kernel review**: [Contexts that might merge or split]
### Integration Priorities
1. [High-priority integration point]
2. [Medium-priority integration point]
3. [Low-priority integration point]
### Next Steps
- [ ] Review ACL boundaries for external integrations
- [ ] Create ADRs for pattern decisions
- [ ] Align team structure with topology suggestions
Save outputs based on format flag:
CML file:
docs/architecture/context-map.cmlMermaid diagram:
docs/architecture/context-map.mdSummary report:
Use --dir to specify a custom output directory.
After generating the context map:
## Suggested Next Steps
1. **Architecture Documentation**: Use `/ea-document component` to document each bounded context
2. **ADRs**: Use `/adr-create` to document pattern decisions
3. **Fitness Functions**: Use `/fitness-check` to create tests for module boundaries
4. **Team Alignment**: Review Team Topologies suggestions with stakeholders