ddd-tactical-patterns
코드에 DDD 전술 패턴 적용하기
도메인 규칙을 깔끔한 코드 구조로 변환하는 데 어려움을 겪고 계신가요? 이 스킬은 엔티티, 값 객체,Aggregate, 리포지토리, 도메인 이벤트를 포함한 DDD 전술 패턴을 안내해 드립니다.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "ddd-tactical-patterns". submit 및 cancel 작업이 있는 Order Aggregate 모델링
Résultat attendu:
비공개 status 필드, 항목 수를 검증하고 단일 전환 불변식을 적용하는 submit() 메서드, 적절한 가드 조건이 있는 cancel() 메서드를 가진 Order 클래스. OrderSubmitted 및 OrderCancelled 도메인 이벤트 발송을 포함합니다.
Utilisation de "ddd-tactical-patterns". 이메일 주소용 값 객체 생성
Résultat attendu:
생성자에 regex 유효성 검사가 있고, 값 비교에 의한 동등성, toString() 메서드를 가진 불변 Email 클래스. 생성 시 잘못된 형식을 거부합니다.
Audit de sécurité
SûrAll static analysis findings are false positives. The 'external_commands' detections were Markdown backticks around code examples (e.g., `OrderSubmitted`), not actual shell execution. The 'blocker' findings for weak cryptography and system reconnaissance were triggered by documentation text, not executable code. This is a safe educational skill containing only DDD pattern guidance and TypeScript examples.
Score de qualité
Ce que vous pouvez construire
빈약한 도메인 모델 리팩터링
데이터만 있는 클래스를 비즈니스 규칙을 적용하는 동작이 풍부한 도메인 객체로 변환합니다.
새 Aggregate 설계
적절한 Aggregate 경계와 불변식 적용으로 새 도메인 코드를 구조화합니다.
도메인 이벤트 구현
과거 시제 도메인 이벤트를 사용하여 Aggregate 간의 이벤트驱动 통신을 추가합니다.
Essayez ces prompts
Order Aggregate를 모델링해야 합니다. 불변식을 식별하고, 동작 메서드가 있는 엔티티를 설계하며, 이 도메인에 적합한 값 객체를 정의하는 것을 도와주세요.
통화와 금액을 포함하는 Money의 불변 값 객체를 생성하세요. 생성 시 유효성 검사와 값에 의한 동등성을 포함해야 합니다.
ORM 구현 세부 정보를 노출하지 않고 도메인 친화적인 쿼리 메서드를 노출하는 Order Aggregate용 리포지토리 인터페이스를 설계하세요.
Order 상태 전환을 위한 도메인 이벤트를 정의하는 것을 도와주세요. 과거 시제命名, 최소 페이로드, 스키마 버전 관리 전략을 포함해야 합니다.
Bonnes pratiques
- 먼저 불변식을 식별한 다음 이를 중심으로 Aggregate 경계를 설계
- 값 객체는 생성 시 유효성 검사와 함께 불변으로 유지
- 도메인 이벤트는 과거 시제로 최소하고 안정적인 페이로드로命名
Éviter
- 트랜잭션 경계를 위반하는跨Aggregate 동기 일관성 규칙
- ORM 엔티티를 도메인 层으로 노출
- 도메인 비즈니스 로직을 도메인 객체가 아닌 컨트롤러에 포함