effect-ts-resources
Installation
SKILL.md
Effect-TS Resource Management
Overview
Manage resource lifecycles using Scope and acquireRelease to guarantee cleanup. Cleanup always runs, even if the program fails, throws, or is interrupted.
When to Use
- Symptoms: Resource leaks (hanging connections), manual
try/finallyblocks, complex cleanup logic. - Triggers: Opening files, connecting to databases, starting servers, acquiring locks.
- When NOT to use: For simple data transformations or values that don't require explicit closing/release.
Core Pattern
Manual try/finally is error-prone in Effect because it bypasses interruption handling.
| Anti-Pattern (Manual) | Effect Pattern (Safe) |
|---|---|
try { conn.open() } finally { conn.close() } |
Effect.acquireRelease(open, close) |
Related skills
More from mrevanzak/effect-ts-skills
effect-ts-fundamentals
Use when implementing type-safe, composable, and testable applications using Effect-TS, specifically for service definition, dependency injection, and sequential async logic.
63effect-ts-concurrency
Use when performing parallel operations, rate limiting, or signaling between fibers in Effect-TS.
62effect-ts-errors
Use when implementing error handling, validation logic, or custom error types in Effect-TS.
61effect-ts-anti-patterns
Use when reviewing Effect-TS code, debugging unexpected crashes, or optimizing concurrent operations.
61