Expert guidance for nontrivial Effect-TS work: services/layers, typed errors, Schema/JSONSchema, Config, runtime/concurrency, @effect/vitest, @effect/ai, @effect/sql, or @prb/effect-next.
How this skill is triggered — by the user, by Claude, or both
Slash command
/paulrberg-agent-skills:effect-tsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Expert guidance for functional programming with the Effect library, covering error handling, dependency injection,
agents/openai.yamlreferences/ai.mdreferences/collection-operations.mdreferences/config.mdreferences/critical-rules.mdreferences/effect-atom.mdreferences/next-js.mdreferences/option-null.mdreferences/pattern-matching.mdreferences/platform-rpc.mdreferences/quick-reference.mdreferences/quick-utils.mdreferences/recent-upstream.mdreferences/runtime.mdreferences/schema-jsonschema.mdreferences/services-layers.mdreferences/sql.mdreferences/streams.mdreferences/testing.mdExpert guidance for functional programming with the Effect library, covering error handling, dependency injection, composability, testing, and runtime-boundary patterns.
Do not route through this skill just because a file imports from effect; use it only when the change depends on Effect
semantics, not just Effect's presence.
For small code edits:
./references/critical-rules.md before writing or changing Effect code — this is the one mandatory reference. Key
guidelines:
return yield* pattern for errors (makes termination explicit)Check the Effect source at ~/.effect only when the task needs upstream API details, changelog verification, or a complex
type/runtime question that local project patterns do not answer.
If ~/.effect is required but missing, stop and inform the user. Clone it before proceeding:
git clone https://github.com/Effect-TS/effect.git ~/.effect
Last checked against ~/.effect HEAD 05d72eab7 from 2026-06-05:
[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]Your local ~/.effect checkout need not match these exact versions. Drift is expected and fine as long as the major
versions match. For effect that means the 3.x line. For the 0.x @effect/* packages, semver treats the leading
non-zero segment as the break boundary, so match the minor too (e.g. @effect/[email protected]). Patch differences, and minor
differences on stable packages, won't invalidate this skill's guidance; only a break-boundary bump warrants caution.
Local ~/.effect drift is usually fine for routine project work. If git -C ~/.effect log -1 --oneline is newer and the
task depends on upstream behavior, inspect the touched package changelogs and commits before relying on this skill.
Capture public API or guidance changes in a reference file.
Effect-TS has many ways to accomplish the same task. For moderate to high complexity tasks, research enough to choose the least surprising pattern that fits the current codebase. Prefer parallel local reads/searches. Use subagents only when the environment explicitly supports them and the task has separable research tracks.
Codebase Patterns First — Examine similar patterns in the current project before implementing. If Effect patterns exist in the codebase, follow them for consistency. If no patterns exist, skip this step.
Effect Source Code — For complex type errors, unclear behavior, or implementation details, examine the relevant
package source under ~/.effect/packages/<package>/src/. For core Effect, use ~/.effect/packages/effect/src/.
Package Changelogs — When behavior changed recently, read the relevant changelog under ~/.effect/packages/*/
before inferring from old examples.
HIGH Priority (Always Research):
MEDIUM Priority (Research if Complex):
This is the single index for every reference file — renaming or adding a reference only requires editing this table. Open references selectively, only the row(s) that match the task:
| Task shape | Read |
|---|---|
| Writing or changing any nontrivial Effect code (mandatory, read first) | ./references/critical-rules.md |
Services, Layers, Effect.Service, Context.Tag, Effect.fn (layers memoize by identity — Layer.fresh when needed) | ./references/services-layers.md |
| Config, env vars, secrets, custom providers | ./references/config.md |
Schema decoding, JSON Schema, AI parameter shapes (Schema.Record(String, Never) for closed records) | ./references/schema-jsonschema.md |
@effect/vitest, TestClock, sleeps/retries, fibers in tests | ./references/testing.md |
Resources, scheduling, refs, concurrency, SubscriptionRef (version mismatch shows as unsafeMake is not a function) | ./references/runtime.md |
| Streams, backpressure, bounded consumption (infinite streams hang without it) | ./references/streams.md |
Pattern matching, tagged unions, Data.taggedEnum | ./references/pattern-matching.md |
@effect/ai tools/providers/OpenAI integration (no-parameter tools: use Tool.EmptyParams) | ./references/ai.md |
@effect/sql, SqlSchema, repository row decoding | ./references/sql.md |
@effect/platform, @effect/rpc, deployment runtimes | ./references/platform-rpc.md |
@prb/effect-next / Next.js App Router | ./references/next-js.md |
@effect-atom/* React state | ./references/effect-atom.md |
| Array/Record reducers, filters, predicates, sorting | ./references/collection-operations.md |
| Tiny utility functions, deprecations | ./references/quick-utils.md |
Option vs null/undefined at boundaries | ./references/option-null.md |
| Upstream drift or recent package behavior | ./references/recent-upstream.md |
| Quick lookup: basic constructors, combinators, error taxonomy (cancellation/interrupts aren't the same as failures) | ./references/quick-reference.md |
When working in a project that uses Effect, check for existing patterns before implementing new code:
'effect' to understand existing usageIf no Effect patterns exist in the codebase, proceed using canonical patterns from the Effect source and examples. Do not block on missing codebase patterns.
Apply these core principles when writing Effect code:
Schema.TaggedError for domain/API errors that cross serialization or HTTP boundariesData.TaggedError for internal, non-encoded errors when Schema integration is unnecessaryEffect.fail, Effect.catchTag, Effect.catchAll for error control flowContext.TagLayer.merge, Layer.provideEffect.provide to inject dependenciesEffect.succeed, Effect.fail, Effect.tryPromise, Effect.tryEffect.flatMap, Effect.map, Effect.tapSchema.Class for domain and API models that need construction, validation, encoding, or equalityEffect.gen for readable sequential codeEffect.fn() for automatic telemetry and better stack traces@effect/platform services such as FileSystem and Path are environment requirements. Keep them inside existing
service/runtime boundaries unless widening a function's environment is a deliberate design improvement.When providing solutions, explain the Effect-TS concepts being used and why they're appropriate for the specific use case. If encountering patterns not covered in the documentation, suggest improvements while maintaining consistency with existing codebase patterns (when they exist).
~/.effect/packages/effect/src/ — Core Effect modules and implementationnpx claudepluginhub paulrberg/agent-skillsProvides best practices and reference files for Effect-TS: typed errors, services/layers, Schema validation, fiber concurrency, Stream/Sink, and migration from Promises/fp-ts/neverthrow.
Provides expert guidance on Effect-TS patterns including services, layers, error handling, service composition, and refactoring code with 'effect' imports. Covers Effect + Next.js integration.
Guides Effect-TS v3 and v4 development with correct API tables, version detection, and links to primary docs for building, debugging, and reviewing Effect code.