effect-patterns-error-management

Handle Effect-TS errors with tagged patterns and typed recoveries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Effect-TS error handling can quickly become ad-hoc and hard to maintain as pipelines grow. This Skill provides a cohesive set of patterns and utilities to model errors, recoveries, and branching in a type-safe, declarative way.

Core Features & Use Cases

  • Declarative error handling with catchTag, catchAll, catchTags to recover from failures in a typed fashion.
  • Pattern matching for ADTs using matchTag and matchTags to express exhaustive branching on domain errors.
  • Error boundary shaping with mapError to prevent leaking internal details across layers.
  • Predicate-based validation with Effect.filterOrFail to enforce business rules within pipelines.
  • Schedule-based retries and backoffs to make resilient async workflows.

Quick Start

Example: Provide a TypeScript snippet showing catchTag for a NetworkError and a fallback value.

Frequently Asked Questions about effect-patterns-error-management

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

FAQPage Schema
How do I handle errors declaratively in Effect-TS pipelines?

Error handling in Effect-TS pipelines is managed declaratively using pattern matching utilities like catchTag, catchAll, and catchTags to recover from typed failures safely. These functions enable type-safe branching and recovery from specific tagged errors without breaking pipeline composition.

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

Modeling domain errors in Effect-TS is best achieved using tagged errors and Algebraic Data Types (ADTs). Leveraging matchTag and matchTags expresses exhaustive branching logic on domain errors, ensuring every potential failure state is handled type-safely.

How do I prevent internal error details from leaking across layers in Effect-TS?

To prevent internal error details from leaking across layers in Effect-TS, use mapError to shape error boundaries. This transforms internal errors into generic external errors before crossing architectural boundaries, maintaining encapsulation and hiding implementation details.

Can I enforce business rule validation within an Effect-TS pipeline?

You can enforce business rule validation within an Effect-TS pipeline using predicate-based validation with Effect.filterOrFail. This function checks conditions directly within the pipeline and automatically fails with a specified tagged error if the predicate evaluates to false.

Does Effect-TS support schedule-based retries and backoffs for asynchronous workflows?

Effect-TS supports schedule-based retries and backoffs to build resilient asynchronous workflows. Applying Schedule patterns to effects defines custom retry strategies and backoff policies that automatically recover from transient failures without manual loop management.

When should I use catchTag instead of catchAll for error recovery in Effect-TS?

Use catchTag for targeted recovery from a specific tagged error in Effect-TS, preserving the handling of other failure types. Use catchAll when you need to recover from all possible errors in the pipeline at once, collapsing the error channel into a single recovery branch.