domain-modeling

Generate Effect domain models with S.TaggedStruct and S.Data.

68|13|Updated Aug 9, 2025
One-click install
npx skills add https://github.com/kriegcloud/beep-effect --skill domain-modeling-kriegcloud
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-modeling
Source: https://github.com/kriegcloud/beep-effect/tree/main/.claude/skills/domain-modeling
Command: npx skills add https://github.com/kriegcloud/beep-effect --skill domain-modeling-kriegcloud

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of complex, production-ready domain models, ensuring type safety, structural equality, and comprehensive runtime utilities for your business logic.

Core Features & Use Cases

  • ADT Creation: Define discriminated unions (Algebraic Data Types) using S.TaggedStruct.
  • Automatic Equality: Leverage S.Data for built-in structural equality checks.
  • Type-Safe Constructors: Generate validated constructors with S.decodeSync.
  • Pattern Matching: Implement exhaustive and type-safe pattern matching with Match.typeTags.
  • Use Case: Model a Task entity with states like Pending, Active, and Completed, complete with predicates, match functions, and equality checks.

Quick Start

Use the domain-modeling skill to create a new User schema with Admin and Customer variants.

Frequently Asked Questions about domain-modeling

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

FAQPage Schema
How do I build type-safe domain models in Effect?

To build type-safe domain models in Effect, you can use S.TaggedStruct to define discriminated unions and S.Data for automatic structural equality, ensuring your business logic remains robust and validated.

What is the best way to create algebraic data types with Effect schema?

The best way to create algebraic data types with Effect schema is using S.TaggedStruct to define discriminated unions, generating type-safe constructors and exhaustive pattern matching with Match.typeTags.

How do I implement exhaustive pattern matching for domain entities in Effect?

You implement exhaustive pattern matching for domain entities in Effect by using Match.typeTags, which allows you to safely handle all discriminated union states like Pending, Active, and Completed without missing cases.

Can I generate validated constructors automatically for Effect domain models?

Yes, you can generate validated constructors automatically for Effect domain models by using S.decodeSync, which ensures that any instantiated value object or entity strictly adheres to your schema definitions.

Does Effect schema support automatic structural equality for domain entities?

Effect schema supports automatic structural equality for domain entities through S.Data, allowing you to perform direct comparisons between state objects without writing custom equality functions.

When should I use S.TaggedStruct over standard schemas for data modeling?

You should use S.TaggedStruct over standard schemas for data modeling when you need to define complex discriminated union types with built-in predicates, orders, guards, and match functions for comprehensive runtime utilities.