agentleFS
ForceInjectionForceInjection/domain-driven-design-skills/skills/ddd-context-map/SKILL.md

ddd-context-map

Skill82 starsChanged 7 months agoApache-2.0View on GitHub

映射限界上下文间的关系与集成策略:模式选择、契约所有权、失败模式与版本策略。

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. NinjaSln-labs/agent-skills★ 143% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

Files
SKILL.md

DDD Context Map

🌐 English version: English

使用时机

  • 限界上下文已定义完毕,需要设计它们之间的协作与集成关系。
  • 需要明确"谁依赖谁、用什么模式集成、契约谁负责"。
  • ddd-model-review 报告"集成模式与映射不一致"时,作为回溯目标重新执行。

输入要求

  • 必需:上下文目录(来自 ddd-contexts)、事件流热点标注中的跨边界点(来自 ddd-discover)。
  • 可选:子域分类表(来自 ddd-subdomains,用于理解上下文的业务权重)、现有接口/消息/数据交换方式、团队协作模式。

流程

  1. 列举关系:列出所有上下文对(pair),标注依赖方向与数据/事件流向。
  2. 选择模式:为每对关系选择集成模式——ACL (Anti-Corruption Layer)、OHS (Open Host Service)、PL (Published Language)、Shared Kernel、Conformist、Customer-Supplier——并说明选择理由。
  3. 定义翻译:明确输入翻译、输出翻译、语义差异处理、字段映射规则。
  4. 契约所有权:明确每个契约的 Owner、消费者、变更流程、发布策略。
  5. 失败模式分析:针对每个集成点分析超时、降级、幂等、重试、补偿、数据延迟等失败模式。
  6. 版本策略:定义兼容窗口、弃用策略、契约测试要求、发布节奏。

输出

工件结构要求
上下文关系矩阵表格:上游、下游、模式、数据/事件、风险
契约所有权矩阵表格:契约、Owner、消费者、变更流程、发布策略
翻译与 ACL 决策表格:对象/事件、翻译规则、语义差异说明、实现位置
失败模式与缓解表格:失败模式、影响、检测方式、缓解措施、补偿策略
版本策略列表:版本命名规则、兼容窗口、弃用策略、契约测试要求

校验清单

  • 所有跨上下文交互都有显式的模式与所有权
  • 核心域的输入受 ACL 或等效翻译边界保护
  • 至少识别 5 个失败模式并给出可执行的缓解措施
  • 无循环依赖(若存在需标注为风险并给出解耦方案)
  • 版本策略覆盖向后兼容窗口与弃用流程

回溯触发

  • 检测到循环依赖,或单一上下文承担 > 3 个上游关系 → 回溯至 ddd-subdomains 或 ddd-contexts(可能存在"上帝上下文"或子域误分)。
  • 被 ddd-model-review 触发:战术层发现了新的集成需求,与当前映射不一致。

示例

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.