effect-patterns-domain-modeling

Model Effect-TS domains with branded types, tagged errors, and Schema validation.

785|26|Updated Jun 22, 2025
One-click install
npx skills add https://github.com/PaulJPhilp/EffectPatterns --skill effect-patterns-domain-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-patterns-domain-modeling
Source: https://github.com/PaulJPhilp/EffectPatterns/tree/main/config/.claude-plugin/plugins/effect-patterns/skills/effect-patterns-domain-modeling
Command: npx skills add https://github.com/PaulJPhilp/EffectPatterns --skill effect-patterns-domain-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured set of Effect-TS domain modeling patterns to help developers design robust, type-safe domain layers. It covers interfaces, branded types, tagged errors, Option, Schema, and Effect.gen workflows.

Core Features & Use Cases

  • Domain modeling patterns for Effect-TS: interfaces, branded types, and branded domain primitives.
  • Type-safe error handling with Data.TaggedError and tagged errors.
  • Option-based modeling for optional values to distinguish missing data from errors.
  • Schema-based validation and decoding for robust input handling.
  • Effect.gen for readable, sequential business logic.
  • Bringing together Brand and Schema for validated branded types.
  • Guidance for building scalable domain layers in TypeScript apps using Effect-TS.

Quick Start

Define a minimal domain model for a User using interfaces, branded types, Option, and a simple Effect.gen workflow.

Frequently Asked Questions about effect-patterns-domain-modeling

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

FAQPage Schema
How do I model domain entities and errors in Effect-TS?

Use branded types to create domain-safe primitives in Effect-TS, preventing invalid data at compile time. Branded types attach a unique brand to a base type, enforcing that only validated values pass through your domain layer.

How does Schema validation work with branded types in Effect-TS?

Use Option in Effect-TS domain modeling to explicitly distinguish missing data from actual errors. Option represents the presence or absence of a value, keeping error channels reserved for genuine failures via Data.TaggedError.

How do I build sequential business logic workflows in Effect-TS?

Build sequential business logic workflows in Effect-TS using Effect.gen. This generator-based approach allows readable, step-by-step execution of asynchronous tasks, validation, and error handling within your domain layer.

What is the best way to handle type-safe errors in an Effect-TS domain layer?

This approach suits TypeScript applications building scalable domain layers with Effect-TS. It requires familiarity with functional programming concepts, including branded types, Schema validation, and generator-based workflows.