Files
ruflo/plugins/ruflo-ddd
Reuven 1e5a8ec897 perf(plugins): ADR-098 Part 2 (slice 2/4) — token diet for ruflo-ddd/domain-modeler
Moves DDD vocabulary, directory layout, and AgentDB graph-storage
catalogs out of the agent prompt into a sibling REFERENCE.md.

Before: 93 lines per spawn (~1115 tokens).
After:  46 lines per spawn (~550 tokens). Net savings ~565 tokens
        per domain-modeler spawn.

Reference content lives at plugins/ruflo-ddd/REFERENCE.md (76 lines):
  - 7-row DDD building blocks vocabulary table
  - 6-row bounded-context relationships table (added — wasn't in the
    original prompt; now first-class reference)
  - Per-context directory structure
  - AgentDB graph storage commands with 4 standard edge types
  - Naming conventions (added — wasn't in prompt)

The agent prompt keeps:
  - Responsibilities + 6-step scaffold workflow
  - Tools list (Read/Grep/Glob + memory store/search)
  - Cross-references to related plugins
  - Memory pre-search + Neural Learning tail (Part 4 invariant)

Net: prompt is now narrative + procedural; reference is tabular +
catalog. Each is read in different contexts, neither pays tokens for
the other.

ADR-098 acceptance progress:
  - device-coordinator: 30 ≤ 60 ✓
  - domain-modeler:     46 ≤ 60 ✓ (was 93)
  - Remaining: cost-analyst (105), adr-architect (96)

Plugin version: 0.1.0 → 0.1.1 (patch — token diet only).
2026-05-03 22:24:16 -04:00
..

ruflo-ddd

Domain-Driven Design scaffolding -- bounded contexts, aggregate roots, domain events, and anti-corruption layers.

Overview

Transforms business domains into well-structured bounded contexts with aggregate roots, value objects, domain events, repositories, and anti-corruption layers. Stores the domain model as a navigable graph in AgentDB with hierarchical nodes and causal edges for context dependencies.

Installation

claude --plugin-dir plugins/ruflo-ddd

Agents

Agent Model Role
domain-modeler sonnet Map domains to bounded contexts, design aggregates with invariants, define domain events, generate ACL interfaces

Skills

Skill Usage Description
ddd-context /ddd-context <context-name> Create a bounded context with standard directory structure
ddd-aggregate /ddd-aggregate <context> <aggregate-name> Scaffold an aggregate root with entity, value objects, repository, events, and test stubs
ddd-validate /ddd-validate Detect cross-context import violations and aggregate invariant issues

Commands (6 subcommands)

# Context management
ddd context create <name>
ddd context list

# Aggregate scaffolding
ddd aggregate <context> <name>
ddd event <context> <name>

# Validation & visualization
ddd validate                 # Check domain boundary violations
ddd map                      # Visualize context map with relationships

Directory Structure per Context

src/<context-name>/
  domain/
    entities/           # Entities and aggregate root
    value-objects/       # Immutable value objects
    events/             # Domain events
    services/           # Domain services
    repositories/       # Repository interfaces
  application/          # Use cases / application services
  infrastructure/       # Repository implementations, ACL adapters
  index.ts              # Public API of the context

Context Relationships

Detected via import analysis: upstream/downstream, ACL, shared kernel, published language. Boundary violations (direct cross-context imports) are flagged by ddd validate.

  • ruflo-adr -- Document domain decisions as Architecture Decision Records
  • ruflo-sparc -- Architecture phase leverages DDD bounded context patterns
  • ruflo-migrations -- Align migration boundaries with aggregate roots

License

MIT