effect-scheduling

Design Effect v4 retry, repeat, polling, backoff, and timeout policies with Schedule.

3|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/mpsuesser/opencode-effect-enforcer --skill effect-scheduling-mpsuesser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-scheduling
Source: https://github.com/mpsuesser/opencode-effect-enforcer/tree/main/skills/effect-scheduling
Command: npx skills add https://github.com/mpsuesser/opencode-effect-enforcer --skill effect-scheduling-mpsuesser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manual sleep loops and ad-hoc retry logic in TypeScript lead to unbounded retries, synchronized callers, lost interruption semantics, and retries of non-idempotent operations. This Skill provides authoritative guidance for modeling recurrence and failure policy with Effect v4's Schedule API. ## Core Features & Use Cases - Retry and Repeat Policy Design: Choose the correct Schedule combinator (recurs, spaced, fixed, exponential, fibonacci, jittered, upTo, concat, while, tap) for counters, delays, backoff, and metadata-driven stopping. - Rate-Limit-Aware Retries: Use Schedule.modifyDelay to honor provider retry-after hints by taking the maximum of computed backoff and the typed retry delay. - Timeouts and Polling: Apply Effect.timeout, timeoutOption, timeoutOrElse, and structured polling workers with explicit per-item failure policy and fiber ownership. - Use Case: When wrapping a flaky third-party HTTP call, build a jittered exponential backoff schedule bounded to five attempts that respects the provider's Retry-After header and logs each attempt with full metadata. ## Quick Start Ask the agent to design an Effect retry policy with bounded jittered exponential backoff for a specific failing operation in your TypeScript code.

Frequently Asked Questions about effect-scheduling

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

FAQPage Schema
How do I retry an Effect with exponential backoff in TypeScript?

Use Effect.retry with Schedule.exponential(base), piped through Schedule.jittered and Schedule.upTo to bound attempts. Effect.retry only reruns typed failures, never defects or interruption, so keep retried operations idempotent.

What is the difference between Effect.retry and Effect.repeat?

Effect.retry reruns an effect after typed failures, while Effect.repeat reruns it after successes. A typed failure stops repetition unless handled first, and the source effect always runs once before the schedule is stepped.

How do I honor a Retry-After header when retrying HTTP requests in Effect?

Use Schedule.modifyDelay to return the maximum of the computed backoff and the provider's retry-after duration from typed error metadata. Apply this only to typed rate-limit or transient failures, not authentication or validation errors.

Does Schedule.recurs(3) run the effect three times?

No. Schedule.recurs(3) permits three recurrences after the initial evaluation, so the effect runs at most four times total. Always document the initial attempt plus recurrence count when defining retry policy.

How do I test Effect schedules without waiting for real delays?

Use TestClock instead of real sleeps to advance time deterministically in tests. This lets you verify backoff, timeout, and polling behavior without slowing down the test suite.