ddd-aggregates

Designs DDD aggregate boundaries from invariants, entities, value objects, and consistency strategies.

Updated Jul 4, 2026
One-click install
npx skills add https://github.com/100Thieves-team/plady-expert-skills --skill ddd-aggregates-100thieves-team
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-aggregates
Source: https://github.com/100Thieves-team/plady-expert-skills/tree/main/.claude/skills/ddd-aggregates
Command: npx skills add https://github.com/100Thieves-team/plady-expert-skills --skill ddd-aggregates-100thieves-team

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding which objects must change together to keep business rules consistent is one of the hardest parts of domain modeling. This Skill turns event flows and context definitions into explicit aggregate boundaries, so invariants are enforced by design instead of scattered across services. ## Core Features & Use Cases - Invariant-Driven Clustering: Extracts business rules that must always hold true and clusters objects into aggregates around them, identifying the aggregate root as the sole external entry point. - Building Block Classification: Distinguishes entities from value objects, re-examines foreign references for lifecycle ownership, and promotes predicate-style rules into Specification objects. - Consistency & Transaction Design: Defines transaction boundaries, cross-aggregate eventual consistency with events, compensation, and retry strategies, plus repository interface drafts. - Use Case: Given a Booking bounded context with events like BookingRequested and CheckInRecorded, produce an aggregate directory, invariant table, entity/value object list, and transaction boundary description ready for implementation. ## Quick Start Ask the assistant to design aggregates for your bounded context by providing its event flows, core terms, and context definition, and request the aggregate directory, invariant table, and transaction boundary description.

Frequently Asked Questions about ddd-aggregates

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

FAQPage Schema
How do I design DDD aggregates from business invariants?

Extract rules that must always hold true from commands and events, then cluster objects around those invariants. The object serving as the sole external entry point becomes the aggregate root, and each aggregate forms one transaction boundary.

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

Entities have identity and a lifecycle, so they are tracked over time. Value objects have no identity, are immutable, and are compared by value, making them safe to share and replace within aggregates.

How do aggregates handle consistency across bounded contexts?

Strong consistency applies within a single aggregate, while cross-aggregate consistency is eventual. Use domain events with compensation actions, idempotency guarantees, and retry strategies to keep other aggregates in sync.

When should a foreign reference become its own aggregate?

Re-examine every foreign reference by asking whether your team manages its lifecycle, meaning create, modify, and terminate. If yes, promote it to an internal aggregate rather than keeping it as a plain ID reference.

What are common aggregate design anti-patterns?

Defining aggregates by foreign keys or ORM relationships is a common anti-pattern, since aggregates are behavioral boundaries, not data mappings. Oversized aggregates with more than five entities and missing invariants also signal poor boundaries.