Scaffold an aggregate root with entity, value objects, repository interface, domain events, and test stubs. Use when adding a new aggregate to an existing bound
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ddd-aggregate-48eb0062b9dc ,按照其中的说明把「ddd-aggregate」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Scaffold a complete aggregate root inside a bounded context.
Parse $ARGUMENTS as <context-name> <aggregate-name> (both kebab-case). The context must already exist under src/.
Validate: Confirm src/<context>/domain/ exists. If not, suggest running /ddd-context <context> first.
Pre-task hook: npx @claude-flow/cli@latest hooks pre-task --description "DDD aggregate: <aggregate-name> in <context>"
Create aggregate root entity:
src/<context>/domain/entities/<aggregate-name>.entity.tsequals() based on identityAggregateRoot interfaceCreate value objects:
src/<context>/domain/value-objects/<aggregate-name>-id.value-object.tsCreate repository interface:
src/<context>/domain/repositories/<aggregate-name>.repository.tsfindById, save, delete methodsCreate domain events:
src/<context>/domain/events/<aggregate-name>-created.event.tssrc/<context>/domain/events/<aggregate-name>-updated.event.tsCreate unit test stubs:
src/<context>/domain/entities/<aggregate-name>.entity.test.tsdescribe/it with should [behavior] when [condition] namesUpdate barrel exports: Add new files to the relevant index.ts barrel files.
Store in domain model graph:
mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store --parent "context:<context>" --child "aggregate:<aggregate-name>" --relation "contains"
mcp__plugin_ruflo-core_ruflo__memory_store --key "ddd-aggregate-<context>-<aggregate-name>" --value "AGGREGATE_SUMMARY" --namespace tasks
Post-task hook: npx @claude-flow/cli@latest hooks post-task --task-id "ddd-aggregate-<aggregate-name>" --success true --train-neural true