← ClaudeAtlas

effect-tslisted

ALWAYS-ON TypeScript implementation standard. Any time you (or a subagent) write, refactor, or review TypeScript (.ts/.tsx/.mts/.cts) you MUST consult this skill first and default to the Effect (https://effect.website) ecosystem for effects, errors, dependency injection, schema/validation, concurrency, and observability — instead of raw async/await, throw, try/catch, and hand-rolled DI. Use whenever the task involves TypeScript, Node/Deno/Bun services, an API layer, a use-case/service module, parsing/validating external input, or whenever the user says "TypeScript", "TS", "Effect", "typed errors", "schema", "service", or "dependency injection".
dustin-olenslager/claude-phalanx · ★ 1 · AI & Automation · score 77
Install: claude install-skill dustin-olenslager/claude-phalanx
# Effect-TS — the TypeScript implementation standard Source of truth: **https://effect.website** (Effect 3.x). Always-on: every TS edit goes through it. Enforced by `effect-ca-gate.js` + `ts-arch-anchor.sh` + CLAUDE.md §14. Pairs with **clean-architecture** (Effect is *how* you implement each CA layer in TS). Off: "stop effect" → `touch <CLAUDE_DIR>/.ts-arch-off`. ## Why (ELI5) Plain TS hides three things: what can go *wrong*, what a function *needs*, and whether it's *async*. `Effect<A, E, R>` makes all three explicit — a recipe that **succeeds with `A`**, **may fail with `E`**, **needs services `R`**, and does nothing until run. Compiler catches what async/await + throw let slip. ## The pass — before writing TS 1. **Trivial pure glue** (types, constants, one-line mappers, pure fns)? → plain TS, no Effect ceremony (YAGNI). Gate wants the skill *consulted*, not every line wrapped. 2. **Does it do I/O, can it fail, or need a dependency?** → model as `Effect`. 3. **Pick the CA layer:** domain = pure + Schema; use cases = `Effect` depending on port *tags*; adapters = `Layer`s; entrypoint = one run. ## Core idioms (exact names) **Create:** `Effect.succeed/fail`, `Effect.sync`, `Effect.try({try,catch})`, `Effect.promise`, `Effect.tryPromise({try,catch})` (replaces raw `await`). **Compose** — prefer `Effect.gen`: ```ts import { Effect } from "effect" const program = Effect.gen(function* () { const user = yield* getUser(id) return yield* listOrders(user.id) }) ```