ddd-patterns

Design aggregates, entities, value objects, and repositories in the Domain layer.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/bbolek-ap/new-ai-native --skill ddd-patterns-bbolek-ap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-patterns
Source: https://github.com/bbolek-ap/new-ai-native/tree/main/.claude/skills/ddd-patterns
Command: npx skills add https://github.com/bbolek-ap/new-ai-native --skill ddd-patterns-bbolek-ap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps software teams design robust Domain models by providing guidance on aggregates, entities, value objects, and repositories. It covers how to model aggregate roots, enforce invariants, describe value objects, and apply the repository pattern with explicit interfaces and concrete implementations. It also outlines EF Core materialization constructor rules and clean separation between Domain and Infrastructure layers. It is designed to be loaded by Solution Spec Writer, Execution Planner, and Implementation agents when a feature touches the Domain layer.

Core Features & Use Cases

  • Aggregate design guidance: define boundaries, invariants, and access routes within an aggregate.
  • Value objects: define equality by value, immutability, and hydration from other SORs; ensure hydration caching and isolation from the database.
  • Entities and repositories: model identity, aggregate boundaries, and explicit repository methods per use case.
  • EF materialization constructors: include private parameterless constructors for Value objects used in EF Core configurations as needed.

Quick Start

Observe the domain requirements and implement an aggregate root with related value objects and a repository per aggregate.

Frequently Asked Questions about ddd-patterns

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

FAQPage Schema
How do I design aggregates and define boundaries in domain-driven design?

To design aggregates, model the aggregate root, define boundaries to protect invariants, and establish access routes within the aggregate to ensure transactional consistency across entities.

How do I implement value objects with EF Core materialization?

Implementing value objects with EF Core materialization requires defining immutability, value equality, and including a private parameterless constructor for EF Core configurations to hydrate the object correctly.

When should I use the repository pattern in a domain layer?

Use the repository pattern in the domain layer to separate concerns, providing explicit repository interfaces per aggregate and use case while keeping infrastructure concerns out of the domain.

Does domain-driven design work with Entity Framework Core?

Domain-driven design works with EF Core by applying clean separation between Domain and Infrastructure layers, using private parameterless constructors for value object materialization within EF configurations.

What is the best way to model identity and aggregate boundaries for entities?

The best way to model entities is to define explicit identity, set clear aggregate boundaries to limit access, and expose explicit repository methods tailored for specific use cases.