effect-best-practices
Installation
Summary
Opinionated patterns for Effect-TS services, errors, layers, and React state management.
- Enforces
Effect.Servicewithaccessors: truefor business logic,Schema.TaggedErrorfor errors, andLayer.mergeAll/Layer.provideMergefor flat, performant composition - Requires Effect Language Server for edit-time diagnostics (30+ Effect-specific checks), quick info, completions, and refactors
- Covers branded entity IDs,
Optionover nullability,Effect.fnfor tracing, and explicit error handling withcatchTag/catchTags - Includes Effect Atom patterns for React state:
Atom.makeoutside components,useAtomValue/useAtomSethooks,Result.builderfor error handling, andkeepAlivefor persistent state - Forbids
runSync/runPromisein services,throwin generators,console.log, and directprocess.envaccess
SKILL.md
Effect-TS Best Practices
This skill enforces opinionated, consistent patterns for Effect-TS codebases. These patterns optimize for type safety, testability, observability, and maintainability.
Effect Language Server (Required)
The Effect Language Server is essential for Effect development. It catches errors at edit-time that TypeScript alone cannot detect, provides Effect-specific refactors, and improves developer productivity.
Setup
- Install:
npm install @effect/language-service --save-dev
- Add to
tsconfig.json:
{
"compilerOptions": {
Related skills