effect-stream

Build pull-based streaming pipelines with Effect Stream, Sink, and Channel in TypeScript.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-stream-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-stream
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-stream
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-stream-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect, @effect/platform-node.

What problem does it solve? Handling values produced over time—paginated APIs, event listeners, file I/O, and socket data—requires backpressure-aware streaming rather than one-shot effects, and getting concurrency, encoding, and resource cleanup right in Effect v4 is error-prone without guidance. ## Core Features & Use Cases - Stream Creation & Transformation: Construct streams from iterables, effects, paginated APIs, async iterables, DOM events, callbacks, and Node.js readable streams, then map, filter, scan, group, debounce, and throttle them. - Encoding & Decoding: Pipe streams through NDJSON and Msgpack codec channels with optional Schema validation, including safe multi-byte UTF-8 text decoding. - Concurrency, Errors & Resource Safety: Merge, broadcast, and zip streams concurrently, retry with schedules, recover with catchTag, and guarantee cleanup via Stream.scoped and Effect.acquireRelease. - Use Case: Consume a paginated jobs API with Stream.paginate, enrich each item with mapEffect at concurrency 8, filter invalid records, batch with grouped(50), and write each batch to storage. ## Quick Start Ask the AI to build an Effect Stream pipeline that fetches all pages from a paginated API, transforms the results concurrently, and decodes an NDJSON response with schema validation.

Frequently Asked Questions about effect-stream

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I consume a paginated API with Effect Stream?

Use Stream.paginate with an initial cursor and an effectful function returning the current page plus Option.some(nextCursor) or Option.none() to stop. Combine it with mapEffect for concurrent enrichment and runForEach or runCollect to consume results.

How to decode NDJSON streams in Effect TypeScript?

Pipe the stream through Ndjson.decodeString() or Ndjson.decodeSchemaString(MySchema)() using Stream.pipeThroughChannel. For binary Uint8Array sources use Ndjson.decode(), and catch NdjsonError with Stream.catchTag to handle malformed lines.

Does Effect Stream support Node.js readable streams?

Yes, use NodeStream.fromReadable from @effect/platform-node with an evaluate function and an onError mapper. The closeOnDone option defaults to true, closing the underlying Node stream when consumption finishes.

What is the difference between Stream.broadcast and broadcastN?

Stream.broadcast starts the producer immediately, so late subscribers miss earlier values unless replay is configured. Stream.broadcastN waits until all n downstream streams subscribe before starting, guaranteeing every consumer sees the full sequence.

Why does Stream.retry not resume where the stream failed?

Stream.retry restarts the entire stream from the beginning on each retry rather than resuming mid-stream. Combine it with Schedule.exponential and Schedule.take to bound attempts with backoff.

How do I ensure resource cleanup in an Effect Stream?

Wrap acquisition in Effect.acquireRelease inside Stream.scoped or Stream.callback so finalizers run when the stream completes. Since beta.69, Stream.scoped also extends its scope to pull effects created by fromEffect and mapEffect.