domain-primitives-and-always-valid

Community

Design domain-specific, immutable types for safety

Authorj5ik2o
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Domain Primitives & Always-Valid Domain Model remove dependence on raw primitive types by wrapping them in domain-specific, immutable types that enforce invariants at construction. This approach prevents invalid states, improves code readability, and enables stronger compiler-time guarantees. It provides a blueprint for modeling core domain concepts that are safe to compose and reason about.

Core Features & Use Cases

  • Domain Primitives: wrap primitive values to enforce invariants at construction time.
  • Always-Valid: ensure domain objects represent valid states and expose only safe operations.
  • Smart Constructors & Validation: use factory methods to enforce invariants and prevent invalid instances.
  • Range/NonEmpty & composite values: model bounded domains, sequences, and related value types like Money, Age, Email.
  • Language-agnostic guidance: applies to Rust, TypeScript, Java, and other languages for broad applicability.

Quick Start

Define a domain primitive by wrapping a primitive value with a smart constructor that enforces invariants.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: domain-primitives-and-always-valid
Download link: https://github.com/j5ik2o/okite-ai/archive/main.zip#domain-primitives-and-always-valid

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.