ddd

Enforce aggregate boundaries and domain rules in .NET C# domain models.

640|145|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill ddd-codewithmukesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd
Source: https://github.com/codewithmukesh/dotnet-claude-kit/tree/main/skills/ddd
Command: npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill ddd-codewithmukesh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps .NET teams implement tactical Domain-Driven Design patterns to enforce aggregate boundaries, replace primitive obsession with value objects, and reliably dispatch domain events so business invariants remain consistent and side effects are decoupled.

Core Features & Use Cases

  • Aggregate root patterns: structure aggregates as consistency boundaries, enforce invariants through dedicated methods, and load/save aggregates as a unit.
  • Value objects & strongly-typed IDs: use immutable records and readonly structs to encapsulate validation, equality, and EF Core conversions to prevent type confusion.
  • Domain event dispatching: raise events inside aggregates and publish them after SaveChangesAsync to decouple side effects from domain rules.
  • EF Core mapping guidance: patterns for converting value objects and IDs, complex property mapping, and navigation auto-inclusion.
  • Anti-patterns & decision guide: when to avoid DDD, how to size aggregates, and recommended repository vs DbContext approaches.

Quick Start

Use the ddd skill to design an Order aggregate with strongly-typed IDs, Money value objects, and domain events dispatched on save.

Frequently Asked Questions about ddd

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

FAQPage Schema
How do I dispatch domain events after SaveChangesAsync in EF Core?

Dispatch domain events after SaveChangesAsync by raising them inside aggregates and publishing them post-save, which decouples side effects from domain rules and maintains business invariant consistency.

What is the best way to enforce aggregate boundaries and invariants in a .NET domain model?

Enforce aggregate boundaries in .NET by structuring aggregates as consistency boundaries, enforcing invariants through dedicated methods, and loading or saving aggregates as a single unit.

How do I map value objects and strongly-typed IDs using EF Core?

Map value objects and strongly-typed IDs in EF Core by using immutable records and readonly structs, configuring EF Core conversions, and applying complex property mapping to prevent type confusion.

When should I avoid using Domain-Driven Design in my .NET project?

Avoid Domain-Driven Design when your domain logic is simple or lacks complex business invariants, as the overhead of aggregates, value objects, and domain events outweighs the structural benefits.

Do I need a separate repository pattern or can I use DbContext directly with DDD aggregates?

Choose between a separate repository pattern and using DbContext directly with DDD aggregates based on your abstraction needs, balancing persistence coupling against repository-level testing and persistence patterns.