Ddd Openspec Bridge logo

Ddd Openspec Bridge

Organization
ForceInjection
ddd-openspec-bridge

将 DDD 战术建模工件映射为 OpenSpec 结构化规范,实现从领域建模到工程实现的平滑衔接。

Overview

PublisherForceInjection
Repositorydomain-driven-design-skills
Skill nameddd-openspec-bridge
Stars
99
Forks
16
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ForceInjection on GitHub. Read the source before you install it.

Installation

Install the Ddd Openspec Bridge AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ForceInjection/domain-driven-design-skills/tree/main/skills/ddd-openspec-bridge
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ForceInjection/domain-driven-design-skills.git /tmp/domain-driven-design-skills
mkdir -p .claude/skills
cp -r /tmp/domain-driven-design-skills/skills/ddd-openspec-bridge .claude/skills/ddd-openspec-bridge
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ddd Openspec Bridge in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ddd Openspec Bridge on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ddd Openspec Bridge is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DDD OpenSpec Bridge

🌐 English version: English

使用时机

  • 战术建模(Stage III)已完成,模型通过验证(Stage IV),准备进入开发阶段。
  • 需要将领域模型转换为可供 AI Agent 或开发者执行的结构化工程规范。
  • 需要建立业务模型与代码实现之间的"单一事实来源"(Source of Truth)。

输入要求

  • 必需:
    • 问题空间定义(来自 ddd-scope)
    • 子域分类与核心域声明(来自 ddd-subdomains)
    • 上下文目录与 ADR(来自 ddd-contexts)
    • 上下文映射与集成模式(来自 ddd-context-map)
    • 聚合目录与不变量(来自 ddd-aggregates)
    • 领域交互定义:领域事件、领域服务、仓储接口、工厂(来自 ddd-domain-interactions)
  • 可选:
    • 发现阶段事件流与边界线索(来自 ddd-discover)
    • 模型验证报告(来自 ddd-model-review)
  • 执行标准:映射逻辑必须遵循 ddd-openspec-mapping.md 中的标准定义。

流程

  1. 初始化 OpenSpec 变更集:在 openspec/changes/<change-id>/ 下创建目录,生成本次变更的 .openspec.yaml。注意:这与全局 openspec/config.yaml 不同——后者由 ddd-contexts 阶段一次性维护,用于声明领域-限界上下文映射与架构约束。
  2. 生成 Proposal(proposal.md):
    • 将 ddd-scope 的问题陈述映射至 Why。
    • 将本次变更涉及的 Capabilities 写入 What Changes;按 ddd-subdomains 的分类组织优先级:Core 子域须全量 Scenario 化,Generic 子域可引用已有规范或外部组件。
    • 在 Impact 中列出受影响的 Capabilities 与聚合变更清单;在 Goals 中定义成功标准(SLO / 验收指标)。
  3. 建立 Bounded-Context 目录:按 ddd-contexts 的上下文目录,在 specs/<bounded-context>/<capability>/spec.md 下建立每个能力的规范文件。禁止使用扁平的 specs/domain-model/ 目录——它会破坏限界上下文与领域目录的战略对齐。
  4. 编写 Requirement 与 Scenario(严格遵循 ddd-openspec-mapping.md §2.1 的映射方向):
    • Requirement ← ddd-domain-interactions 中的命令与领域服务;一个 Requirement 对应一条可独立验证的业务能力,Scenario 数 ≤ 5 且不跨聚合根。
    • Scenario ← ddd-aggregates 中的聚合行为与不变量,以 Given/When/Then 描述;P0 级不变量必须有对应 Scenario。
    • 领域事件作为副作用写在 Scenario 的 Then/And 子句(如 “And 发布 OrderPlaced 事件”)。
    • 业务规则优先:Scenario 只描述业务规则与不变量,不得渗入数据库、HTTP、ORM、缓存等技术细节。
  5. 通用语言校验:对照 ddd-contexts 的词汇表,确保 proposal.md 与所有 spec.md 中的术语均落在词汇表内;未收录术语必须先回写词汇表或改用同义词。
  6. 设计技术方案(design.md):整合 ddd-context-map 的集成模式与 ddd-domain-interactions 的协作机制;描述分层架构映射、跨上下文翻译(ACL)、事件发布/消费范式(Outbox 模式、幂等键、一次事务仅修改一个聚合——见 ddd-openspec-mapping.md 附录 A)。
  7. 拆解开发任务(tasks.md):按 Spec 依赖顺序(Domain Model → Repository → Application Service → API/集成)拆解任务,每个任务关联对应的 Requirement 或 Scenario 作为验收标准。

输出

工件结构要求
proposal.md包含 Why, What Changes, Impact(Capabilities / 聚合变更), Goals。
design.md包含架构设计、数据模型映射、核心数据流、接口协议定义。
specs/ 目录按能力组织的子文件夹,包含 spec.md(Requirement + Scenario 格式)。
tasks.md包含任务标题、任务描述、关联 Spec 路径、验收标准。

校验清单

  • OpenSpec 目录结构符合规范(config, specs, changes);specs/ 按限界上下文分目录,未出现扁平的 domain-model/。
  • Requirement 粒度达标:每个 Requirement 对应一条可独立验证的业务能力,Scenario 数 ≤ 5 且未跨聚合根。
  • Scenario 保持业务规则优先:未出现数据库、HTTP、ORM、缓存等技术细节;所有 ddd-aggregates 的 P0 不变量均已转化为 Scenario。
  • 术语一致性:proposal.md 与所有 spec.md 中的术语均可在 ddd-contexts 词汇表中查到;proposal.md 中的 Capabilities 与 ddd-contexts 保持一致。
  • 事件驱动范式落地:跨聚合场景在 design.md 中明确遵循 Outbox 模式、幂等键与“一次事务仅修改一个聚合”约束。
  • 迭代节奏可控(小步快跑):本次变更集规模可在单次 Apply 阶段内完成规范与代码合流,未滑向微型瀑布。
  • tasks.md 中的任务具备可执行性,且每个任务都有明确的 Requirement / Scenario 引用作为验收标准。
  • 中英文排版符合项目规范(中英文间加空格,专有名词加反引号)。

回溯触发

  • 编写 Scenario 时发现领域逻辑存在歧义或冲突 → 回溯至 ddd-aggregates 或 ddd-domain-interactions。
  • 无法在 OpenSpec 结构下清晰表达某种集成模式 → 回溯至 ddd-context-map。
  • Scenario 中无法移除技术细节(数据库 / HTTP / ORM 等)→ 违反业务规则优先原则;先在本 Skill 内重写,若语义仍无法纯化则回溯至 ddd-aggregates 重新界定聚合行为。
  • 单个 Requirement 挂载超过 5 个 Scenario 或跨多聚合根 → 违反粒度约定,回溯至 ddd-domain-interactions 拆分命令与领域服务。
  • 术语未收录在 ddd-contexts 词汇表 → 回溯至 ddd-contexts 补录或统一术语。

示例

text
@ddd-openspec-bridge
根据已完成的"会议室预订系统"建模产出,生成 OpenSpec 变更集规范:
- 聚合:Booking, RoomSchedule
- 关键流程:预订申请、冲突检测、签到、取消
- 上下文:Booking Context, Room Catalog Context
请输出 proposal.md, design.md 以及 specs/booking-context/booking/spec.md 的核心 Requirement 与 Scenario 片段。

完整的 Requirement / Scenario 写法示范见 ddd-openspec-mapping.md §5(以“用户注册”为例的端到端最小可行示例)。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ddd Openspec Bridge AI skill do?

将 DDD 战术建模工件映射为 OpenSpec 结构化规范,实现从领域建模到工程实现的平滑衔接。

Why use Ddd Openspec Bridge on TypingMind?

Because you install it once and use it with any model. Ddd Openspec Bridge is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ddd Openspec Bridge in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ForceInjection/domain-driven-design-skills/tree/main/skills/ddd-openspec-bridge. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ddd Openspec Bridge?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ddd Openspec Bridge?

As many as you like. As long as a model supports skills, you can use Ddd Openspec Bridge with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ddd Openspec Bridge AI skill free?

Yes. It is published on GitHub by ForceInjection under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇