domain-modeling

Encode business rules into domain models to enforce invariants.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/mechemsi/claude-template --skill domain-modeling-mechemsi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-modeling
Source: https://github.com/mechemsi/claude-template/tree/main/skills/domain-modeling
Command: npx skills add https://github.com/mechemsi/claude-template --skill domain-modeling-mechemsi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain modeling helps eliminate drift between layers by encoding business rules into types and objects, ensuring invariants live with data rather than in services.

Core Features & Use Cases

  • Value Object patterns for Money, Date, Email, and other domain primitives with immutability.
  • Entities and Aggregates that enforce identity, lifecycle, and invariants through methods.
  • Bounded contexts and explicit translations to prevent cross-domain leakage and drift.
  • Guidance to avoid anemic models by keeping domain logic near the data.

Quick Start

Identify domain boundaries and start modeling with value objects, entities, and aggregates to enforce invariants.

Frequently Asked Questions about domain-modeling

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

FAQPage Schema
How do I enforce domain invariants and stop business logic from drifting across layers?

To enforce domain invariants and prevent drift, encode business rules directly into domain models using rich types. This ensures invariants live with the data inside entities and aggregates rather than scattered across external services.

What is the best way to model value objects and aggregates in a rich domain model?

Model value objects with immutability for domain primitives like Money or Date, and define aggregates to enforce identity and lifecycle. Keep domain logic near the data to avoid anemic models and ensure consistent state transitions.

How do I start applying DDD patterns when introducing new entities and bounded contexts?

Start applying DDD patterns by identifying domain boundaries and explicit translations to prevent cross-domain leakage. Introduce new entities, value objects, and aggregates to shape consistent identities across your layered architecture.

When do I need bounded contexts and explicit translations in domain modeling?

You need bounded contexts and explicit translations when multiple subdomains interact, to prevent cross-domain leakage and conceptual drift. They ensure that domain models remain consistent and isolated within their specific business boundaries.

Does this approach work for migrating an anemic domain model to a rich domain model?

Yes, this approach works for migrating anemic models by keeping domain logic near the data. It guides you to refactor services by enforcing invariants through aggregate methods and value object immutability instead of relying on external logic.