Skip to main content
skill CX Codex

effect-ts · pproenca — Claude Code skill: what it does, how to install

A skill providing patterns and reference guides for Effect-TS: typed error channels, Effect.gen flows, Layers, and fiber concurrency.

MIT 263 installs ★ 227 updated 2026-08-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pproenca/dot-skills --skill effect-ts -a claude-code
Open on GitHub

What effect-ts does

This skill supplies architectural guidance and practical patterns for the Effect-TS ecosystem. It triggers when an assistant writes, inspects, or refactors TypeScript code importing from effect, @effect/schema, @effect/platform, or related @effect/* modules.

Inside are references covering dependency injection with Context.Tag and Layer, data modeling via Schema, custom failures with Data.TaggedError, and fiber concurrency primitives like Queue or Deferred. It also includes transition steps for migrating code from Promises, fp-ts, neverthrow, or ZIO.

Rules explicitly exclude React useEffect hooks and Redux side effects. The assistant references these guides only when handling the Effect-TS library.

What it helps with

  • structure dependency injection using Context.Tag and Layer
  • model domain errors with Data.TaggedError
  • refactor Promise or fp-ts workflows into Effect.gen pipelines
  • manage concurrent tasks using Ref, Queue, and Deferred

Example prompts for the agent

  • Refactor this async function to Effect.gen with Data.TaggedError error handling
  • Implement a UserRepo service using Context.Tag and provide a live Layer
  • How do I parse and validate this payload with @effect/schema?

How to install effect-ts

1Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill effect-ts -a claude-code

2Manually: put the files in place

~/.claude/skills/effect-ts/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/effect-ts/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about effect-ts

How do I install effect-ts in Claude Code?

Run npx skills add pproenca/dot-skills --skill effect-ts -a claude-code in your terminal. It installs the skill file into ~/.claude/skills/effect-ts/SKILL.md.

What does the effect-ts skill do?

It equips the agent with guidelines for writing Effect-TS applications, covering generators, dependency management through Layers, and typed error handling.

Does effect-ts trigger for React useEffect?

No. The configuration specifically ignores React's useEffect and Redux side effects, activating only for Effect-TS packages and concepts.

Source text

SKILL.md · MIT
---
name: effect-ts
description: Effect-TS library usage in TypeScript — Effect.gen generators, Schema.Struct/Schema.Class definitions, Layer/Context.Tag/Service patterns, Effect.pipe pipelines, Data.TaggedError/Data.Class error types, Ref/Queue/PubSub/Deferred concurrency primitives, Match module, Config providers, Scope/Exit/Cause/Runtime patterns, or any code using Effect's typed error channel (E parameter). Trigger when writing, reviewing, debugging, or refactoring TypeScript code that uses Effect — when you see imports from `effect`, `effect/*`, or any `@effect/*` scoped package (schema, platform, sql, opentelemetry, cli, cluster, rpc, vitest). Also trigger when the user asks about Effect patterns, migration from Promises/fp-ts/neverthrow to Effect, or how to structure an Effect application. Do NOT trigger for React's useEffect, Redux side effects, or general English usage of "effect" unless the context clearly involves the Effect-TS library.
---
# Effect TypeScript Best Practices

Effect is a TypeScript library for building complex, type-safe applications with structured
error handling, dependency injection via services/layers, fiber-based concurrency, and
resource safety.

## When to Apply

- Writing or reviewing TypeScript code that imports from `effect`, `@effect/schema`, or `@effect/platform`
- Implementing typed error handling with `Effect<Success, Error, Requirements>`
- Building services and layers for dependency injection
- Working with Schema for data validation, decoding, and transformation
- Using fiber-based concurrency (queues, semaphores, PubSub, deferred)
- Processing data with Stream and Sink
- Migrating from Promises, fp-ts, neverthrow, or ZIO to Effect

## How to Use

This skill is organized by domain. Read the relevant reference file for the area you're working in.

### Read First: The Paradigm

**Always read this before diving into API references**, especially when refactoring existing
code to use Effect or writing new Effect services:

| Reference | When to Read |
|-----------|-------------|
| [**Think in Effect: The Paradigm Shift**](references/getting-paradigm.md) | **Before any other reference.** Mental model shifts, refactoring recipes, anti-patterns, application architecture. Read this to understand HOW to think in Effect — the other files teach WHAT to type. |

### Core Foundations

| Reference | When to Read |
|-----------|-------------|
| [Getting Started](references/getting-started.md) | Creating the Effect type, pipelines, generators, running effects |
| [Error Management](references/error-management.md) | Typed errors, recovery, retrying, timeouts, sandboxing |
| [Core Concepts](references/core-concepts.md) | Request batching, configuration management, runtime system |

### Data & Validation

| Reference | When to Read |
|-----------|-------------|
| [Data Types](references/data-types.md) | Option, Either, Cause, Chunk, DateTime, Duration, Exit, Data |
| [Schema Basics](references/schema-basics.md) | Schema intro, basic usage, classes, constructors, effect data types |
| [Schema Advanced](references/schema-advanced.md) | Transformations, filters, annotations, error formatting, JSON Schema output |

### Architecture & Dependencies

| Reference | When to Read |
|-----------|-------------|
| [Requirements Management](references/req-management.md) | Services, Layers, dependency injection, layer memoization |
| [Resource Management](references/resource-management.md) | Scope, safe resource acquisition/release, caching |
| [State Management](references/state-management.md) | Ref, SubscriptionRef, SynchronizedRef for concurrent state |

### Concurrency & Streaming

| Reference | When to Read |
|-----------|-------------|
| [Concurrency](references/conc-concurrency.md) | Fibers, Deferred, Latch, PubSub, Queue, Semaphore |
| [Streams and Sinks](references/streams-and-sinks.md) | Creating, consuming, transforming streams; sink operations |
| [Scheduling](references/sched-scheduling.md) | Built-in schedules, cron, combinators, repetition |

### Platform & Observability

| Reference | When to Read |
|-----------|-------------|
| [Platform](references/plat-platform.md) | FileSystem, Command, Terminal, KeyValueStore, Path |
| [Observability](references/obs-observability.md) | Logging, metrics, tracing, Supervisor |
| [Testing](references/test-testing.md) | TestClock for time simulation; for service mocking and layer testing, see [Requirements Management](references/req-management.md) |

### Style, AI & Migration

| Reference | When to Read |
|-----------|-------------|
| [Code Style](references/code-style.md) | Branded types, pattern matching, dual APIs, guidelines, traits |
| [AI Integration](references/ai-integration.md) | Effect AI packages for LLM tool use and execution planning |
| [Micro](references/micro-module.md) | Lightweight Effect alternative for smaller bundles |
| [Migration Guides](references/migration-guides.md) | Coming from Promises, fp-ts, neverthrow, or ZIO |

## Quick Reference — Common Patterns

### The Effect Type
```ts
//         ┌─── Success type
//         │        ┌─── Error type
//         │        │      ┌─── Required dependencies
//         ▼        ▼      ▼
Effect<Success, Error, Requirements>
```

### Creating Effects
```ts
import { Effect } from "effect"

// From sync values
const succeed = Effect.succeed(42)
const fail = Effect.fail(new Error("oops"))

// From sync code that may throw
const sync = Effect.try(() => JSON.parse(data))

// From promises
const async = Effect.tryPromise(() => fetch(url))

// From generators (recommended for complex flows)
const program = Effect.gen(function* () {
  const user = yield* getUser(id)
  const todos = yield* getTodos(user.id)
  return { user, todos }
})
```

### Running Effects
```ts
// Async (returns Promise)
Effect.runPromise(program)

// With full Exit information
Effect.runPromiseExit(program)

// Sync (throws on async)
Effect.runSync(program)
```

### Typed Errors
```ts
import { Data, Effect } from "effect"

class NotFound extends Data.TaggedError("NotFound")<{
  readonly id: string
}> {}

class Unauthorized extends Data.TaggedError("Unauthorized")<{}> {}

// Error type is tracked: Effect<User, NotFound | Unauthorized>
const getUser = (id: string) =>
  Effect.gen(function* () {
    // ...
  })
```

### Services and Layers
```ts
import { Context, Effect, Layer } from "effect"

// Define a service
class UserRepo extends Context.Tag("UserRepo")<
  UserRepo,
  { readonly findById: (id: string) => Effect.Effect<User, NotFound> }
>() {}

// Use in effects — adds to Requirements channel
const program = Effect.gen(function* () {
  const repo = yield* UserRepo
  return yield* repo.findById("1")
})

// Implement with a Layer
const UserRepoLive = Layer.succeed(UserRepo, {
  findById: (id) => Effect.succeed({ id, name: "Alice" })
})

// Provide and run
program.pipe(Effect.provide(UserRepoLive), Effect.runPromise)
```

### Schema Validation
```ts
import { Schema } from "effect"

const User = Schema.Struct({
  id: Schema.Number,
  name: Schema.String,
  email: Schema.String.pipe(Schema.pattern(/@/))
})

type User = typeof User.Type

// Decode (parse + validate)
const decode = Schema.decodeUnknownSync(User)
const user = decode({ id: 1, name: "Alice", email: "[email protected]" })
```

### Pipelines
```ts
import { Effect, pipe } from "effect"

// Data-last (pipe style)
const result = pipe(
  getTodos,
  Effect.map((todos) => todos.filter((t) => !t.done)),
  Effect.flatMap((active) => sendNotification(active.length)),
  Effect.catchTag("NetworkError", () => Effect.succeed("offline"))
)

// Fluent (method style)
const result2 = getTodos.pipe(
  Effect.map((todos) => todos.filter((t) => !t.done)),
  Effect.flatMap((active) => sendNotification(active.length))
)
```

## Gotchas

See [gotchas.md](gotchas.md) for known failure points.

© pproenca · MIT · pproenca/dot-skills

Similar skills

All skills for Programming languages →

effect-ts by other authors comes first.

effect-ts Effect-TS effect-ts is a Claude Code skill for setting up a repository that uses the Effect TypeScript library. It activates during project setup. CX Codex +1 8,700installs effect-ts PaulRBerg effect-ts — a skill for nontrivial Effect 4 work: services, layers, typed errors, Schema, Config and runtime. Keeps the agent from mixing up v3 and v4 APIs. CX Codex +1 3,100installs effect-ts joelhooks effect-ts gives the agent ground rules for Effect v4 code: services, layers, schemas and errors. Useful once a project already depends on effect. CX Codex +1 1,100installs effect-ts pedronauck Skill for working with Effect-TS, a functional programming library for TypeScript. Guides you through type-safe code with error handling, async operations, and resource management using Effect, Schema, Pattern Matching, and Context.Tag. CX Codex +1 264installs effect-best-practices Makisuo effect-best-practices — a skill that makes the agent follow Effect-TS conventions for services, errors, layers and atoms. Useful when the codebase already runs on Effect. CX Codex +1 844installs effect kitlangton A guide for building TypeScript applications with Effect v4, covering services, schemas, configuration, HTTP clients, streams, and tests. CX Codex +1 2,900installs error-handling affaan-m error-handling — a skill that sets one way to handle errors in TypeScript, Python and Go: typed errors, retries, circuit breakers, user-facing messages. CX Codex +1 6,600installs effect-v3-to-v4 Effect-TS Drives an Effect v3 to v4 migration from the generated reference that ships in the Effect repo. Useful when you upgrade effect or any @effect/* package across the version boundary. CX Codex +1 772installs ax-add-ingest-stage Necmttn ax-add-ingest-stage guides the addition of SurrealDB tables and pipeline ingest stages in the ax repository. Keeps changes aligned with strict CI verification gates. CX Codex +1 ★ 124repo stars functional citypaul This skill guides agents toward immutable data and practical functional patterns. Use it when changing application logic, reshaping collections, or working with Effect in an existing Effect project. CX Codex +1 1installs

From the same set139

The whole set →
ios-chaos-monkey ios-chaos-monkey is a Claude Code skill with crash-hunting rules and TDD patterns for finding crashes and data races in Swift 6.2 iOS apps. CX Codex +1 274installs nginx-c-module-perf The nginx-c-module-perf skill guides performance and reliability work on nginx C modules. Use it when tuning buffers, connections, caching, or error handling. CX Codex +1 267installs react-native-elements This skill guides React Native Elements setup, component choices, theming, and list performance. Use it while building or reviewing a React Native app with RNE. CX Codex +1 265installs bug-review bug-review is a Claude Code skill that runs five parallel passes over a PR diff, selects findings by majority vote, then checks them with a separate Opus validator. It finds bugs before the merge. CX Codex +1 264installs nginx-c-module-debug The nginx-c-module-debug skill guides diagnosis of nginx C module crashes, memory faults, and request-flow problems. Use it for GDB, core dumps, and tracing. CX Codex +1 260installs rust-write-tests rust-write-tests guides coding agents in writing deep Rust tests that target invariants, isolate test files, and systematically eradicate flaky async test runs. CX Codex +1 257installs rails-application-ui-blocks rails-application-ui-blocks is a Claude Code skill that assembles UI blocks in Ruby on Rails ERB views while preserving Turbo, Stimulus, and accessibility hooks. CX Codex +1 257installs rust-implement rust-implement enforces a four-pass discipline for Rust development, moving from strict type design to implementation, simplification, and automated linting. CX Codex +1 254installs

Project sponsors

Companies that keep this analytics open