ddd-context
它能做什么
这项技能为限界上下文(即代码库中一个独立的业务领域)创建标准的文件夹结构。适合把大型应用拆分成清晰模块的开发者。
适用场景
- ✓当你在代码库中开始一个新的业务领域时。
- ✓当你把大型应用拆分为边界清晰的独立部分时。
- ✓当你希望新模块使用相同的领域、应用和基础设施结构时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ddd/skills/ddd-context/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我的代码库中用标准文件夹结构设置一个新的账单领域。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能检查名称是否为 kebab-case 格式且尚未被使用,然后为领域、应用和基础设施各层创建文件夹和索引文件。它还会把新领域记录到领域模型存储中。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Create a bounded context directory structure for the given context name.
Parse $ARGUMENTS as the context name (kebab-case). If empty, list existing contexts.
Steps
Validate name: Ensure the context name is kebab-case and does not already exist under
src/.Create directory structure:
src/<context-name>/ domain/ entities/ value-objects/ events/ services/ repositories/ application/ infrastructure/Generate index files:
src/<context-name>/domain/entities/index.ts-- barrel export for entitiessrc/<context-name>/domain/value-objects/index.ts-- barrel export for value objectssrc/<context-name>/domain/events/index.ts-- barrel export for domain eventssrc/<context-name>/domain/services/index.ts-- barrel export for domain servicessrc/<context-name>/domain/repositories/index.ts-- barrel export for repository interfacessrc/<context-name>/domain/index.ts-- re-export all domain submodulessrc/<context-name>/application/index.ts-- barrel export for application servicessrc/<context-name>/infrastructure/index.ts-- barrel export for infrastructure implementationssrc/<context-name>/index.ts-- public API of the bounded context (re-exports domain and application only, NOT infrastructure)
Store in domain model graph:
mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store({ key: "domain/context-<context-name>", value: "Bounded context <context-name> (parent: domain)", tier: "semantic" }) mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge({ sourceId: "entity:domain", targetId: "entity:context-<context-name>", relation: "contains" }) mcp__plugin_ruflo-core_ruflo__memory_store({ key: "ddd-context-<context-name>", value: "Created bounded context", namespace: "tasks" })Report: Confirm the context was created and list the generated files.
常见问题
应使用哪种名称格式?
使用 kebab-case,例如 billing-invoices,并确保不存在同名的文件夹。
公共索引公开什么?
它只重新导出领域层和应用层,不包括基础设施层。
如果不提供名称运行会怎样?
它会列出现有的上下文,而不是创建新的上下文。
详情
作者的原始描述
Create and manage a DDD bounded context with standard directory structure. Use when starting a new subdomain, splitting a monolith into bounded contexts, or scaffolding the domain/application/infrastructure layout for a fresh module.
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1615
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。