domain-modeling

Enforce domain modeling principles to prevent invalid states and primitive obsession.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/jwilger/eventcore --skill domain-modeling-jwilger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-modeling
Source: https://github.com/jwilger/eventcore/tree/main/.agents/skills/domain-modeling
Command: npx skills add https://github.com/jwilger/eventcore --skill domain-modeling-jwilger

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the common issue of creating brittle software designs by teaching principles to build rich domain models that prevent bugs at compile time, rather than catching them at runtime.

Core Features & Use Cases

  • Preventing Bugs: Learn to make invalid states unrepresentable and avoid primitive obsession.
  • Clearer Code: Use semantic types to make code speak the language of the business.
  • Use Case: When designing a new feature, use this Skill to ensure that all identifiers (like AccountId and UserId) are distinct types, preventing accidental misuse and ensuring type safety.

Quick Start

Apply the domain modeling principles to the provided code snippet to identify and correct instances of primitive obsession.

Frequently Asked Questions about domain-modeling

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

FAQPage Schema
What is primitive obsession and how does it affect code quality?

Primitive obsession is using built-in types like strings for domain concepts, which reduces code quality by allowing invalid states. It causes type safety issues where identifiers are interchangeable, leading to runtime bugs that type-safe domain modeling prevents.

How do I make invalid states unrepresentable in software design?

To make invalid states unrepresentable in software design, use semantic types instead of primitives. This enforces domain modeling principles during TDD cycles and code reviews, ensuring type safety and preventing invalid data from being constructed.

How do I prevent accidental misuse of identifiers like AccountId and UserId?

Prevent accidental misuse of identifiers by creating distinct semantic types for AccountId and UserId. This domain modeling technique avoids primitive obsession, ensuring type safety and stopping invalid operations at compile time.

When should I apply domain modeling principles during development?

Apply domain modeling principles during code reviews and TDD cycles to ensure domain integrity. This type-safe design approach catches bugs at compile time rather than runtime, making it ideal when designing new features or refactoring existing software.

What is the best way to use semantic types to make code speak the language of the business?

The best way to use semantic types is replacing primitives with domain-specific types that match business terminology. This type-safe domain modeling approach prevents primitive obsession and ensures code clearly communicates business rules.

Do I need a specific framework to build type-safe domain models?

No specific framework is required to build type-safe domain models. The Skill provides domain modeling principles applicable to any software design environment, focusing on semantic types and preventing primitive obsession without external dependencies.