effect-ts-layer-architect

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

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/sabiscore/swarmxq --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/swarmxq/tree/main/.ai/skills/effect-ts-layer-architect
Command: npx skills add https://github.com/sabiscore/swarmxq --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, and mistakes like floating Fibers or missing acquireRelease cleanup lead to resource leaks and untyped failures. ## Core Features & Use Cases - Service Design & Layer Wiring: Generates service interfaces, Tags, Live and Test layers, and composes them with Layer.provide and Layer.merge into an application layer. - Error Modeling & Migration: Defines tagged errors with Data.TaggedError, types error channels at layer boundaries, and converts Promise/async code to Effect using Effect.tryPromise and Effect.gen. - Concurrency & Audit: Implements Fiber supervision, bounded parallelism, racing, timeouts, and retries, and reviews existing Effect code against quality gates. - Use Case: Ask it to model a database service with Effect, and it produces a scoped Layer using acquireRelease for connection cleanup, a typed DatabaseError channel, a Test layer, and the app-level composition snippet. ## Quick Start Ask the assistant to model a database or HTTP client service with Effect-TS layers including error handling and a test layer.

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 with Layer.succeed.

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

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 to guarantee cleanup when the scope closes.

How do I convert async Promise 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 for sequential composition.

How do I run Effects in parallel with concurrency limits?

Use Effect.all with a concurrency option for bounded parallelism, Effect.fork with Fiber.join for background work, and Effect.race when the first completed result wins. Combine with Effect.timeout and Effect.retry for resilience.

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 at layer boundaries.

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

Layer discipline adds structural overhead that may not fit small scripts or prototypes without resource lifecycles or testability requirements. It pays off most in applications with multiple services, cleanup needs, and typed failure paths.