effect-tslisted
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)
})
```