effect-ts

Implement Effect-TS functional programming patterns across services, layers, and error handling.

7|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/sablier-labs/plugin-marketplace --skill effect-ts-sablier-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ts
Source: https://github.com/sablier-labs/plugin-marketplace/tree/main/plugins/fp/skills/effect-ts
Command: npx skills add https://github.com/sablier-labs/plugin-marketplace --skill effect-ts-sablier-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers implement robust functional programming with the Effect-TS library, covering patterns, services, layers, and error handling to build reliable, composable code.

Core Features & Use Cases

  • Pattern guidance: idiomatic usage of Effect for error handling, dependency injection, resource management, and composition.
  • Next.js integration: strategies for combining Effect-TS with @prb/effect-next for server and client workflows.
  • Testing patterns: approaches to deterministic testing, mocking, and validating Effect-based code across environments.

Quick Start

Create a minimal Effect-TS program that uses Effect.gen to call a mock Api and logs the result, then run it with an appropriate runner to observe output.

Frequently Asked Questions about effect-ts

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

FAQPage Schema
How do I implement error handling with Effect-TS in TypeScript?

Effect-TS provides structured error handling through its type-safe Result and Either patterns, replacing try-catch with composable error flows. Use Effect.gen syntax to chain operations that automatically propagate errors without manual wrapping, ensuring type safety across your entire call stack.

Can I use Effect-TS with Next.js?

Yes. Effect-TS integrates with Next.js through @prb/effect-next, enabling server and client workflows with unified error handling and dependency injection across boundaries. This allows you to write composable, type-safe functional code in both server components and API routes.

What is dependency injection in Effect-TS and why does it matter?

Dependency injection in Effect-TS uses Layers to declare and compose services without tight coupling. Services are provided at runtime through Effect's context system, making code testable, modular, and reusable across different configurations and environments.

How do I test Effect-TS code?

Effect-TS enables deterministic testing by running effects with controlled Layers that inject mock services and dependencies. This replaces traditional mocking, allowing you to test error paths, resource cleanup, and composition logic in isolation without side effects.

Do I need to know functional programming to use Effect-TS?

While Effect-TS builds on functional principles, Effect.gen provides imperative-style syntax that feels familiar to traditional TypeScript. However, understanding composition, pure functions, and error propagation patterns will help you write more effective and maintainable code.

What problems does Effect-TS solve that regular TypeScript doesn't?

Effect-TS solves resource safety, complex error propagation, and service composition at scale. It guarantees resource cleanup, eliminates uncaught errors through the type system, and enables predictable async flows—challenges that require boilerplate and vigilance in plain TypeScript.