Domain entity

From IntentArchitect/Intent.Modules.NET · View interactive version

Domain entity is an AI agent skill from the GitHub repository IntentArchitect/Intent.Modules.NET. Implements domain behaviour, invariants, and constructors on entities and aggregates. MUST load before creating or editing any entity, aggregate, or value object.

How to use this skill

Skill file

Domain Entity

Implement or improve business behaviour on a single C# domain class.

Treat the class as part of a clean architecture domain model first and an persistence type second. Preserve domain intent, protect invariants, and avoid pushing business rules into application services unless the rule genuinely spans multiple aggregates or external systems.

Default workflow

  1. Read the entity or aggregate carefully.
  2. Identify missing behaviour, especially methods throwing NotImplementedException, empty methods, placeholder guards, or constructors that do not fully establish a valid object.
  3. Infer the domain intent from names, fields, properties, comments, existing guards, and related methods.
  4. Implement the smallest coherent set of domain rules needed to make the type useful and internally consistent.
  5. Explain assumptions briefly when the domain intent is uncertain.

What to optimise for

Constructor guidance

When constructors are incomplete or missing, use these rules:

Operation guidance

When implementing methods on the class:

How to infer missing behaviour

When a method body is missing, infer intent from:

If the intent is still ambiguous, choose the safest low-surprise implementation and state the assumption clearly.

Implementation rules

Review checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.