effect-ts
БесплатноБез исполняемых скриптовНе проверенEffect-TS library usage in TypeScript — Effect.gen generators, Schema.Struct/Schema.Class definitions, Layer/Context.Tag/Service patterns, Effect.pipe…
от pproenca★ 231 звезда на GitHubОб этом скилле
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 | 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 | Creating the Effect type, pipelines, generators, running effects |
| Error Management | Typed errors, recovery, retrying, timeouts, sandboxing |
| Core Concepts | Request batching, configuration management, runtime system |
Data & Validation
| Reference | When to Read |
|---|---|
| Data Types | Option, Either, Cause, Chunk, DateTime, Duration, Exit, Data |
| Schema Basics | Schema intro, basic usage, classes, constructors, effect data types |
| Schema Advanced | Transformations, filters, annotations, error formatting, JSON Schema output |
Architecture & Dependencies
| Reference | When to Read |
|---|---|
| Requirements Management | Services, Layers, dependency injection, layer memoization |
| Resource Management | Scope, safe resource acquisition/release, caching |
| State Management | Ref, SubscriptionRef, SynchronizedRef for concurrent state |
Concurrency & Streaming
| Reference | When to Read |
|---|---|
| Concurrency | Fibers, Deferred, Latch, PubSub, Queue, Semaphore |
| Streams and Sinks | Creating, consuming, transforming streams; sink operations |
| Scheduling | Built-in schedules, cron, combinators, repetition |
Platform & Observability
| Reference | When to Read |
|---|---|
| Platform | FileSystem, Command, Terminal, KeyValueStore, Path |
| Observability | Logging, metrics, tracing, Supervisor |
| Testing | TestClock for time simulation; for service mocking and layer testing, see Requirements Management |
Style, AI & Migration
| Reference | When to Read |
|---|---|
| Code Style | Branded types, pattern matching, dual APIs, guidelines, traits |
| AI Integration | Effect AI packages for LLM tool use and execution planning |
| Micro | Lightweight Effect alternative for smaller bundles |
| Migration Guides | Coming from Promises, fp-ts, neverthrow, or ZIO |
Quick Reference — Common Patterns
The Effect Type
// ┌─── Success type
// │ ┌─── Error type
// │ │ ┌─── Required dependencies
// ▼ ▼ ▼
Effect<Success, Error, Requirements>
Creating Effects
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
// Async (returns Promise)
Effect.runPromise(program)
// With full Exit information
Effect.runPromiseExit(program)
// Sync (throws on async)
Effect.runSync(program)
Ty
Установить effect-ts в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл effect-ts?
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-ts?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл effect-ts запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic