Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

effect-ts

БесплатноБез исполняемых скриптовНе проверен

Effect-TS library usage in TypeScript — Effect.gen generators, Schema.Struct/Schema.Class definitions, Layer/Context.Tag/Service patterns, Effect.pipe…

pproencaот 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

Полный SKILL.md на GitHub

Установить effect-ts в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

gotchas.mdmetadata.jsonreferences/_sections.mdreferences/ai-integration.mdreferences/code-style.mdreferences/conc-concurrency.mdreferences/core-concepts.mdreferences/data-types.mdreferences/error-management.mdreferences/getting-paradigm.mdreferences/getting-started.mdreferences/micro-module.mdreferences/migration-guides.mdreferences/obs-observability.mdreferences/plat-platform.mdreferences/req-management.mdreferences/resource-management.mdreferences/sched-scheduling.mdreferences/schema-advanced.mdreferences/schema-basics.mdreferences/state-management.mdreferences/streams-and-sinks.mdreferences/test-testing.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить effect-ts с