ddd

Implement Domain-Driven Design tactical patterns for .NET applications.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/Maj3D10/Training-Platform --skill ddd-maj3d10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd
Source: https://github.com/Maj3D10/Training-Platform/tree/main/.agent/skills/ddd
Command: npx skills add https://github.com/Maj3D10/Training-Platform --skill ddd-maj3d10

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you structure complex business logic in .NET so your model stays consistent, expressive, and maintainable as the system grows.

Core Features & Use Cases

  • Aggregate boundaries & invariants: Model consistency by grouping entities and value objects into aggregates that enforce rules transactionally.
  • Value objects and strongly-typed IDs: Replace primitive obsession with immutable value objects and prevent ID mix-ups with strongly-typed identifiers.
  • Domain events and aggregate-focused repositories: Decouple side effects using domain events and persist aggregates via one repository per aggregate root.

Quick Start

Load the ddd skill when implementing or refactoring a .NET domain to use aggregates, value objects, domain events, strongly-typed IDs, and a repository-per-aggregate-root approach.

Frequently Asked Questions about ddd

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

FAQPage Schema
How do I implement aggregate boundaries and enforce invariants in a .NET domain?

You can implement aggregate boundaries by grouping entities and value objects into aggregates that enforce rules transactionally. This structure maintains consistency by ensuring all changes within an aggregate boundary pass through the aggregate root.

What is the best way to handle strongly-typed IDs with EF Core in domain-driven design?

The best way to handle strongly-typed IDs with EF Core is to configure value conversions that map custom identifier types to database columns. This prevents ID mix-ups across aggregate roots while maintaining primitive obsession-free domain models.

How do I dispatch domain events via SaveChangesAsync in EF Core?

To dispatch domain events via SaveChangesAsync, you intercept the save cycle to publish pending events collected from aggregate roots. This mechanism decouples side effects from core domain logic by processing events during persistence.

When do I need a repository-per-aggregate-root approach in .NET architecture?

You need a repository-per-aggregate-root approach when designing bounded contexts that require strict transactional boundaries. This pattern ensures persistence logic manages a single aggregate and its encapsulated entities, keeping the domain model maintainable.

How do I model value objects to replace primitive obsession in .NET?

To model value objects and replace primitive obsession, define immutable types that encapsulate domain concepts like money or coordinates. These objects enforce validation upon creation, ensuring invalid states are unrepresentable within your .NET domain.

Does this domain-driven design approach work for refactoring existing .NET applications?

Yes, this domain-driven design approach applies to refactoring existing .NET applications by restructuring logic into aggregates, value objects, and domain events. It helps decouple side effects from core domain logic to improve long-term maintainability.