Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.
Add this skill
npx mdskills install sickn33/ddd-tactical-patternsClear DDD tactical guidance with actionable steps but lacks detail depth and has over-scoped permissions
1---2name: ddd-tactical-patterns3description: Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.4risk: safe5source: self6tags: [ddd, tactical, aggregates, value-objects, domain-events]7---89# DDD Tactical Patterns1011## Use this skill when1213- Translating domain rules into code structures.14- Designing aggregate boundaries and invariants.15- Refactoring an anemic model into behavior-rich domain objects.16- Defining repository contracts and domain event boundaries.1718## Do not use this skill when1920- You are still defining strategic boundaries.21- The task is only API documentation or UI layout.22- Full DDD complexity is not justified.2324## Instructions25261. Identify invariants first and design aggregates around them.272. Model immutable value objects for validated concepts.283. Keep domain behavior in domain objects, not controllers.294. Emit domain events for meaningful state transitions.305. Keep repositories at aggregate root boundaries.3132If detailed checklists are needed, open `references/tactical-checklist.md`.3334## Example3536```typescript37class Order {38 private status: "draft" | "submitted" = "draft";3940 submit(itemsCount: number): void {41 if (itemsCount === 0) throw new Error("Order cannot be submitted empty");42 if (this.status !== "draft") throw new Error("Order already submitted");43 this.status = "submitted";44 }45}46```4748## Limitations4950- This skill does not define deployment architecture.51- It does not choose databases or transport protocols.52- It should be paired with testing patterns for invariant coverage.53
Full transparency — inspect the skill content before installing.