writing-effect
Writing Effect
Effect-TS coding guide for this monorepo. Authoritative source: clone Effect v4 source into .repos/effect-v4/ by running pnpm setup:repos (or bash scripts/setup-repos.sh) — matches the convention Effect itself uses (see effect-ts/effect-smol/scripts/worktree-setup.sh and that repo's AGENTS.md, which explicitly points agents at .repos/effect-v4). .repos/ is gitignored, so it stays out of PRs and never appears in pkg.pr.new tarballs.
When you need to verify an API, grep .repos/effect-v4/packages/effect/src/ and .repos/effect-v4/packages/platform-node/src/ directly — docs lag the beta, source doesn't. The cloned repo's own AGENTS.md and LLMS.md are worth a skim. The web docs at https://effect.website/llms-full.txt are useful too but may be v3-flavored in places.
If .repos/effect-v4/ is missing, run pnpm setup:repos and try again. To refresh to upstream main, re-run the same command — it fast-forwards in place. Rules for the cloned repo: read-only, don't import from it in our source (use the effect@beta / @effect/platform-node@beta npm packages instead, both pinned in the workspace catalog).
Version
This monorepo targets Effect v4 beta (pinned in pnpm-workspace.yaml catalog). v4 consolidates many former sub-packages into core effect:
Schemalives ineffect(not@effect/schema). Import:import { Schema } from 'effect'.Stream,Sink,Channel,FileSystem,Path,Terminal,Stdio,Schedule,Pool,Semaphore,Cron,DateTime,Match— all in coreeffect.- CLI:
effect/unstable/cli(unstable). - Child process:
effect/unstable/process+ Node binding via@effect/platform-node'sNodeChildProcessSpawner(stable). - HTTP / HttpApi / RPC:
effect/unstable/http,effect/unstable/httpapi,effect/unstable/rpc. - Vitest:
@effect/vitest. The v4 API differs from v3: useit.effect(it already includes aScope— no separateit.scoped). The package re-exports all of vitest, so importdescribe,expect,itfrom@effect/vitest. Noassertexport — useexpect. Never useEffect.runSyncinsideit.