domain-entity-reference-direction

Installation
SKILL.md

Domain Entity Reference Direction

Goal

When two domain entities are related, determine whether each entity needs a reference to the other based on its own domain responsibilities — invariants and behavior — not on read or query convenience.

A domain entity should hold a reference to another entity only when that reference is required for the entity to enforce its own invariants or perform its own domain behavior. If the relationship is only needed to answer queries or display data, it does not belong on the entity — it belongs in the repository as a query operation.

Most relationships are unidirectional. Bidirectional references are rare and require both entities to independently need the reference for their own domain logic.

What Counts as In Scope

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

  • defines a domain entity that holds or could hold a reference to another domain entity
  • introduces a new relationship between two domain entities
  • adds a reference to an entity for the purpose of querying or displaying related data
  • reviews whether an existing reference on a domain entity is justified by domain behavior
Related skills

More from code-sherpas/agent-skills

Installs
6
First Seen
Mar 24, 2026