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/automatically-retry-failed-operations)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/automatically-retry-failed-operations"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/automatically-retry-failed-operations/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/automatically-retry-failed-operations"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/automatically-retry-failed-operations.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.00949 | $0.00949 |
| Opus 5.5 | $0.00380 | $0.00380 |
| Sonnet 5.5 | $0.00190 | $0.00190 |
| Haiku 4.5 | $0.00095 | $0.00095 |
Grade A, and why
automatically-retry-failed-operations 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 3mo 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 — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Compose a Stream with the .retry(Schedule) operator to automatically recover from transient failures. globs: "**/*.ts" alwaysApply: true
Automatically Retry Failed Operations
Rule: Compose a Stream with the .retry(Schedule) operator to automatically recover from transient failures.
Example
This example simulates an API that fails the first two times it's called. The stream processes a list of IDs, and the retry operator ensures that the failing operation for id: 2 is automatically retried until it succeeds.
import { Effect, Stream, Schedule } from "effect";
// A mock function that simulates a flaky API call
const processItem = (id: number): Effect.Effect<string, Error> =>
Effect.gen(function* () {
yield* Effect.log(`Attempting to process item ${id}...`);
// Item 2 fails on first attempt but succeeds on retry
if (id === 2) {
const random = Math.random();
if (random < 0.5) {
// 50% chance of failure for demonstration
yield* Effect.log(`Item ${id} failed, will retry...`);
return yield* Effect.fail(new Error("API is temporarily down"));
}
}
yield* Effect.log(`✅ Successfully processed item ${id}`);
return `Processed item ${id}`;
});
const ids = [1, 2, 3];
// Define a retry policy: 3 attempts with a fixed 100ms delay
const retryPolicy = Schedule.recurs(3).pipe(
Schedule.addDelay(() => "100 millis")
);
const program = Effect.gen(function* () {
yield* Effect.log("=== Stream Retry on Failure Demo ===");
yield* Effect.log(
"Processing items with retry policy (3 attempts, 100ms delay)"
);
// Process each item individually with retry
const results = yield* Effect.forEach(
ids,
(id) =>
processItem(id).pipe(
Effect.retry(retryPolicy),
Effect.catchAll((error) =>
Effect.gen(function* () {
yield* Effect.log(
`❌ Item ${id} failed after all retries: ${error.message}`
);
return `Failed: item ${id}`;
})
)
),
{ concurrency: 1 }
);
yield* Effect.log("=== Results ===");
for (let index = 0; index < results.length; index++) {
yield* Effect.log(`Item ${ids[index]}: ${results[index]}`);
}
yield* Effect.log("✅ Stream processing completed");
});
Effect.runPromise(program).catch((error) => {
Effect.runSync(Effect.logError("Unexpected error: " + error));
});
/*
Output:
... level=INFO msg="Attempting to process item 1..."
... level=INFO msg="Attempting to process item 2..."
... level=INFO msg="Item 2 failed, attempt 1."
... level=INFO msg="Attempting to process item 2..."
... level=INFO msg="Item 2 failed, attempt 2."
... level=INFO msg="Attempting to process item 2..."
... level=INFO msg="Attempting to process item 3..."
*/
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.
- 3mo ago First seen · 98 lines · 949 tokens per session scan A ef64b811a466
automatically-retry-failed-operations is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 5mo ago), licensed MIT. It adds 949 tokens to every session, about $0.0038 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-08-30.
automatically-retry-failed-operations compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| automatically-retry-failed-operationsPaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 949 | Cursor |
| error-handling-prioritiesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 133 | Cursor |
| conditional-encapsulationWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 71 | Cursor |
| bug-handling-with-todo-commentsWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 66 | Cursor |
| dragonruby-error-handlingWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 47 | Cursor |
| testing-and-debugging-rulesWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 29 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 201k | 8d ago | MIT | A | 604 | Cursor |