ddd-patterns

Apply DDD patterns to model aggregates, value objects, and domain events in .NET projects.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill ddd-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-patterns
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/architecture/ddd-patterns
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill ddd-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Model domain complexity with aggregates, value objects, domain events, and bounded contexts to ensure consistent business rules.

Core Features & Use Cases

  • Strongly-typed IDs and aggregates as consistency boundaries
  • Value objects and domain events to express behavior
  • Bounded contexts to isolate models and anti-corruption layers

Quick Start

Install the DDD patterns guide and begin refactoring your domain models to encapsulate invariants within aggregates.

Frequently Asked Questions about ddd-patterns

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

FAQPage Schema
How do I model aggregates and enforce invariants in a .NET domain model?

Model aggregates in .NET by defining aggregate roots as consistency boundaries that encapsulate invariants. This DDD pattern ensures business rules remain valid by routing all state changes through the aggregate root.

What are bounded contexts and how do they isolate domain models?

Bounded contexts isolate domain models by creating strict boundaries around specific business capabilities. This DDD pattern prevents conceptual overlap and uses anti-corruption layers to maintain model integrity across different contexts.

When do I need value objects and domain events in domain-driven design?

Value objects and domain events are needed in domain-driven design to express behavior without identity. Value objects encapsulate descriptive attributes, while domain events broadcast state changes to decouple aggregates.

Can I use strongly-typed IDs with domain-driven design patterns in .NET?

Strongly-typed IDs are fully supported in .NET domain-driven design patterns. They encapsulate identity within aggregates, preventing primitive obsession and ensuring type safety across bounded contexts.

What is the best way to refactor an anemic domain model to encapsulate invariants?

Refactor an anemic domain model by moving logic into aggregate roots and value objects to encapsulate invariants. Applying DDD patterns ensures rich behavior and consistent business rules within bounded contexts.

Why does splitting bounded contexts require anti-corruption layers?

Splitting bounded contexts requires anti-corruption layers to translate domain models between contexts. This DDD pattern prevents external models from corrupting your domain invariants when integrating across boundaries.