martinffx/claude-code-atelier
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.
19 skills
This skill helps you build robust TypeScript apps with Effect-TS by leveraging type-safe errors, dependency injection, and safe resource management.
This skill helps you design and query SQL with Drizzle ORM in TypeScript, enabling type-safe schemas, relations, migrations, and multi-database support.
This skill helps you uncover product requirements and define scope using discovery interviews and clear MVP criteria to guide development.
This skill explains and applies a 3-layer context model, living specifications, and beads for coordinated, spec-driven development across agents.
This skill helps you design consistent REST APIs with versioning, error handling, and pagination patterns for maintainable endpoints.
This skill helps you implement robust Python database access with SQLAlchemy ORM patterns, including models, sessions, queries, upserts, and JSON columns.
This skill helps you model state machines and domain logic with TypeScript-safe patterns, improving reliability and maintainability through ADTs,
This skill guides stub-driven TDD and layer boundary testing for functional core and edge, helping you write tests before implementing.
This skill helps design features using domain-driven design and hexagonal architecture, aligning functional core and edge components for clear responsibilities.
This skill helps you design and manage durable Python Temporal workflows, activities, and retries with practice-ready patterns.
This skill helps you implement stub-driven TDD and layer boundary tests for Python applications using pytest.
This skill helps you design and query DynamoDB single-table schemas with dynamodb-toolbox v2 in TypeScript, boosting type safety and performance.
This skill helps you set up and manage a Python monorepo with uv workspaces, ensuring consistent dependencies and cross-package collaboration.
This skill helps you apply modern Python features like typing, pattern matching, and async/await to write clear, maintainable code.
This skill configures and optimizes TypeScript projects using Bun, tsgo, Vitest, Biome, and Turborepo for builds, tests, linting, and monorepo orchestration.
This skill helps you challenge assumptions and validate decisions using structured critical thinking prompts to ensure robust, context-aware solutions.
This skill helps you set up Python projects with uv, mise, ruff, basedpyright, and pytest for faster builds, type checking, and testing.
This skill helps you model complex domain logic with TypeScript using discriminated unions, Result/Option, and branded types for safer code.
This skill helps you challenge assumptions and validate decisions using a structured critical thinking framework to prevent automatic agreement.