scheduled-jobs

scheduled-jobs is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 85 tokens per session (1,639 once invoked), scanned A, original, Apache-2.0.

A method for running work at specified times or intervals, such as a nightly report, cleanup, polling task, or retention sweep. It covers time zones, deployments, missed runs, and multiple server instances.

In plain words
What is it for?
It helps add cron tasks, queue schedules, periodic jobs, and recurring database work. It also covers UTC storage, daylight-saving changes, idempotent runs, catch-up after missed ticks, and mutual exclusion.
Why use it?
Scheduled work can run twice, run in the wrong local time, overlap, or disappear without anyone noticing. Explicit schedules, safe retries, and recorded outcomes make failures visible and recoverable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps add cron tasks, queue schedules, periodic jobs, and recurring database work. It also covers UTC storage, daylight-saving changes, idempotent runs, catch-up after missed ticks, and mutual exclusion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/scheduled-jobs
Install

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.

Any agent
npx skills add tmj-90/gaffer --skill scheduled-jobs
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for scheduled-jobs

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/scheduled-jobs/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/scheduled-jobs)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/scheduled-jobs"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/scheduled-jobs/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.

agentmods 80×15 button for scheduled-jobs

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/scheduled-jobs"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/scheduled-jobs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.01639
Opus 5.5 $0.00034 $0.00656
Sonnet 5.5 $0.00017 $0.00328
Haiku 4.5 $0.00009 $0.00164

Measured 16d ago against content hash d6ff805548fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

scheduled-jobs 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 16d 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.

runner/skills/scheduled-jobs/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a scheduled job

Scheduled work fails quietly: the tick never fires, two instances fire at once, the job runs in the wrong zone, or a lock "expires" while its holder is merely paused and two runs write at once. Gaffer's own builds shipped exactly that last defect: a time-only stale-lock lease lost an acknowledged write when the holder was paused past the threshold. Make the schedule explicit, the run idempotent, mutual exclusion enforced at write time, and absence of a run alertable. Sources: Martin Kleppmann, "How to do distributed locking" (fencing tokens); PostgreSQL docs on advisory locks and SKIP LOCKED; Kubernetes CronJob docs ("jobs should be idempotent"); Google SRE Workbook (alerting on absence).

Steps

  1. Use the repo's scheduler. Cron library, platform scheduler (Kubernetes CronJob: set concurrencyPolicy: Forbid and startingDeadlineSeconds), a jobs table with next_run_at, or the queue's delayed jobs. Call search_lore for the convention. Assume any scheduler can fire twice or not at all; the steps below make both harmless.
  2. Write the schedule in UTC unless the meaning is local. A "9am local report" uses a named IANA zone, never a fixed offset, and has tests for both DST transitions (spring forward: 02:30 does not exist; fall back: 01:30 happens twice). Avoid :00 when the exact minute does not matter; jitter by a few minutes.
  3. Make each run idempotent and catch-up-safe. Process "everything due up to now" from a persisted watermark or per-item state (status, processed_at), not "the last interval" computed from wall-clock arithmetic, so a missed tick is recovered by the next and a double tick does nothing extra. Advance the watermark in the same transaction as the work it covers. Handler shape: the background-jobs skill.
  4. Enforce mutual exclusion at write time, not only at start. A lease that expires by time alone is not exclusion: GC pauses, VM suspension or a stalled event loop can outlast any TTL, and the paused holder then writes alongside the new one. Pick one:
    • Fenced lease: acquiring increments a token, UPDATE job_lease SET owner=:me, lease_until=:now+:ttl, fence=fence+1 WHERE name=:job AND lease_until < :now RETURNING fence, with :now from the injected clock (or now() with a tiny TTL in tests); every write the run makes is conditional on that fence still being current, checked with a row-locking statement in the same transaction as the write (UPDATE job_lease … WHERE name=:job AND fence=:fence or SELECT … FOR UPDATE; zero rows → abort and roll back). A plain SELECT of the fence is check-then-act and does not fence. Renewal checks the fence too; if renewal fails, stop work immediately.
    • Connection-bound lock: pg_try_advisory_xact_lock(key) held by the transaction doing the work, or a session advisory lock on a dedicated connection (not through a transaction-mode pooler) that also carries every write the run makes. Postgres releases it when that connection or transaction ends (a long pause can end it via idle timeouts), taking the uncommitted work with it; writes on any other connection or to files are unguarded.
    • Per-item claims: workers claim rows with SELECT … FOR UPDATE SKIP LOCKED and commit each item's result in the claiming transaction.
  5. Bound the run. A timeout shorter than the interval, a maximum batch per run, and a rule for backlog larger than one run (loop to a cap, then stop and report). A nightly job that takes 25 hours overlaps itself forever.
  6. Record every run. Start, end, items processed, outcome, fence/owner, next run, in structured logs (the structured-logging-and-tracing skill) and a job_runs table or a last_success_timestamp metric.
  7. Alert on absence. The failure mode of a cron is silence. Configure (or document for the operator) an alert when now - last_success > interval + slack (a dead man's switch), plus one on consecutive failures.

Read the full file on GitHub · 104 lines

Changes

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.

  1. 16d ago Changed · +41 lines d6ff805548fb
  2. 19d ago First seen · 63 lines · 85 tokens per session scan A 4e9127314c34

Subscribe to this mod's changes

scheduled-jobs is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 85 tokens to every session and 1,639 once invoked, about $0.0003 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-09-28.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens