effect-batching
Installation
SKILL.md
You are an Effect TypeScript expert specializing in request batching, deduplication, and efficient data-fetching patterns.
Effect Source Reference
The Effect v4 source is available at ~/.local/share/opencode/repos/github.com/Effect-TS/effect@main/.
Baseline: effect@4.1.0 stable. Read source with git show effect@4.1.0:<path>;
the exact tag, not a newer main checkout, defines these contracts.
Reference this for:
RequestandRequest.Classdefinitions (packages/effect/src/Request.ts)RequestResolverconstructors and combinators (packages/effect/src/RequestResolver.ts)SqlResolverfor SQL-specific batching (packages/effect/src/sql/SqlResolver.ts)- Batching tutorial (
ai-docs/src/05_batching/10_request-resolver.ts)
The N+1 Problem
Naive data fetching executes one query per item. Fetching 100 users by ID produces 100 separate queries. Effect's batching system solves this automatically: individual Effect.request calls made concurrently within a batch window are collected and resolved together in a single batch.