effect-patterns-domain-modeling

Model TypeScript domain logic with Effect-TS patterns for error tagging and schema validation.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/scotttrinh/nook --skill effect-patterns-domain-modeling-scotttrinh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-patterns-domain-modeling
Source: https://github.com/scotttrinh/nook/tree/main/.agents/skills/effect-patterns-domain-modeling
Command: npx skills add https://github.com/scotttrinh/nook --skill effect-patterns-domain-modeling-scotttrinh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a curated set of Effect-TS patterns to model domain logic safely in TypeScript, enabling robust, testable, and maintainable business logic.

Core Features & Use Cases

  • Domain modeling foundations: type-safe interfaces, branded types, and error tagging to express domain concepts clearly.
  • Practical patterns: handling optional values with Option, building sequential business logic with Effect.gen, and schema-driven validation with Schema.
  • Use case: design a domain layer for a service that validates input, constructs domain entities, and handles errors in a composable, predictable way.

Quick Start

Create a small domain (e.g., User and Product), import Effect and Schema, and iteratively implement domain rules using the patterns described in this Skill.

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 logic safely in TypeScript using Effect-TS?

Model domain logic safely in TypeScript by applying Effect-TS patterns like branded types for type-safe interfaces, tagged errors for predictable failure handling, and Schema for input validation to build composable business logic.

What is the best way to handle predictable errors in an Effect-TS domain model?

Handle predictable errors in an Effect-TS domain model by using tagged errors, which allow you to express specific domain failures clearly and handle them compositionally within your business logic workflows.

How do I validate input and construct domain entities with Effect Schema?

Validate input and construct domain entities with Effect Schema by defining schema-driven validation rules that parse and enforce type safety, ensuring only valid data builds your domain objects.

When should I use branded types in TypeScript domain modeling?

Use branded types in TypeScript domain modeling when you need to distinguish primitive values at the type level, preventing common errors like assigning a UserId to a ProductId and ensuring type-safe domain interfaces.

How do I build sequential business logic workflows with Effect.gen?

Build sequential business logic workflows with Effect.gen by using generator-based syntax to compose multiple Effect operations, allowing you to validate, construct, and handle domain entities in a predictable, readable flow.

Can I handle optional domain values safely without null checks in Effect-TS?

Handle optional domain values safely in Effect-TS by using the Option data type, which explicitly represents the presence or absence of a value and eliminates runtime null checks in your domain layer.