SuperAPI AI Directory

ddd-context-map

General & other

View repository

Updated 10-16 01:39

About this skill

DDD Context Map

English version: English

When to Use

  • Bounded contexts have been fully defined, and their collaboration and integration relationships need to be designed.
  • It is necessary to clarify "who depends on whom, what pattern is used for integration, and who owns the contract".
  • ddd-model-review When "integration patterns and mappings are inconsistent" is reported, re-execute as a backtracking target.

Input Requirements

  • Required: Context catalog (from ddd-contexts), cross-boundary points in the event flow hotspot annotations (from ddd-discover)。
  • Optional: Subdomain classification table (from ddd-subdomains, used to understand the business weight of contexts), existing interfaces/messages/data exchange methods, team collaboration patterns.

Process

  1. Enumerate Relationships: List all context pairs, annotating dependency direction and data/event flow direction.
  2. Select Patterns: For each pair of relationships, select an integration pattern—ACL (Anti-Corruption Layer), OHS (Open Host Service), PL (Published Language), Shared Kernel, Conformist, Customer-Supplier—and explain the rationale for the choice.
  3. Define Translation: Clarify input translation, output translation, semantic difference handling, and field mapping rules.
  4. Contract Ownership: Clarify the Owner, consumers, change process, and release strategy for each contract.
  5. Failure Mode Analysis: For each integration point, analyze failure modes such as timeout, degradation, idempotency, retry, compensation, and data latency.
  6. Versioning Strategy: Define compatibility windows, deprecation strategy, contract testing requirements, and release cadence.

Output

Artifact Structural Requirements
Context Relationship Matrix Table: upstream, downstream, pattern, data/event, risk
Contract Ownership Matrix Table: contract, Owner, consumers, change process, release strategy
Translation and ACL Decisions Table: object/event, translation rules, semantic difference description, implementation location
Failure Modes and Mitigation Table: failure mode, impact, detection method, mitigation measures, compensation strategy
Versioning Strategy List: version naming rules, compatibility window, deprecation strategy, contract testing requirements

Validation Checklist

  • All cross-context interactions have explicit patterns and ownership
  • Inputs to the core domain are protected by an ACL or an equivalent translation boundary
  • At least 5 failure modes are identified with actionable mitigation measures
  • No circular dependencies (if any exist, they must be flagged as risks with decoupling solutions provided)
  • The versioning strategy covers backward compatibility windows and the deprecation process

Backtracking Triggers

  • A circular dependency is detected, or a single context bears > 3 upstream relationships → backtrack to ddd-subdomains or ddd-contexts(there may be a "god context" or subdomain misclassification).
  • Triggered by ddd-model-review : the tactical layer discovered new integration requirements that are inconsistent with the current mapping.

Example

@ddd-context-map
基于以下上下文目录,帮我设计上下文间的集成关系:
- Booking(预订全生命周期)
- Room Catalog(会议室资源管理)
- Identity(用户认证与授权)
请输出关系矩阵、集成模式选择、契约所有权与失败模式分析。