aggregate-boundaries

Installation
SKILL.md

Domain Entity Aggregate Boundaries

Goal

When a domain entity relates to another domain entity, determine whether they belong to the same aggregate or to different aggregates, apply the correct reference style, and persist the boundary decision so it is available to future tasks.

An aggregate is a cluster of domain entities that share a consistency boundary. One entity is the aggregate root. Entities inside the same aggregate reference each other directly. Entities in different aggregates reference each other exclusively by identity — the identifier of the other aggregate root.

The boundary decision depends on whether the related entity has an independent lifecycle. If it can be created, modified, or deleted independently, it belongs to a separate aggregate. If it cannot exist or make sense without the other, it belongs to the same aggregate.

When the boundary is not documented and cannot be determined objectively from the code or domain context, the agent must ask the human before proceeding.

What Counts as In Scope

Apply this skill to code that does one or more of these things:

  • defines a domain entity that holds a reference to another domain entity
  • defines a domain entity that holds an identifier referencing another domain entity
  • introduces a new relationship between two domain entities
Related skills

More from code-sherpas/agent-skills

Installs
7
First Seen
Mar 24, 2026