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
Write idiomatic Effect code instead of promise-shaped TypeScript with Effect wrappers pasted on top.
package.json, tsconfig*, lockfile, existing effect / @effect/* imports, and nearby tests.effect-solutions is installed, run effect-solutions list and effect-solutions show <topic>... before freehanding a pattern.effect-solutions show project-setup tsconfig for bootstrap work.effect-solutions show basics services-and-layers data-modeling error-handling config testing for core application code.effect-solutions show http-clients cli use-pattern for ecosystem and integration work.effect.website/docs for deeper API detail, exhaustive module surfaces, and topics not yet covered here.Effect.gen for inline programs and Effect.fn("Name") for reusable named effectful functions.Effect.run* at app edges, tests, workers, or framework adapters.Schema, then pass typed values inward.@effect/vitest over ad hoc mocks.const loadUser = Effect.fn("loadUser")(function* (id: UserId) {
const repo = yield* UserRepo
return yield* repo.get(id)
})
const program = Effect.gen(function* () {
const input = yield* Schema.decodeUnknown(UserInput)(payload)
return yield* loadUser(input.id)
})effect-solutions for opinionated patterns and tradeoffs.effect.website for the canonical API surface.class UserRepo extends Context.Tag("UserRepo")<
UserRepo,
{ readonly get: (id: UserId) => Effect.Effect<User, UserNotFound> }
>() {}
const UserRepoLive = Layer.succeed(UserRepo, {
get: (id) => Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient
const rows = yield* sql`SELECT * FROM users WHERE id = ${id}`
if (rows.length === 0) return yield* new UserNotFound({ id })
return rows[0] as User
}),
})Promise values from service methods unless the boundary forces it.Effect.runPromise deep inside domain code.