effect

Compose typed effects with services, layers, and error handling in TypeScript.

512|47|Updated Apr 7, 2021
One-click install
npx skills add https://github.com/dxos/dxos --skill effect-dxos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect
Source: https://github.com/dxos/dxos/tree/main/.cursor/skills/effect
Command: npx skills add https://github.com/dxos/dxos --skill effect-dxos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Effect-TS enables building robust TypeScript programs by modeling effects as composable, lazy workflows with typed errors and explicit dependencies. It guides you to define services via Context and Layers, manage resources safely, and compose complex I/O and concurrency patterns with predictable behavior.

Core Features & Use Cases

  • Effect describes a workflow as a value: a lazy, immutable description of a computation with a Success type, an Error type, and Requirements.
  • Typed error management: distinguishes expected errors from unexpected failures, enabling precise error handling with Effect.fail and related combinators.
  • Services & Layers: define services via Context.Tag, create and compose Layers, and safely provide dependencies to programs.
  • Resource management & concurrency: support for scoped resources, acquire/release patterns, parallel execution, and Effect.gen for generator-style workflows.
  • Use cases: building decoupled, testable API clients, data pipelines, or orchestrations that require deterministic execution and strong typing.

Quick Start

Create a simple Effect program that succeeds with a value, uses a provided service through a Layer, and executes with the Effect runtime.

Frequently Asked Questions about effect

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

FAQPage Schema
How do I manage dependencies and resources in TypeScript using Effect-TS?

Effect-TS manages dependencies and resources by defining services via Context.Tag and composing them with Layers. This approach safely handles acquire/release patterns and scoped resources, ensuring deterministic execution and clean testability for robust TypeScript programs.

How does Effect-TS handle typed errors in asynchronous workflows?

Effect-TS handles typed errors by distinguishing expected errors from unexpected failures within asynchronous workflows. You can use Effect.fail and Effect.try patterns to manage error channels explicitly, enabling precise error handling and predictable recovery in complex I/O operations.

How do I structure generator-style workflows with Effect.gen in TypeScript?

You structure generator-style workflows in TypeScript using Effect.gen to compose synchronous and asynchronous code sequentially. This allows you to model effects as lazy, immutable computations that manage typed errors and explicit dependencies across the workflow.

Can I build testable API clients and data pipelines with Effect-TS Layers?

Yes, you can build decoupled, testable API clients and data pipelines with Effect-TS Layers. By defining services via Context.Tag and safely providing dependencies, you create modular orchestrations that require deterministic execution and strong typing.

What is the best way to compose complex I/O and concurrency patterns in TypeScript?

The best way to compose complex I/O and concurrency patterns in TypeScript is using Effect-TS to model effects as lazy, composable workflows. This approach supports parallel execution and scoped resources, ensuring predictable behavior across synchronous and asynchronous code.