effect-scheduling

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manual sleep loops and ad-hoc retry logic in Effect v4 code are error-prone: they confuse retry with repeat semantics, retry non-idempotent operations, ignore rate-limit headers, and break on removed APIs like Schedule.tapInput. This Skill provides verified guidance for building correct time and recurrence policies with Schedule. ## Core Features & Use Cases - Policy Selection: Choose the right Schedule combinator for counters, fixed delays, cadence alignment, exponential or fibonacci backoff, jitter, and sequential composition via Schedule.concat. - Failure Policy Design: Distinguish typed failures, defects, and interruption; decide per-item versus per-pass failure handling for polling workers and batch processing. - Rate-Limit-Aware Retries: Use Schedule.modifyDelay to honor provider retry-after hints, and apply timeouts with Effect.timeout, timeoutOption, or timeoutOrElse. - Use Case: When wrapping a flaky third-party API call, build a jittered exponential backoff schedule bounded to five attempts that respects the provider's Retry-After header and falls back truthfully on exhaustion. ## Quick Start Ask the assistant to design an Effect v4 retry policy with exponential backoff, jitter, and a bounded attempt count for a specific failing operation.

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 Effect v4?

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

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

Effect.retry reruns an effect when it fails with a typed error, while Effect.repeat reruns it after each success. A typed failure stops repetition unless handled first, and the source effect always runs once before the schedule is stepped.

How do I respect Retry-After headers when retrying HTTP requests in Effect?

Use Schedule.modifyDelay to compare the computed backoff with the provider's retry-after value and take the maximum via Duration.max. Apply this only to typed rate-limit or transient failures, never to authentication or validation errors.

Does Schedule.tapInput exist in Effect v4?

No, Schedule.tapInput was removed in Effect v4. Use Schedule.tap instead, which receives full metadata including attempt, input, output, duration, and elapsed for observing schedule decisions.

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

Use TestClock instead of real sleeps when testing time policies. TestClock lets you advance virtual time deterministically, so backoff, polling intervals, and timeouts can be verified without slowing down the test suite.

When should I not retry a failed Effect operation?

Do not retry non-idempotent writes unless an idempotency key, transaction, or equivalent guarantee makes replay safe. Also avoid retrying authentication, validation, quota exhaustion, or permanent not-found failures without an explicit reason.