ddd-tactical-patterns

Model DDD tactical patterns for aggregate design, value objects, repositories, and domain events.

Updated May 5, 2026
One-click install
npx skills add https://github.com/Movchanets/Microservices_Learning --skill ddd-tactical-patterns-movchanets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-tactical-patterns
Source: https://github.com/Movchanets/Microservices_Learning/tree/main/.agents/skills/ddd-tactical-patterns
Command: npx skills add https://github.com/Movchanets/Microservices_Learning --skill ddd-tactical-patterns-movchanets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you translate domain rules into code structures that preserve business invariants, reduce accidental complexity, and keep core logic independent from infrastructure concerns.

Core Features & Use Cases

  • Aggregate Design: Shape aggregate boundaries around invariants and transaction rules.
  • Value Objects: Model immutable, validated concepts with value-based equality.
  • Repository Boundaries: Keep persistence focused on aggregate roots and domain-friendly access patterns.
  • Domain Events: Emit stable, meaningful events for important state transitions.
  • Use Case: Apply it when refactoring an anemic service into rich domain behavior or when designing a new bounded context with explicit consistency rules.

Quick Start

Use the ddd-tactical-patterns skill to model the aggregate, value objects, repository contract, and domain events for the feature you are implementing.

Frequently Asked Questions about ddd-tactical-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design DDD aggregates that protect business invariants?

Design DDD aggregates by grouping entities and value objects around a single root that enforces transactional consistency. The aggregate root validates invariants, ensuring all state changes preserve business rules without leaking domain logic into infrastructure layers.

What is the role of value objects in domain-driven design?

Value objects in domain-driven design represent immutable, validated concepts identified by their attributes rather than identity. They ensure value-based equality and encapsulate validation rules, reducing accidental complexity when modeling domain concepts.

How do I define repository contracts for aggregate roots?

Define repository contracts for aggregate roots by specifying domain-friendly access patterns that focus persistence operations on the root entity. This keeps infrastructure concerns isolated and ensures data retrieval aligns with aggregate boundaries.

When do I need to emit domain events in a bounded context?

Emit domain events in a bounded context when important state transitions occur within an aggregate. Use meaningful, past-tense event names to communicate these changes, establishing stable boundaries for downstream integration and eventual consistency.

How do I refactor an anemic service into rich domain behavior?

Refactor an anemic service into rich domain behavior by extracting business logic into aggregates and value objects that enforce invariants. Move data manipulation out of services and encapsulate rules within the domain model itself.