effect-ts

Document Effect v4 service patterns with ServiceMap.Service, Layer composition, and typed errors.

54|10|Updated Oct 19, 2017
One-click install
npx skills add https://github.com/davidnussio/vscode-jq-playground --skill effect-ts-davidnussio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ts
Source: https://github.com/davidnussio/vscode-jq-playground/tree/main/.agents/skills/effect-ts
Command: npx skills add https://github.com/davidnussio/vscode-jq-playground --skill effect-ts-davidnussio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to building, documenting, and reusing Effect v4 patterns in TypeScript, including services, layers, error handling, and data modeling.

Core Features & Use Cases

  • Service pattern guidance: define services with ServiceMap.Service and typed interfaces.
  • Layer orchestration: compose and provide layers across an application.
  • Data modeling: apply Schema.Class, branded types, and tagged errors for robust domain modeling.
  • Testing patterns: integrate with @effect/vitest to validate service behaviors.
  • Practical examples: patterns for HTTP clients and CLI tooling to illustrate end-to-end usage.

Quick Start

Create a new leaf service with a unique tag and wire it through a Layer, following the ServiceMap and Layer patterns described, then write tests using it.

Frequently Asked Questions about effect-ts

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

FAQPage Schema
How do I structure services and layers in Effect v4?

Model domain data in Effect v4 by applying Schema.Class and branded types. This approach enforces type safety at compile time and uses tagged errors to handle domain failures robustly.

Can I test Effect v4 services with vitest?

Yes, you can test Effect v4 services by integrating with @effect/vitest. This allows you to validate service behaviors and layer compositions directly within your existing testing environment.

What is the best way to handle typed errors in Effect v4?

The best way to handle typed errors in Effect v4 is by using tagged errors. This pattern ensures the type system tracks expected failures, allowing precise error management within your service layers.

Does this Skill provide examples for HTTP clients and CLI tooling in Effect?

Yes, the Skill provides practical examples for HTTP clients and CLI tooling. These patterns illustrate end-to-end usage, showing how to wire services and layers for external integrations.

When do I need ServiceMap.Service in TypeScript applications?

You need ServiceMap.Service when building service-based TypeScript applications requiring strict interface definitions. It establishes a unique tag for dependency injection and orchestrates layers across the app.