본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.1k · #13512

tactical-ddd

하는 일

이 스킬은 AI가 소프트웨어 모델에서 빠졌거나 흩어진 비즈니스 규칙을 찾고, 규칙이 객체 안에 들어가도록 리팩터링하게 합니다. 도메인 코드가 스스로 규칙을 지키기를 원하는 개발자를 위한 것입니다.

사용하는 경우

  • ✓도메인 모델의 약한 설계를 검토하거나 확인하라고 요청할 때.
  • ✓도메인 객체가 데이터만 담고 있고 규칙은 다른 서비스에 있을 때.
  • ✓코드를 엔티티, 값 객체, 집합체로 리팩터링하고 싶을 때.

스킬 링크

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/tactical-ddd/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/tactical-ddd/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“주문 클래스와 청구서 클래스를 확인해서, 단순한 데이터 덩어리인지 알려 주고 그렇다면 어떻게 해야 할지도 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 먼저 약한 모델을 찾아 점수를 매긴 뒤, 각 클래스에 맞는 설계 요소를 정하고, 요청하면 단계별로 리팩터링합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Tactical DDD — Rich Domain Modeling

Workflow

Determine the user's intent first:

Intent Phases to run
"validate / review / check / is this correct?" Phase 1 + 2 only → report findings, ask before refactoring
"fix / refactor / improve / clean up" Phase 1 + 2 + 3
"how should I design / model this?" Load reference.md directly

Phase 1 — Detect

Load detection.md and scan the target code for anemia signals. Produce a severity score and list of affected classes.

Phase 2 — Assess

For each affected class, determine the correct building block:

Has unique identity tracked over time? Has invariants tying multiple objects? → Building Block
Yes — Entity
No — Value Object
Yes (root) + children with shared invariants Yes Aggregate
Operation spans multiple Aggregates/doesn't belong to any — Domain Service

Prefer Value Objects over Entities. Prefer small Aggregates over large ones.

If intent was validate/review: stop here. Report findings using the output format below. Ask "Would you like me to apply these fixes?" before proceeding.

Phase 3 — Refactor

Load refactoring.md for step-by-step moves. Apply in this order:

  1. Replace setter chains with a single expressive method
  2. Move service logic into the Aggregate that owns it
  3. Add business guards at the top of each method
  4. Publish a Domain Event after each successful state change
  5. Replace primitive types with Value Objects

For deep pattern questions (boundary design, event modeling, service vs. entity decision), load reference.md.


Quick Anemia Signals (scan first)

public setX() / public setY()        → behaviour should be encapsulated
service.doX(entity, ...)              → logic likely belongs in entity
entity.setA(); entity.setB(); ...     → setter chain = missing intent method
no domain methods beyond getters      → pure data bag

Golden Rules

  1. Behaviour with data — Objects own both state and the operations that change it
  2. Ubiquitous Language — Method names come from the domain, not CRUD (commitTo, not setStatus)
  3. Small Aggregates — Root + Value Objects by default; add child Entities only for true invariants
  4. One transaction = one Aggregate — Cross-Aggregate rules use eventual consistency via Domain Events
  5. Reference by ID — Never hold object references to other Aggregates
  6. Value Objects first — Use Entities only when individual identity is essential
  7. Domain Services sparingly — Excessive services → anemic model
  8. Protect invariants — The Aggregate is the last line of defence; never trust the caller

Output Format

When reviewing code, report:

## Anemia Diagnosis: <ClassName>

Severity: [None | Mild | Moderate | Severe]

Issues:
- <description of problem>

Recommended refactoring:
- <specific move from refactoring.md>

When refactoring, show a before/after diff for each class touched.

자주 묻는 질문

사용자에게 묻지 않고 코드를 바꾸나요?

아니요. 검토를 요청하면 결과를 보고하고, 변경하기 전에 기다립니다.

빈약한 모델이란 무엇인가요?

데이터를 담고 있지만 모든 비즈니스 규칙은 다른 곳에 두는 클래스입니다.

값 객체는 무엇인가요?

금액이나 주소처럼 고유한 식별자가 없는 작은 객체입니다.

상세 정보

작성자의 원본 설명

Detects anemic domain models, validates and refactors them into rich domain models, and enforces tactical DDD patterns (Entities, Value Objects, Aggregates, Domain Services, Domain Events). Use when the user asks to validate, review, or check domain models or DDD code; detect anemia; refactor domain objects; improve encapsulation; or mentions terms like "anemic model", "rich domain", "aggregate", "value object", "domain event", "ubiquitous language", "is this good DDD", "does this follow DDD", or "check my domain". Do NOT use for module or service boundary design, architectural decomposition,

repo: tech-leads-club/agent-skills

인기도

GitHub 스타
7.1k
순위
#13512
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬