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.4metadata:5 source: https://skillmd.com/skills/saltyaom/effect-v46---78# Effect v4910The Bun and Node Effect targets share one Effect HTTP router and run on the exact11Effect v4 beta recorded in [versions.json](versions.json). Ground claims in the12checked-in implementation and pinned upstream source, not in remembered v3 APIs.1314## Authority order15161. Treat the benchmark contract in `README.md` and the compiling files under `src/`17 as the local behavior source of truth.182. Verify package APIs against installed typings and `repos/effect` at its pinned19 release commit.203. Use `repos/effect/migration/` to translate v3 code. Use web documentation only21 when the exact-beta source does not answer the question.2223Keep `repos/effect` read-only. Never edit it or import runtime code from it.2425## Read next2627- Read [references/core-patterns.md](references/core-patterns.md) for generators,28 services, layers, typed errors, Promise boundaries, and high-value v3-to-v429 translations.30- Read [references/http-server.md](references/http-server.md) before changing the31 router, requests, responses, Bun/Node adapters, server layers, or runtime launch.32- Read [references/upgrade-workflow.md](references/upgrade-workflow.md) before33 changing an Effect beta pin or advancing the source-oracle submodule.3435## Workflow36371. Read the affected benchmark source and its matching reference above.382. Search the exact source oracle before using an unfamiliar or unstable API:3940 ```sh41 rg -n -- '<symbol>' repos/effect/packages42 ```43443. Preserve route parity between Bun and Node by changing shared behavior in45 `src/effect-router.ts`; keep runtime-specific wiring in `src/bun/effect.ts` and46 `src/node/effect.ts`.474. Preserve the benchmark semantics in `README.md`, including dynamic path/query48 extraction, JSON parse-and-serialize behavior, streamed file responses, shared49 background routes, and disabled server logging.505. Keep changes narrow. Do not add production-oriented middleware, tracing, or51 abstractions that distort benchmark startup, memory, bundle size, or throughput.5253## Non-negotiables5455- Pin `effect`, `@effect/platform-bun`, and `@effect/platform-node` to the same exact56 beta. Do not use `^`, `~`, or the floating `beta` dist-tag.57- Import v4 HTTP APIs from `effect/unstable/http`; do not restore v358 `@effect/platform/Http*` imports.59- Use `Effect.gen` with `yield*` for generator workflows and60 `Effect.fn("name")(function*() { ... })` when a named Effect-returning function is61 useful.62- Define services with `Context.Service` and explicit layers. V4 does not generate a63 default layer.64- Model expected failures as typed tagged errors and recover with65 `Effect.catchTag`/`Effect.catchTags` or `Match`, not manual `_tag` comparisons.66- Use `Effect.tryPromise({ try, catch })` for fallible Promise boundaries.6768## Verification6970For source-or-skill edits, run the narrow relevant checks:7172```sh73bun scripts/build-framework.ts bun/effect74bun scripts/build-framework.ts node/effect75```7677Run `bun run verify` when router or server behavior changes; it exercises the shared78HTTP contract across the benchmark. After editing this skill, validate its frontmatter,79metadata, JSON, and relative links.