Effect v4
The Bun and Node Effect targets share one Effect HTTP router and run on the exact
Effect v4 beta recorded in versions.json. Ground claims in the
checked-in implementation and pinned upstream source, not in remembered v3 APIs.
Authority order
- Treat the benchmark contract in
README.md and the compiling files under src/
as the local behavior source of truth.
- Verify package APIs against installed typings and
repos/effect at its pinned
release commit.
- Use
repos/effect/migration/ to translate v3 code. Use web documentation only
when the exact-beta source does not answer the question.
Keep repos/effect read-only. Never edit it or import runtime code from it.
Read next
- Read references/core-patterns.md for generators,
services, layers, typed errors, Promise boundaries, and high-value v3-to-v4
translations.
- Read references/http-server.md before changing the
router, requests, responses, Bun/Node adapters, server layers, or runtime launch.
- Read references/upgrade-workflow.md before
changing an Effect beta pin or advancing the source-oracle submodule.
Workflow
Read the affected benchmark source and its matching reference above.
Search the exact source oracle before using an unfamiliar or unstable API:
rg -n -- '<symbol>' repos/effect/packages
Preserve route parity between Bun and Node by changing shared behavior in
src/effect-router.ts; keep runtime-specific wiring in src/bun/effect.ts and
src/node/effect.ts.
Preserve the benchmark semantics in README.md, including dynamic path/query
extraction, JSON parse-and-serialize behavior, streamed file responses, shared
background routes, and disabled server logging.
Keep changes narrow. Do not add production-oriented middleware, tracing, or
abstractions that distort benchmark startup, memory, bundle size, or throughput.
Non-negotiables
- Pin
effect, @effect/platform-bun, and @effect/platform-node to the same exact
beta. Do not use ^, ~, or the floating beta dist-tag.
- Import v4 HTTP APIs from
effect/unstable/http; do not restore v3
@effect/platform/Http* imports.
- Use
Effect.gen with yield* for generator workflows and
Effect.fn("name")(function*() { ... }) when a named Effect-returning function is
useful.
- Define services with
Context.Service and explicit layers. V4 does not generate a
default layer.
- Model expected failures as typed tagged errors and recover with
Effect.catchTag/Effect.catchTags or Match, not manual _tag comparisons.
- Use
Effect.tryPromise({ try, catch }) for fallible Promise boundaries.
Verification
For source-or-skill edits, run the narrow relevant checks:
bun scripts/build-framework.ts bun/effect
bun scripts/build-framework.ts node/effect
Run bun run verify when router or server behavior changes; it exercises the shared
HTTP contract across the benchmark. After editing this skill, validate its frontmatter,
metadata, JSON, and relative links.
1---2name: effect-v43description: Write, review, benchmark, or upgrade Effect v4 beta code in this repository. Use for src/effect-router.ts, src/bun/effect.ts, src/node/effect.ts, effect/unstable/http, @effect/platform-bun, @effect/platform-node, core Effect/Layer/Context/Schema APIs, v3-to-v4 migrations, or Effect beta pin bumps. Verify unfamiliar APIs against the pinned repos/effect source oracle and keep all Effect packages on one exact beta.4---56# Effect v478The Bun and Node Effect targets share one Effect HTTP router and run on the exact9Effect v4 beta recorded in [versions.json](versions.json). Ground claims in the10checked-in implementation and pinned upstream source, not in remembered v3 APIs.1112## Authority order13141. Treat the benchmark contract in `README.md` and the compiling files under `src/`15 as the local behavior source of truth.162. Verify package APIs against installed typings and `repos/effect` at its pinned17 release commit.183. Use `repos/effect/migration/` to translate v3 code. Use web documentation only19 when the exact-beta source does not answer the question.2021Keep `repos/effect` read-only. Never edit it or import runtime code from it.2223## Read next2425- Read [references/core-patterns.md](references/core-patterns.md) for generators,26 services, layers, typed errors, Promise boundaries, and high-value v3-to-v427 translations.28- Read [references/http-server.md](references/http-server.md) before changing the29 router, requests, responses, Bun/Node adapters, server layers, or runtime launch.30- Read [references/upgrade-workflow.md](references/upgrade-workflow.md) before31 changing an Effect beta pin or advancing the source-oracle submodule.3233## Workflow34351. Read the affected benchmark source and its matching reference above.362. Search the exact source oracle before using an unfamiliar or unstable API:3738 ```sh39 rg -n -- '<symbol>' repos/effect/packages40 ```41423. Preserve route parity between Bun and Node by changing shared behavior in43 `src/effect-router.ts`; keep runtime-specific wiring in `src/bun/effect.ts` and44 `src/node/effect.ts`.454. Preserve the benchmark semantics in `README.md`, including dynamic path/query46 extraction, JSON parse-and-serialize behavior, streamed file responses, shared47 background routes, and disabled server logging.485. Keep changes narrow. Do not add production-oriented middleware, tracing, or49 abstractions that distort benchmark startup, memory, bundle size, or throughput.5051## Non-negotiables5253- Pin `effect`, `@effect/platform-bun`, and `@effect/platform-node` to the same exact54 beta. Do not use `^`, `~`, or the floating `beta` dist-tag.55- Import v4 HTTP APIs from `effect/unstable/http`; do not restore v356 `@effect/platform/Http*` imports.57- Use `Effect.gen` with `yield*` for generator workflows and58 `Effect.fn("name")(function*() { ... })` when a named Effect-returning function is59 useful.60- Define services with `Context.Service` and explicit layers. V4 does not generate a61 default layer.62- Model expected failures as typed tagged errors and recover with63 `Effect.catchTag`/`Effect.catchTags` or `Match`, not manual `_tag` comparisons.64- Use `Effect.tryPromise({ try, catch })` for fallible Promise boundaries.6566## Verification6768For source-or-skill edits, run the narrow relevant checks:6970```sh71bun scripts/build-framework.ts bun/effect72bun scripts/build-framework.ts node/effect73```7475Run `bun run verify` when router or server behavior changes; it exercises the shared76HTTP contract across the benchmark. After editing this skill, validate its frontmatter,77metadata, JSON, and relative links.