effect-ts-patterns

Enforce Effect-TS coding patterns in TypeScript services and layers.

21|4|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/tylerjrbuell/reactive-agents-ts --skill effect-ts-patterns-tylerjrbuell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ts-patterns
Source: https://github.com/tylerjrbuell/reactive-agents-ts/tree/main/.agents/skills/effect-ts-patterns
Command: npx skills add https://github.com/tylerjrbuell/reactive-agents-ts --skill effect-ts-patterns-tylerjrbuell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a single authoritative set of mandatory coding patterns to prevent inconsistent types, unsafe error handling, and fragile service wiring across the Reactive Agents TypeScript codebase, ensuring compile-time safety and predictable runtime behavior.

Core Features & Use Cases

  • Type Safety Enforcement: Mandates Schema.Struct and branded IDs to produce consistent runtime-validated types and derived TypeScript types.
  • Error and Service Patterns: Requires Data.TaggedError for structured errors and Context.Tag + Layer.effect for service implementations to enable composable, testable layers.
  • Resource and Concurrency Rules: Prescribes Layer.scoped with acquireRelease, Ref for mutable state, and Effect.sync/tryPromise usage to standardize resource cleanup and async error mapping.
  • Use Case: Use during development, code review, and CI to validate new packages, implement services, and ensure all packages export a createXxxLayer factory and index re-exports.

Quick Start

Use the effect-ts-patterns skill to validate a new TypeScript service against the repository's Effect-TS coding patterns before committing.

Frequently Asked Questions about effect-ts-patterns

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

FAQPage Schema
How do I enforce consistent Effect-TS patterns for type-safe services?

Enforcing consistent Effect-TS patterns requires mandating Schema.Struct for types, Data.TaggedError for errors, and Context.Tag with Layer.effect for services to ensure compile-time safety and predictable runtime behavior across a TypeScript codebase.

What is the best way to handle errors in Effect-TS services?

The best way to handle errors in Effect-TS is using Data.TaggedError to create structured, typed errors. This pattern enables composable error handling and testable layers throughout the service implementation.

How do I standardize resource cleanup in Effect-TS?

Standardizing resource cleanup in Effect-TS requires using Layer.scoped combined with acquireRelease. This pattern ensures predictable resource teardown and standardizes async error mapping during cleanup operations.

How do I manage mutable state in an Effect-TS layer?

Managing mutable state in an Effect-TS layer requires using Ref. This pattern standardizes state management alongside Effect.sync and tryPromise conventions to ensure safe async error mapping and predictable runtime behavior.

Does my Effect-TS package need to export a specific layer factory?

Yes, Effect-TS packages must export a createXxxLayer factory and index re-exports. This mandatory pattern ensures consistent service wiring, composable layers, and validates package structure during code review or CI validation.

When do I need Schema.Struct in Effect-TS type definitions?

You need Schema.Struct in Effect-TS type definitions whenever authoring types to produce consistent runtime-validated types and derived TypeScript types. Combined with branded IDs, it enforces type safety and prevents inconsistent data structures.