ddd-aggregate
하는 일
이 스킬은 기존 모듈 안에 애그리거트(aggregate)의 시작 코드를 만듭니다. 애그리거트는 자체 규칙을 지키는 핵심 비즈니스 객체입니다. 도메인 주도 설계(DDD)를 쓰는 소프트웨어 팀을 위한 스킬입니다.
사용하는 경우
- ✓기존 모듈에 자체 규칙을 가진 새 비즈니스 개념을 추가할 때.
- ✓엔티티, 저장소, 이벤트 파일을 함께 만들어야 할 때.
- ✓새 애그리거트에 맞춰 테스트 스텁을 만들고 싶을 때.
스킬 링크
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ddd/skills/ddd-aggregate/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“영업 모듈 안에 ID, 저장소, 이벤트를 포함한 새 Order 애그리거트를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 모듈 폴더가 있는지 확인한 뒤, 규칙이 담긴 엔티티 파일, ID 값 객체, 저장소 인터페이스, 도메인 이벤트 파일, 테스트 스텁을 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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/.
Steps
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:
- 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
- File:
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
- File:
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)
- File:
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
- File:
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
- File:
Update barrel exports: Add new files to the relevant
index.tsbarrel files.Store in domain model graph:
mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store({ key: "domain/context-<context>/aggregate-<aggregate-name>", value: "Aggregate <aggregate-name> (parent: context-<context>)", tier: "semantic" }) mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge({ sourceId: "entity:context-<context>", targetId: "entity: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
자주 묻는 질문
사용하기 전에 무엇이 있어야 하나요?
소스 폴더 아래에 바운디드 컨텍스트 폴더가 이미 있어야 합니다. 없으면 스킬이 먼저 컨텍스트를 만들라고 제안합니다.
저장소 저장 코드도 작성하나요?
아닙니다. 저장소는 인터페이스일 뿐이며, 저장 코드는 인프라 계층에 맡겨집니다.
어떤 언어로 작성하나요?
TypeScript 파일을 작성하며, 바운디드 컨텍스트의 폴더와 이름 규칙을 따릅니다.
상세 정보
작성자의 원본 설명
Scaffold an aggregate root with entity, value objects, repository interface, domain events, and test stubs. Use when adding a new aggregate to an existing bounded context, modeling a new business concept that owns invariants, or generating the boilerplate for an entity + repo + events triplet.
repo: ruvnet/ruflo
인기도
- GitHub 스타
- 81k
- 순위
- #1614
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-adaptive-coordinator
81k작업량이 바뀔 때 에이전트 무리를 나누고 재배치해, 작업에 맞는 배치를 고르도록 에이전트를 돕습니다.
agent-agent
81k큰 목표를 순서가 있는 행동 계획으로 나누고, 조건이 바뀌면 다시 계획하도록 에이전트를 가르칩니다.
agent-agentic-payments
81kAI 쇼핑을 위한 지출 위임장을 관리합니다. 지출 상한, 시간 창, 판매자 규칙, 서명된 승인을 포함합니다.
agent-analyze-code-quality
81k에이전트가 파일을 바꾸지 않고, 코드 품질 문제와 코드 냄새, 기술 부채, 리팩터링 아이디어를 찾아 검토하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.