跳到主要内容
哒哒星球DADA PLANET

Skill · 已公开版本

ddd-context-mapping · DDD限界上下文映射与契约设计

指导梳理限界上下文之间的关系模式、契约归属与防腐层翻译规则,输出关系图、契约矩阵与耦合风险缓解计划。

先看看示例

作者提供的示例,实际效果取决于你的输入和使用工具。

输入

为电商系统定义Checkout与Billing、Inventory、Fraud上下文之间的集成模式与契约归属。

输出

预期交付:上下文关系映射图、契约归属矩阵、翻译与防腐层决策及耦合风险缓解计划。(编辑说明,非实际运行结果)

方法说明

---
name: ddd-context-mapping
description: "Map relationships between bounded contexts and define integration contracts using DDD context mapping patterns."
risk: safe
source: self
tags: "[ddd, context-map, anti-corruption-layer, integration]"
date_added: "2026-02-27"
---

# DDD Context Mapping

## Use this skill when

- Defining integration patterns between bounded contexts.
- Preventing domain leakage across service boundaries.
- Planning anti-corruption layers during migration.
- Clarifying upstream and downstream ownership for contracts.

## Do not use this skill when

- You have a single-context system with no integrations.
- You only need internal class design.
- You are selecting cloud infrastructure tooling.

## Instructions

1. List all context pairs and dependency direction.
2. Choose relationship patterns per pair.
3. Define translation rules and ownership boundaries.
4. Add failure modes, fallback behavior, and versioning policy.

If detailed mapping structures are needed, open `references/context-map-patterns.md`.

## Output requirements

- Relationship map for all context pairs
- Contract ownership matrix
- Translation and anti-corruption decisions
- Known coupling risks and mitigation plan

## Examples

```text
Use @ddd-context-mapping to define how Checkout integrates with Billing,
Inventory, and Fraud contexts, including ACL and contract ownership.
```

## Limitations

- This skill does not replace API-level schema design.
- It does not guarantee organizational alignment by itself.
- It should be revisited when team ownership changes.