ddd-tactical-patterns

Apply DDD tactical patterns to structure domain code around aggregates and invariants.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/caobingsheng/skills --skill ddd-tactical-patterns-caobingsheng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-tactical-patterns
Source: https://github.com/caobingsheng/skills/tree/main/ddd/ddd-tactical-patterns
Command: npx skills add https://github.com/caobingsheng/skills --skill ddd-tactical-patterns-caobingsheng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Domain-driven design helps manage complex business logic by structuring code into clear aggregates, invariants, and domain events, reducing coupling and increasing maintainability.

Core Features & Use Cases

  • Tactical pattern guidance for modeling entities, aggregates, value objects, repositories, and domain events.
  • Invariants-driven design to enforce business rules within aggregate boundaries.
  • Guided refactoring for turning anemic models into behavior-rich domain objects, with actionable examples and checks.

Quick Start

Use this skill to start modeling a domain with a primary aggregate, accompanying value objects, and domain events to enforce invariants.

Frequently Asked Questions about ddd-tactical-patterns

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

FAQPage Schema
How do I use domain-driven design tactical patterns to structure aggregates and enforce invariants?

Domain-driven design tactical patterns structure domain code around aggregates, entities, and value objects to enforce business rules within strict boundaries. This skill defines guidelines for modeling these components to reduce coupling and increase maintainability.

What is the best way to refactor an anemic domain model into behavior-rich objects?

Refactoring an anemic domain model involves applying tactical patterns to turn passive data structures into behavior-rich domain objects. This skill provides actionable examples and checks to guide the transition toward aggregates and domain events.

How do I enforce business invariants within aggregate boundaries in DDD?

Enforcing business invariants requires defining clear aggregate boundaries that encapsulate related entities and value objects. This skill specifies invariants-driven design requirements to ensure business rules are consistently protected within these boundaries.

When do I need domain events and value objects during new domain modeling?

You need domain events and value objects when modeling a domain requires tracking state changes and encapsulating descriptive attributes without identity. This skill targets new development scenarios by guiding the creation of primary aggregates and accompanying components.

Can I use DDD tactical patterns to establish repository contracts during refactoring?

Yes, DDD tactical patterns establish repository contracts to manage aggregate persistence without leaking infrastructure concerns. This skill targets refactoring scenarios by defining requirements and guidelines for structuring these contracts effectively.