Domain-Driven Design (DDD)

Guides implementation of DDD entities, value objects, aggregates, and repositories in Java Spring Boot.

Updated May 12, 2026
One-click install
npx skills add https://github.com/ZzZueszZ/claude-kit --skill domain-driven-design-ddd-zzzueszz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Domain-Driven Design (DDD)
Source: https://github.com/ZzZueszZ/claude-kit/tree/main/.claude/skills/ddd
Command: npx skills add https://github.com/ZzZueszZ/claude-kit --skill domain-driven-design-ddd-zzzueszz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents anemic domain models and framework-coupled business logic by standardizing how the domain layer is designed in Java Spring Boot projects, keeping business rules independent of JPA, Spring, and other infrastructure concerns. ## Core Features & Use Cases - Rich Domain Modeling: Defines rules for Entities with business methods, immutable Value Objects, and Aggregates accessed only through Aggregate Roots. - Layered Architecture Enforcement: Specifies dependency direction (Infrastructure → Domain), repository interfaces in the domain layer with JPA adapters in infrastructure, and a standard package structure. - Domain Services & Events: Covers domain services for cross-aggregate logic, domain events, and Anti-Corruption Layers for external system integration. - Use Case: When building an order management module, use this Skill to model Order as an Aggregate Root with OrderItem children, a Money value object, an OrderRepository interface, and an OrderSubmittedEvent, all free of JPA annotations. ## Quick Start Apply the DDD skill to design the domain layer for a new product management module in my Spring Boot project.

Frequently Asked Questions about Domain-Driven Design (DDD)

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

FAQPage Schema
How do I implement DDD aggregates in Spring Boot?▼

Create an Aggregate Root entity that exposes domain methods for all state changes, and access child entities only through the root. Define one repository interface per aggregate root in the domain layer, implemented by a JPA adapter in the infrastructure layer.

What is the difference between an entity and a value object in DDD?▼

An entity has an identity (id) that persists across its lifecycle, while a value object is defined entirely by its values and has no identity. Value objects should be immutable, override equals() and hashCode(), and are best implemented as Java records.

Should domain entities have JPA annotations in Spring Boot?▼

No, domain entities should not import JPA, Spring, or Hibernate annotations. Keep a separate JPA entity in the infrastructure layer and use a mapper plus repository adapter to convert between the JPA entity and the domain entity.

When should I use a domain service instead of entity methods?▼

Use a domain service only when business logic spans two or more aggregates and does not naturally belong to any single one. Logic tied to one entity, such as checking low stock on a product, belongs inside that entity as a domain method.

Why is an anemic domain model a problem?▼

An anemic model reduces entities to data holders with getters and setters, pushing all business logic into services. This scatters rules across the codebase and breaks encapsulation; DDD instead places behavior inside entities through meaningful domain methods.