ddd

Model .NET business rules with aggregates, value objects, and domain events.

1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill ddd-trossitec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd
Source: https://github.com/Trossitec/dotnet-claude-kit/tree/main/skills/ddd
Command: npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill ddd-trossitec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DDD helps you model complex business rules by organizing your code around clear consistency boundaries instead of letting CRUD-style data structures erode invariants and maintainability.

Core Features & Use Cases

  • Aggregates as consistency boundaries: Enforces invariants within a single transaction and keeps cross-aggregate consistency eventual.
  • Value objects and strongly-typed IDs: Prevents primitive obsession and reduces ID mix-ups via type-safe identifiers and validated records.
  • Domain events and aggregate-root access: Decouples side effects from core logic and ensures external code interacts through the aggregate root.
  • Anti-pattern guidance: Flags oversized aggregates, misused domain events for intra-aggregate logic, identity-bearing value objects, and anemic aggregates.

Use this when implementing DDD tactical patterns in .NET—especially around aggregates, domain events, value objects, and repository persistence—and when your architecture advisor recommends DDD with Clean Architecture.

Quick Start

Load this skill while implementing your next aggregate-based feature and ask your AI to design the aggregate root, value objects, domain events, and repository persistence approach for your bounded context.

Frequently Asked Questions about ddd

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?

To model aggregates in .NET, use aggregate roots as the sole entry point and validate invariants inside the aggregate to enforce consistency boundaries within a single transaction. This prevents CRUD-style data structures from eroding your business rules and maintainability.

What is the best way to prevent primitive obsession and ID mix-ups in domain modeling?

The best way to prevent primitive obsession and ID mix-ups in domain modeling is by using value objects represented as immutable records alongside strongly-typed IDs, ensuring type-safe identifiers and validated data structures across your bounded context.

When should I dispatch domain events when persisting aggregates with EF Core?

You should dispatch domain events during EF Core persistence to decouple cross-aggregate side effects from core logic. This ensures external code interacts through the aggregate root while keeping cross-aggregate consistency eventual rather than immediate.

What are common DDD anti-patterns to avoid when designing bounded contexts?

Common DDD anti-patterns to avoid include oversized aggregates, misusing domain events for intra-aggregate logic, assigning identity to value objects, and creating anemic aggregates that lack behavior. These erode consistency boundaries and domain model effectiveness.

Can I use this DDD tactical guidance for Clean Architecture feature development in .NET?

Yes, you can use this DDD tactical guidance for Clean Architecture feature development in .NET. It specifically applies to implementing bounded contexts, defining aggregate root behavior, persisting aggregates, and coordinating side effects when your architecture advisor recommends DDD.