effect-ts-layer-architect

Generates and audits Effect-TS code using Layer discipline, Fiber supervision, and typed error channels.

1|Updated Sep 3, 2026
One-click install
npx skills add https://github.com/sabiscore/the-yap-engine --skill effect-ts-layer-architect-sabiscore
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: effect-ts-layer-architect
Source: https://github.com/sabiscore/the-yap-engine/tree/main/.ai/skills/effect-ts-layer-architect
Command: npx skills add https://github.com/sabiscore/the-yap-engine --skill effect-ts-layer-architect-sabiscore

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect.

What problem does it solve? Writing correct Effect-TS code requires deep knowledge of Layer constructors, service lifecycles, structured concurrency, and typed error channels. This Skill ensures every service you design or audit follows proper Layer discipline, uses acquireRelease for resource cleanup, and avoids common mistakes like floating Fibers or untyped errors. ## Core Features & Use Cases - Service Design & Layer Wiring: Generates complete service definitions with Tags, Live layers, Test layers, and composition snippets using Layer.succeed, Layer.effect, Layer.scoped, Layer.provide, and Layer.merge. - Migration & Error Modeling: Converts Promise/async code to Effect using Effect.tryPromise and Effect.gen, and models typed error channels with Data.TaggedError, Effect.catchTag, and Effect.orElse. - Concurrency & Auditing: Implements Fiber supervision, bounded parallelism with Effect.all, racing, timeouts, and retries, and reviews existing Effect code against quality gates. - Use Case: You need to model a database service in TypeScript with connection cleanup and testability. The Skill produces a DatabaseLive layer using Layer.scoped with Effect.acquireRelease, a DatabaseTest layer using Layer.succeed, and the app-level composition with Effect.provide. ## Quick Start Ask the AI to model a database service with Effect-TS layers including a test layer and proper error typing.

Frequently Asked Questions about effect-ts-layer-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a service with Effect-TS layers?▼

Define the service interface, create a Tag with Context.GenericTag, then implement a Live layer using Layer.succeed for stateless services, Layer.effect for setup without cleanup, or Layer.scoped when the resource needs acquireRelease cleanup. Always add a Test layer with Layer.succeed.

What is the difference between Layer.effect and Layer.scoped in Effect?▼

Layer.effect builds a service that requires setup but has no cleanup logic, while Layer.scoped is for services holding resources that must be released, such as database connections. Layer.scoped pairs with Effect.acquireRelease to guarantee cleanup runs when the Scope closes.

How do I convert async Promise code to Effect-TS?▼

Wrap fallible async calls with Effect.tryPromise and infallible ones with Effect.promise, use Effect.try or Effect.sync for synchronous code, and replace async/await chains with Effect.gen. Map thrown errors into typed error classes with Effect.mapError.

How do I run two Effects in parallel with Effect-TS?▼

Use Effect.all with a concurrency option for bounded parallelism, Effect.race when the first result wins, and Effect.fork with Fiber.join for background work. Add Effect.timeout and Effect.retry for resilience, and ensure every forked Fiber is joined or supervised.

How do I test Effect-TS services without real dependencies?▼

Provide a Test layer built with Layer.succeed that returns canned values for the same service Tag, then swap it in via Effect.provide at the test boundary. This keeps the production Live layer untouched while tests run against deterministic implementations.

What are common mistakes when writing Effect-TS layers?▼

Common mistakes include floating Fibers without join or supervision, calling Effect.runSync inside async contexts, accidental never error channels, and skipping acquireRelease for resources with close or disconnect methods. The audit mode checks code against these quality gates.