ddd-aggregate

Installation
SKILL.md

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 AggregateRoot interface
  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
Installs
386
Repository
ruvnet/ruflo
GitHub Stars
58.6K
First Seen
Apr 30, 2026
ddd-aggregate — ruvnet/ruflo