/odin-typescript:nodejs-stream-pipelinefrom ODIN TypeScript
Builds Node.js stream ETL pipelines for large-file or continuous ingestion using `stream.promises.pipeline()` with async-generator transforms, backpressure coordination, and optional caching for expensive lookups, avoiding heap memory overflow.
Ships in ODIN TypeScript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | Large-file or continuous stream ETL, CSV processing, ingestion, backpressure, repeated-lookup enrichment, deduplication of concurrent async calls. |
| Authority | Reversible local: writes only pipeline and transform code in the local working tree; rollback is version control. No remote mutation. |
| Side effect | Writes pipeline and transform code to the local tree and may execute it on real data. |
| Done | The pipeline uses stream.promises.pipeline() with at least one typed async-generator transform, backpressure coordinated solely through pipeline(), caching applied only when the transform performs remote or expensive lookups, and a benchmark or test run demonstrates bounded memory. |
Validate that the source and destination are stream-compatible. Reject buffered-into-memory patterns for inputs larger than available heap. For files, use fs.createReadStream; for HTTP, use the response body as a Readable. Confirm the destination is a writable stream or a file path that fs.createWriteStream accepts. Done when: source and destination are confirmed stream-compatible or rejected with a reason.
Implement transforms as async generators, relying solely on pipeline() for backpressure coordination. Implement at least one typed async-generator transform function. The generator yields typed records. In Node 24, an async generator passed to stream.pipeline() as a source or transform automatically respects the internal high-water-mark backpressure signal: when the downstream writable's buffer exceeds its high-water mark, the generator's yield awaits the consumer's readiness before producing the next chunk. Do not implement manual backpressure coordination; pipeline() wires it. Name the backpressure mechanism in a code comment: which stage applies backpressure and how pipeline() propagates it. Done when: at least one typed async-generator transform is implemented with a comment naming the backpressure mechanism, and no manual backpressure code is present.
Apply promise-coalesced caching only if the transform performs remote or expensive lookups. If the transform performs remote or expensive lookups, choose and justify a cache strategy: size-bound Map with manual eviction, TTL Map with expiry-on-read, LRU via Map insertion-order re-insertion, or the lru-cache package for production workloads needing TTL plus size bounds plus O(1) eviction. Document the choice inline with a one-line rationale. Coalesce concurrent async calls for the same key using a Map<string, Promise> so multiple chunks requesting the same enrichment key share one in-flight request. If the transform does not perform remote or expensive lookups, skip caching entirely; do not add a cache that serves no purpose. Done when: caching is applied with a justified strategy and concurrent-call coalescing, or explicitly skipped because no expensive lookup exists.
Compose the pipeline using stream.promises.pipeline(). Compose the full pipeline with pipeline() from node:stream/promises:
import { pipeline } from 'node:stream/promises';
import { createReadStream, createWriteStream } from 'node:fs';
await pipeline(
createReadStream(source),
parseTransform(), // async generator or Transform
enrichTransform(cache),
serializeTransform(),
createWriteStream(dest),
);
Do not use .pipe(): it does not propagate errors or backpressure reliably across the full chain. pipeline() destroys all streams on first error, so no partial output reaches the destination. Done when: the pipeline is composed with pipeline() and no .pipe() calls remain.
Execute a benchmark or test run to prove bounded memory and measure throughput. Run the pipeline on realistic input or a benchmark fixture. Measure throughput (records per second) and peak RSS to confirm bounded memory. Done when: throughput and peak RSS are measured and memory is confirmed bounded.
pipeline() rejects with the source error. All streams are destroyed; no partial output is written because pipeline() destroys the chain on first error. Report the source error.pipeline() destroys the chain. The destination receives only chunks written before the error. Report the failing record index and error.pipeline() rejects and destroys all streams. Report the write error.Pipeline source file with typed async-generator transforms, backpressure comments, conditional justified caching, and concurrent-call coalescing, plus a benchmark or test run showing bounded memory and measured throughput.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-typescript15 skills in this plugin
/eslint-to-biome-migrationUse when migrating a JavaScript or TypeScript project from ESLint, Prettier, Standard, or mixed legacy lint configuration to Biome 2.5./fastify-inject-testingUse when asked to test Fastify applications without network sockets. Not for building the app: use fastify-schema-first-service./fastify-production-hardeningUse when asked to prepare a Fastify service for production load and exposure. Not for building the app: use fastify-schema-first-service./fastify-schema-first-serviceUse when building or extending a Fastify application: routes, plugins, hooks, database wiring. Not for testing: use fastify-inject-testing. Not for hardening: use fastify-production-hardening./multi-tenant-architectureUse when a request concerns multi-tenant scaffolding, tenant isolation, domain wiring, or SaaS architecture on Cloudflare or Vercel. Not for single-tenant apps: use scaffold-nextjs./node-internals-diagnosisUse when Node.js segfaults, addon crashes, leaks, event-loop anomalies, thread-pool saturation, V8 deoptimizations, or binding.gyp failures need diagnosis. Not for code edits or service restarts.Other plugins' skills for the same job