ruvnet/ruflo/tree/main/plugins/ruflo-ddd
ruflo-ddd
Claude Code용 도메인 주도 설계 스캐폴딩 플러그인. 함수 훅 Guard로 DDD 메모리에 비밀을 쓰는 작업을 차단한다.
이 mod 소개
ruflo-ddd는 Claude Code 플러그인으로, 바운디드 컨텍스트, 애그리거트 루트, 값 객체, 도메인 이벤트, 리포지토리, 안티코럽션 레이어 같은 도메인 주도 설계 산출물을 스캐폴딩하고 AgentDB에서 탐색 가능한 그래프로 저장한다. domain-modeler 에이전트와 스킬(/ddd-context, /ddd-aggregate, /ddd-validate), 컨텍스트 관리·애그리거트/이벤트 스캐폴딩·검증·컨텍스트 매핑을 위한 6개의 CLI 하위 명령을 제공한다. 명시된 버전부터는 함수 훅 mod로도 동작한다(Claude Code 2.1.287+ 필요). 기본으로 켜진 Guard는 키, token 또는 비밀번호가 포함된 도메인 모델 메모리 쓰기를 거부하며, 비밀의 종류만 알리고 값은 절대 보여 주지 않는다. 로컬 /ddd-mod 명령은 모델 턴 없이 status/scan/contexts에 답하고, 상태 파일을 .claude-flow/ddd-mod/status.json에 기록한다. userConfig의 guard 옵션으로 강제 적용을 전환할 수 있다. 설치: claude --plugin-dir plugins/ruflo-ddd. bash plugins/ruflo-ddd/scripts/smoke.sh로 검증한다(예상 결과: 10 passed, 0 failed). 이 플러그인은 네트워크를 호출하거나 프로세스를 생성하지 않으며 도구 호출을 더 엄격하게만 할 수 있고 완화할 수는 없다. MIT 라이선스다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add ruvnet/ruflo claude plugin install ruflo-ddd
원문 / README
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.
Compatibility
- CLI: pinned to
@claude-flow/cliv3.6 major+minor. - Verification:
bash plugins/ruflo-ddd/scripts/smoke.shis the contract.
Namespace coordination
This plugin owns the ddd-patterns AgentDB namespace (kebab-case, follows the convention from ruflo-agentdb ADR-0001 §"Namespace convention"). Reserved namespaces (pattern, claude-memories, default) MUST NOT be shadowed.
ddd-patterns stores reusable bounded-context shapes, aggregate templates, and event vocabularies for cross-project reuse. Accessed via memory_* tools (namespace-routed).
Verification
bash plugins/ruflo-ddd/scripts/smoke.sh
# Expected: "10 passed, 0 failed"
Architecture Decisions
Related Plugins
ruflo-agentdb— namespace convention owner; backing store for the domain graphruflo-adr-- Document domain decisions as Architecture Decision Recordsruflo-sparc-- Architecture phase leverages DDD bounded context patternsruflo-migrations-- Align migration boundaries with aggregate roots
License
MIT
As a mod
Since this version the plugin is also a function-hook mod (ADR-445 pattern; needs Claude Code 2.1.287 or later). It never calls the network or spawns a process, and it only tightens: it can refuse a call, never allow one.
- Guard (default on): refuses domain-model memory writes (
ddd-*keys andcontext:/aggregate:hierarchy edges) that hold a key, token or password. The reason names the kind of secret, never the value. /ddd-mod: answered locally, no model turn:status,scan <text>(would the guard refuse this?), andcontexts(folders undersrc/,src/contexts,src/moduleswith adomain/layer).- Status file:
.claude-flow/ddd-mod/status.json({version, updatedMs, guard, blocked}), written at session start and when a call is blocked. - Option:
guard(on|off, defaulton) in the plugin'suserConfig.
Test it: claude plugin test plugins/ruflo-ddd and bash plugins/ruflo-ddd/scripts/smoke.sh.