From effect-ts
This skill should be used when the user asks about "Effect Schedule", "retry schedules", "repetition", "Schedule.exponential", "Schedule.spaced", "Schedule.recurs", "cron scheduling", "backoff strategy", "schedule combinators", "Effect.repeat", "Effect.retry", "polling", or needs to understand how Effect handles scheduled operations and retry policies.
npx claudepluginhub andrueandersoncs/claude-skill-effect-ts --plugin effect-tsThis skill uses the workspace's default tool permissions.
Effect's `Schedule` type describes patterns for:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Effect's Schedule type describes patterns for:
Schedule<Out, In, Requirements>;
// ^^^ ^^ Output and input types
import { Schedule } from "effect";
const everySecond = Schedule.spaced("1 second");
const fixed = Schedule.fixed("500 millis");
const fiveTimes = Schedule.recurs(5);
const once = Schedule.once;
const forever = Schedule.forever;
const exponential = Schedule.exponential("100 millis");
const capped = Schedule.exponential("100 millis").pipe(Schedule.upTo("30 seconds"));
const jittered = Schedule.exponential("100 millis").pipe(Schedule.jittered);
const forOneMinute = Schedule.spaced("1 second").pipe(Schedule.upTo("1 minute"));
const untilSuccess = Schedule.recurWhile((result) => result.status === "pending");
const resilientFetch = fetchData().pipe(
Effect.retry(Schedule.exponential("1 second").pipe(Schedule.compose(Schedule.recurs(5)))),
);
const polling = checkStatus().pipe(Effect.repeat(Schedule.spaced("5 seconds")));
const scheduled = effect.pipe(Effect.schedule(mySchedule));
const exponentialWithLimit = Schedule.exponential("1 second").pipe(Schedule.compose(Schedule.recurs(10)));
const eitherSchedule = Schedule.union(Schedule.spaced("1 second"), Schedule.recurs(5));
const jittered = Schedule.exponential("1 second").pipe(Schedule.jittered);
const customJitter = Schedule.exponential("1 second").pipe(Schedule.jittered({ min: 0.8, max: 1.2 }));
const delayed = Schedule.spaced("1 second").pipe(Schedule.delayed(() => "5 seconds"));
const resetting = Schedule.exponential("1 second").pipe(Schedule.resetAfter("1 minute"));
// Use Match.tag for error type checking in predicates
const retryTransient = effect.pipe(
Effect.retry({
schedule: Schedule.exponential("1 second"),
while: (error) =>
Match.value(error).pipe(
Match.tag("TransientError", () => true),
Match.orElse(() => false),
),
}),
);
const retryUntilFatal = effect.pipe(
Effect.retry({
schedule: Schedule.recurs(10),
until: (error) =>
Match.value(error).pipe(
Match.tag("FatalError", () => true),
Match.orElse(() => false),
),
}),
);
import { Cron } from "effect";
const daily = Cron.parse("0 0 * * *");
const hourly = Cron.parse("0 * * * *");
const cronSchedule = Schedule.cron(daily);
Schedules can produce values:
const withElapsed = Schedule.elapsed;
const withCount = Schedule.count;
const collecting = Schedule.collectAll<number>();
const [result, elapsed] =
yield * effect.pipe(Effect.retry(Schedule.exponential("1 second").pipe(Schedule.compose(Schedule.elapsed))));
console.log(`Took ${elapsed}ms after retries`);
const apiCall = fetchFromApi().pipe(
Effect.retry(
Schedule.exponential("500 millis").pipe(
Schedule.jittered,
Schedule.compose(Schedule.recurs(5)),
Schedule.upTo("30 seconds"),
),
),
);
const poll = checkJobStatus(jobId).pipe(
Effect.repeat(Schedule.spaced("2 seconds").pipe(Schedule.upTo("5 minutes"))),
Effect.timeout("5 minutes"),
);
const circuitBreaker = (effect: Effect.Effect<A, E>) => {
let failures = 0;
const maxFailures = 5;
const resetTimeout = "30 seconds";
return effect.pipe(
Effect.retry(
Schedule.exponential("1 second").pipe(
Schedule.compose(Schedule.recurs(3)),
Schedule.tapOutput(() =>
Effect.sync(() => {
failures++;
}),
),
),
),
);
};
const retryWithLogs = effect.pipe(
Effect.retry(
Schedule.exponential("1 second").pipe(
Schedule.compose(Schedule.recurs(5)),
Schedule.tapInput((error) => Effect.log(`Retrying after error: ${error}`)),
),
),
);
| Schedule | Pattern |
|---|---|
Schedule.forever | Never stops |
Schedule.once | Single execution |
Schedule.recurs(n) | Exactly n times |
Schedule.spaced(d) | Fixed delay d |
Schedule.fixed(d) | Fixed interval from start |
Schedule.exponential(d) | d, 2d, 4d, 8d... |
Schedule.fibonacci(d) | d, d, 2d, 3d, 5d... |
Schedule.linear(d) | d, 2d, 3d, 4d... |
For comprehensive scheduling documentation, consult ${CLAUDE_PLUGIN_ROOT}/references/llms-full.txt.
Search for these sections: