Implement, debug, refactor, migrate, review, or explain Effect TypeScript code. Use when a task touches `effect` or `@effect/*` APIs, especially services, layers, schemas, runtime wiring, platform or CLI packages, Effect testing, or Promise-to-Effect migration.
98
100%
Does it follow best practices?
Impact
93%
1.16xAverage score across 3 eval scenarios
Passed
No known issues
Use this file when writing or reviewing ordinary Effect application code: sequencing, services, layers, schemas, errors, config, and tests.
effect-solutions topics: basics, services-and-layers, data-modeling, error-handling, config, testingEffect.gen for inline effect programs.Effect.fn("Name") for reusable named effectful functions. This gives call-site tracing and is the default for service methods..pipe(...) for cross-cutting behavior such as Effect.timeout, Effect.retry, Effect.tap, and Effect.withSpanDefault split:
Effect.genEffect.fnModel dependencies explicitly.
Context.Tag when you want a stable contract plus multiple implementations.@app/Users or @app/EmailServicereadonlyImplementation defaults:
Layer.succeed for simple constants or test doubles.Layer.sync for synchronous setup.Layer.effect for effectful setup that depends on other services.Testing defaults:
testLayer when that improves reuse and readability.Treat Schema as the default boundary and domain-modeling tool.
Schema.Class for records with behavior.Schema.TaggedClass plus Schema.Union for structured variants.Schema.parseJson when the input is a JSON string boundary.Good fits for brands:
Recoverable failures should usually be tagged, typed, and serializable.
Schema.TaggedError for domain and boundary errors.Effect.catchTag or Effect.catchTags for narrow recovery.Review smell:
Effect.Effect<A, string> or unknown in stable domain services is often too weak.Error usually throws away useful structure.Use Config at the edge and expose validated config through a service layer.
Config.redacted for secrets.Context.Tag config service with layer and, when useful, testLayerConfigProvider.fromMap or another explicit provider in tests.Prefer @effect/vitest for Effect code.
it.effect for effect-returning tests.it.scoped for scoped resources.TestClock and TestRandom when time or randomness matters.Effect.runPromise in the middle of application logic.Promise from service methods when a plain Effect can cross the boundary instead.unknown error channels where a tagged union is feasible.