effect-ts-layer-architect

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

1|Updated May 4, 2026
One-click install
npx skills add https://github.com/Scardubu/SwarmXQ --skill effect-ts-layer-architect-scardubu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ts-layer-architect
Source: https://github.com/Scardubu/SwarmXQ/tree/main/.ai/skills/effect-ts-layer-architect
Command: npx skills add https://github.com/Scardubu/SwarmXQ --skill effect-ts-layer-architect-scardubu

SYSTEM DOCUMENTATION & REQUIREMENTS

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 removes the guesswork by generating idiomatic, strict-mode TypeScript that follows proper Layer discipline instead of ad-hoc patterns. ## Core Features & Use Cases - Service Design & Layer Wiring: Defines service interfaces, Tags, Live/Test layers, and composes them with Layer.provide and Layer.merge into an application layer. - Error Modeling & Migration: Builds tagged error classes with Data.TaggedError and converts Promise/async code into Effect.tryPromise and Effect.gen pipelines. - Concurrency & Auditing: Implements Fiber supervision, bounded parallelism, racing, timeouts, and retries, and reviews existing Effect code against quality gates. - Use Case: A developer needs to model a database service with connection cleanup. The Skill produces a Layer.scoped implementation using acquireRelease, a matching Test layer, and the composition snippet for the app entry point. ## Quick Start Ask the assistant to model a database service with Effect-TS layers including a test layer and typed error channel.

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, Layer.effect, or Layer.scoped depending on setup and cleanup needs. Always pair it with a Test layer built from Layer.succeed for mocking.

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

Layer.effect builds a service that needs setup but no cleanup, while Layer.scoped is for services holding resources that must be released, using Effect.acquireRelease. Use Layer.scoped for connections, clients, or anything with a close or disconnect method.

How do I convert async/await code to Effect-TS?

Wrap fallible async calls with Effect.tryPromise, non-failing async with Effect.promise, and synchronous code with Effect.try or Effect.sync. Replace async/await chains with Effect.gen to compose the steps with typed errors.

How do I run Effects in parallel with concurrency limits?

Use Effect.all with a concurrency option, such as Effect.all([...], { concurrency: N }), for bounded parallelism. For background work use Effect.fork with Fiber.join, and Effect.race when the first completed result wins.

How do I type errors in Effect-TS services?

Define tagged error classes with Data.TaggedError and declare them in each Effect's error channel. Handle them with Effect.catchTag, Effect.catchAll, or Effect.orElse so no service accidentally exposes a never error type.

When should I not use Effect-TS layers for a service?

Stateless services with no setup can use plain Layer.succeed without scoped lifecycle machinery. The full Layer discipline adds the most value when services have dependencies, resource lifecycles, or error channels that callers must handle explicitly.