atelier-typescript-effect-ts_skill

This skill helps you build robust TypeScript apps with Effect-TS by leveraging type-safe errors, dependency injection, and safe resource management.
  • JavaScript

4

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill martinffx/claude-code-atelier --skill atelier-typescript-effect-ts

  • SKILL.md9.3 KB

Overview

This skill introduces type-safe functional effects using Effect-TS to build robust TypeScript applications. It focuses on typed errors, dependency injection with Context.Tag and Layer, resource safety, and composable effect patterns. Use it to write predictable, testable, and maintainable async code with compile-time guarantees.

How this skill works

The skill inspects common Effect-TS patterns and provides practical guidance: creating and running Effect values, composing flows with Effect.gen and combinators, modeling typed failures, and wiring services with Layer and Context.Tag. It explains resource management with acquireRelease and Scope, data validation via Schema, and runtime strategies like retries, timeouts, and parallelism.

When to use it

  • Building async workflows that must preserve error types and avoid lost error information
  • Injecting and composing services with explicit, type-checked dependencies
  • Managing resources that require deterministic cleanup (DB connections, file handles, sockets)
  • Validating and decoding external data (HTTP payloads, DB rows) with schema-driven types
  • Coordinating retries, backoff, concurrency limits, and timeouts in a predictable way

Best practices

  • Prefer Effect.gen for readable, sequential effect code and Effect.flatMap for combinators
  • Model recoverable failures with typed error classes (use _tag for catchTag)
  • Declare services with Context.Tag and provide implementations via Layer for testability
  • Use Schema.decodeUnknown / decodeUnknownSync for external inputs and keep validation in the effect channel
  • Wrap resources with acquireRelease and use Scope or scoped effects to guarantee cleanup
  • Run effects at the application boundary (runPromise / runSync) to keep effects pure inside the app logic

Example use cases

  • Fetch and enrich data from multiple services sequentially using Effect.gen and typed network errors
  • Provide a Database service via Layer, run queries in effects, and replace with a mock layer in tests
  • Acquire a connection with acquireRelease, run transactions inside Scope, and ensure release on failure or interruption
  • Decode and validate incoming JSON with Schema.decodeUnknown, returning typed errors on failure
  • Retry flaky remote calls with Schedule.exponential and jitter, and apply a timeout guard

FAQ

Make the effect’s error type a union of error classes. Tag custom error classes (with a unique _tag) so you can handle specific cases via catchTag and broader cases via catchAll.

When should I use Layer vs passing dependencies directly?

Use Layer when you want explicit, composable dependency wiring and easy swapping in tests or different environments. Pass dependencies directly for tiny, local functions where creating a layer adds unnecessary indirection.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational