
Ddd Aggregate
- 659 installs
- 67k repo stars
- Updated August 4, 2026
- ruvnet/ruflo
ddd-aggregate is a Ruflo agent skill that scaffolds a domain-driven design aggregate root with entity, value objects, repository interface, domain events, and test stubs inside a named bounded context.
About
ddd-aggregate is a ruvnet/ruflo skill for developers adding a new aggregate to an existing bounded context without hand-writing boilerplate. Pass arguments as `<context-name> <aggregate-name>` to generate an aggregate root package with entity, value objects, repository interface, domain events, and test stubs aligned to DDD conventions. The skill integrates Claude-Flow MCP memory and hook tools—memory_store, memory_search, agentdb_hierarchical-store, hooks_pre-task, hooks_post-task—plus Bash, Read, Write, Edit, Grep, and Glob for repo-aware scaffolding. Use ddd-aggregate when modeling a business concept that owns invariants and needs the entity-repository-events triplet. Skip it for anemic CRUD endpoints or UI-only features without domain rules to enforce.
- ddd-aggregate
Ddd Aggregate by the numbers
- 659 all-time installs (skills.sh)
- +6 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #563 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ruvnet/ruflo --skill ddd-aggregateAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 659 |
|---|---|
| repo stars | ★ 67k |
| Last updated | August 4, 2026 |
| Repository | ruvnet/ruflo ↗ |
How do you scaffold a DDD aggregate root?
Use ddd-aggregate for development tasks
Who is it for?
Backend developers extending a DDD codebase who need consistent aggregate boilerplate with repository and domain event stubs.
Skip if: Developers building flat CRUD APIs, frontend-only features, or services without bounded contexts or aggregate invariants.
When should I use this skill?
The user adds a new aggregate to an existing bounded context or models a business concept that owns invariants requiring entity, repo, and events.
What you get
Aggregate root source files, value object types, repository interface, domain event stubs, and test skeletons in the bounded context.
- Aggregate root source files
- Repository interface
- Domain event and test stubs
Files
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/.
Steps
1. Validate: Confirm src/<context>/domain/ exists. If not, suggest running /ddd-context <context> first.
2. Pre-task hook: npx @claude-flow/cli@latest hooks pre-task --description "DDD aggregate: <aggregate-name> in <context>"
3. Create aggregate root entity:
- File:
src/<context>/domain/entities/<aggregate-name>.entity.ts - Include: unique ID field, constructor with invariant validation, domain methods that enforce business rules,
equals()based on identity - Export a TypeScript class extending or implementing a base
AggregateRootinterface
4. Create value objects:
- File:
src/<context>/domain/value-objects/<aggregate-name>-id.value-object.ts - Include: immutable ID value object with factory method and validation
- Add additional value objects as properties of the aggregate suggest them
5. Create repository interface:
- File:
src/<context>/domain/repositories/<aggregate-name>.repository.ts - Include:
findById,save,deletemethods - Use the aggregate root and its ID value object as types
- This is an interface only -- no implementation (infrastructure concern)
6. Create domain events:
- File:
src/<context>/domain/events/<aggregate-name>-created.event.ts - File:
src/<context>/domain/events/<aggregate-name>-updated.event.ts - Include: event name (past tense), timestamp, aggregate ID, payload
7. Create unit test stubs:
- File:
src/<context>/domain/entities/<aggregate-name>.entity.test.ts - Include: test cases for construction invariants, domain methods, equality
- Use
describe/itwithshould [behavior] when [condition]names
8. Update barrel exports: Add new files to the relevant index.ts barrel files.
9. Store in domain model graph:
mcp__claude-flow__agentdb_hierarchical-store --parent "context:<context>" --child "aggregate:<aggregate-name>" --relation "contains"
mcp__claude-flow__memory_store --key "ddd-aggregate-<context>-<aggregate-name>" --value "AGGREGATE_SUMMARY" --namespace tasks10. Post-task hook: npx @claude-flow/cli@latest hooks post-task --task-id "ddd-aggregate-<aggregate-name>" --success true --train-neural true
Related skills
How it compares
Pick ddd-aggregate for DDD aggregate boilerplate inside bounded contexts; use generic CRUD generators when domain events and invariants are not part of the model.
FAQ
What files does ddd-aggregate generate?
ddd-aggregate generates an aggregate root with entity, value objects, a repository interface, domain event stubs, and test stubs inside the specified bounded context. Arguments follow `<context-name> <aggregate-name>`.
When should developers use ddd-aggregate?
ddd-aggregate fits new business concepts that own invariants inside an existing bounded context. Use it when you need the entity, repository, and domain events triplet instead of hand-written boilerplate.
Which MCP tools accompany ddd-aggregate?
ddd-aggregate uses Claude-Flow MCP tools including memory_store, memory_search, agentdb_hierarchical-store, hooks_pre-task, and hooks_post-task alongside standard file and shell tools for context-aware scaffolding.