Skip to content
Development
Skill

/task-scheduling

This skill should be used when the user designs a "task scheduler", "job scheduler", "job queue", "cron at scale", "distributed cron", "delayed / scheduled / recurring tasks", a "worker pool", reaches for "Celery / Sidekiq / Airflow", or wrestles with "task leasing", visibility

From plugin
system-design-skills
12922 skills1 agent1 command

Claude Code

$ npx -y skills add proyecto26/system-design-skills --skill task-scheduling --agent claude-code

SKILL.md

task-scheduling.SKILL.md
name: task-scheduling
description: This skill should be used when the user designs a "task scheduler", "job scheduler", "job queue", "cron at scale", "distributed cron", "delayed / scheduled / recurring tasks", a "worker pool", reaches for "Celery / Sidekiq / Airflow", or wrestles with "task leasing", visibility timeouts, job priorities, fairness, or duplicate task execution. Use it whenever work must run later, on a schedule, or be reliably leased to a pool of workers, even if the user doesn't say "scheduler". (For plain queue transport and delivery guarantees, that is `messaging-streaming`.)

Task Scheduling

Decide *when* work runs and *which worker* runs it: fire jobs on a schedule (cron/delayed/recurring), hand each job to exactly one worker via a lease, and make sure it completes once despite crashes and retries. This sits *on top of* `messaging-streaming` queues โ€” the queue is the transport; this skill adds the scheduling, leasing, priorities, and task-level idempotency. Getting it wrong shows up as jobs that never run, run twice (double charge, double email), or pile up until a worker fleet falls permanently behind.

When to reach for this

Work must run **later** (send a reminder in 24h), **on a schedule** (nightly rollups, hourly cron), or **repeatedly** (poll every 5 min); a slow operation is already off the request path (โ†’ `messaging-streaming`) and now needs reliable allocation to a pool of workers; jobs need **priorities** (paid before free) or **fairness** (no single tenant starves others); or a job must complete **exactly once** even though the worker holding it can crash mid-flight.

When NOT to

The caller needs the result inline โ€” that's a synchronous call, not a scheduled job. A single fire-and-forget async step with no schedule, priority, or exactly-once need โ€” a plain queue + idempotent consumer (`messaging-streaming`) is simpler; don't add a scheduler on top. One periodic job on one box โ€” OS `cron` is fine until you have multiple schedulers or need history and retries. A long-running multi-step saga with rollback โ€” reach for a durable workflow engine instead of hand-rolling state across jobs. Don't stand up Airflow/Celery "because we'll have batch jobs eventually" (YAGNI): it's a stateful control plane to operate and monitor.

Clarify first

  • **Trigger type** โ€” scheduled (cron/at a time), delayed (run after N seconds),

recurring (every N), or event-driven (a queue message arrives)? This decides whether a scheduler is even in scope.

  • **Exactly-once vs at-least-once** โ€” is a duplicate run harmful (money, email)

or harmless (idempotent recompute)? Drives the leasing + dedup design.

  • **Latency budget vs throughput** โ€” must a delayed job fire within seconds of

its time, or is "within a few minutes" fine? Tight timing is more expensive.

  • **Priority / fairness** โ€” do some jobs jump the line, and must one tenant or

job class be prevented from starving the rest? (โ†’ `back-of-the-envelope` for arrival vs. service rate.)

  • **Job duration & variance** โ€” seconds or hours? Sets the visibility-timeout /

lease length and whether long jobs need heartbeats.

  • **Idempotency key** โ€” what identifies a task as the same task on retry?

(The key contract is owned by `api-design`.)

The options

**Scheduling trigger**

  • **OS cron / single scheduler** โ€” one process fires jobs on a crontab. *Use

when* one node, a handful of jobs, no HA requirement.

  • **Distributed scheduler (HA cron)** โ€” a leader-elected scheduler enqueues due

jobs into a queue; followers stand by. *Use when* the schedule must survive a node loss and must not double-fire.

  • **Delay queue / timer** โ€” jobs carry a "not before" time; the queue holds them

until due (delivery delay, sorted-set scoring, or a timer wheel). *Use when* per-job delays vary and you don't want a cron tick.

  • **Workflow/orchestration DAG** โ€” declared task dependencies with backfill and

history (Airflow-style). *Use when* batch pipelines have dependencies and you need a run history and reruns.

**Worker allocation**

  • **Pull (worker leasing)** โ€” workers poll the queue, lease a job for a

**visibility timeout**, and ack/delete on success. *Use when* you want back-pressure for free and elastic, self-balancing workers. The default.

  • **Push (dispatcher assigns)** โ€” a coordinator routes jobs to specific workers.

*Use when* affinity/locality matters (a job must run where its data is).

**Priority & fairness**

  • **Priority queues** โ€” separate high/low queues drained in order. *Use when*

some classes must run first.

  • **Weighted / fair scheduling** โ€” round-robin or weighted draw across per-tenant

queues. *Use when* one tenant's burst must not starve others.

Trade-offs

| Option | What it solves | What it worsens | Change it when | |---|---|---|---| | OS cron / single scheduler | Trivial; zero infra | SPOF โ€” node dies, schedule stops; no retry/history | You need HA or missed-run recovery โ†’ distributed scheduler | | Distributed scheduler (HA cron) | Survives node loss; no double-fire (leader-elected) | Needs leader election (โ†’ `consistency-coordination`); more moving parts | One box and one job is enough โ†’ OS cron | | Delay queue / timer | Per-job delays without a cron tick; precise-ish timing | Far-future jobs sit in the queue; timer accuracy bounded by poll interval | Delays are uniform/periodic โ†’ cron; dependencies exist โ†’ DAG | | Workflow DAG (Airflow-style) | Dependencies, backfill, run history, reruns | Heavy control plane; scheduler latency; overkill for single jobs | Jobs are independent one-shots โ†’ plain queue + scheduler | | Pull (worker leasing) | Self-balancing, elastic, natural back-pressure | At-least-once: lease expiry on a slow job re-runs it (need idempotency) | A job must run on a specific node (data locality) โ†’ push | | Push (dispatcher) | Affinity/locality; central control | Dispatcher is a bottleneck/SPOF; must track worker health | No locality need โ†’ pull is simpler | | Priority

Read more
@proyecto26
Ships withsystem-design-skills

Made in code with Remotion โ€” the same scenes power the site's hero (site/src/motion/). Design scalable systems the way strong engineers actually do โ€” by reasoning, not by memorizing diagrams.

12922 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
129
Star history of proyecto26/system-design-skills on GitHub, a chart by star-history.com

Other skills on system-design-skills.

caching

caching

This skill should be used when the user asks about a "caching strategy", "cache invalidation", "what to cache", "read-through vsโ€ฆ

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, orโ€ฆ

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android โ€” semantic ARIA roles and labels,โ€ฆ

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commitsโ€ฆ

react1d252k
@facebook@facebookInstall Skill

Questions about task-scheduling.

Which coding agents can use task-scheduling?
task-scheduling installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.