Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/PaulJPhilp/EffectPatternsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/pauljphilp/effectpatterns/implement-backpressure-in-pipelines)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/implement-backpressure-in-pipelines"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/implement-backpressure-in-pipelines/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/implement-backpressure-in-pipelines"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/implement-backpressure-in-pipelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00981 | $0.00981 |
| Opus 5.5 | $0.00392 | $0.00392 |
| Sonnet 5.5 | $0.00196 | $0.00196 |
| Haiku 4.5 | $0.00098 | $0.00098 |
Grade A, and why
implement-backpressure-in-pipelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Use buffering and throttling to handle producers faster than consumers. globs: "**/*.ts" alwaysApply: true
Implement Backpressure in Pipelines
Rule: Use buffering and throttling to handle producers faster than consumers.
Example
import { Effect, Stream, Schedule, Duration, Queue, Chunk } from "effect"
// ============================================
// 1. Stream with natural backpressure
// ============================================
// Streams have built-in backpressure - consumers pull data
const fastProducer = Stream.fromIterable(Array.from({ length: 1000 }, (_, i) => i))
const slowConsumer = fastProducer.pipe(
Stream.tap((n) =>
Effect.gen(function* () {
yield* Effect.sleep("10 millis") // Slow processing
yield* Effect.log(`Processed: ${n}`)
})
),
Stream.runDrain
)
// Producer automatically slows down to match consumer
// ============================================
// 2. Explicit buffer with drop strategy
// ============================================
const bufferedStream = (source: Stream.Stream<number>) =>
source.pipe(
// Buffer up to 100 items, drop oldest when full
Stream.buffer({ capacity: 100, strategy: "dropping" })
)
// ============================================
// 3. Throttling - limit rate
// ============================================
const throttledStream = (source: Stream.Stream<number>) =>
source.pipe(
// Process at most 10 items per second
Stream.throttle({
cost: () => 1,
units: 10,
duration: "1 second",
strategy: "enforce",
})
)
// ============================================
// 4. Debounce - wait for quiet period
// ============================================
const debouncedStream = (source: Stream.Stream<number>) =>
source.pipe(
// Wait 100ms of no new items before emitting
Stream.debounce("100 millis")
)
// ============================================
// 5. Bounded queue for producer-consumer
// ============================================
const boundedQueueExample = Effect.gen(function* () {
// Create bounded queue - blocks producer when full
const queue = yield* Queue.bounded<number>(10)
// Fast producer
const producer = Effect.gen(function* () {
for (let i = 0; i < 100; i++) {
yield* Queue.offer(queue, i)
yield* Effect.log(`Produced: ${i}`)
}
yield* Queue.shutdown(queue)
})
// Slow consumer
const consumer = Effect.gen(function* () {
let count = 0
while (true) {
const item = yield* Queue.take(queue).pipe(
Effect.catchTag("QueueShutdown", () => Effect.fail("done" as const))
)
if (item === "done") break
yield* Effect.sleep("50 millis") // Slow processing
yield* Effect.log(`Consumed: ${item}`)
count++
}
return count
}).pipe(Effect.catchAll(() => Effect.succeed(0)))
// Run both - producer will block when queue is full
yield* Effect.all([producer, consumer], { concurrency: 2 })
})
// ============================================
// 6. Sliding window - keep most recent
// ============================================
const slidingWindowStream = (source: Stream.Stream<number>) =>
source.pipe(
Stream.sliding(5), // Keep last 5 items
Stream.map((window) => ({
items: window,
average: Chunk.reduce(window, 0, (a, b) => a + b) / Chunk.size(window),
}))
)
// ============================================
// 7. Run example
// ============================================
const program = Effect.gen(function* () {
yield* Effect.log("=== Backpressure Demo ===")
// Throttled stream
const throttled = Stream.fromIterable([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).pipe(
Stream.tap((n) => Effect.log(`Emitting: ${n}`)),
Stream.throttle({
cost: () => 1,
units: 2,
duration: "1 second",
strategy: "enforce",
}),
Stream.tap((n) => Effect.log(`After throttle: ${n}`)),
Stream.runDrain
)
yield* throttled
})
Effect.runPromise(program)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 150 lines · 981 tokens per session scan A cfd93418aa7f
implement-backpressure-in-pipelines is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 5mo ago), licensed MIT. It adds 981 tokens to every session, about $0.0039 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
implement-backpressure-in-pipelines compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| implement-backpressure-in-pipelinesPaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 981 | Cursor |
| workflowWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| activitiesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| go-api-development-general-rulesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| backend-general-expertWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 349 | Cursor |
| service-class-conventionsWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 172 | Cursor |
| repository-class-conventionsWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 149 | Cursor |