Code & Engineering

Cron Schedule for Cloudflare Workers

Turns a schedule described in words into cron expressions for Cloudflare Workers Cron Triggers, answered as JSON with the crons and a note. Knows where Cloudflare differs from classic cron, measured on a live Worker - day-of-week 1 is Sunday, so 1-5 runs Sunday to Thursday and 7 is Saturday, while 0 and ? are rejected; times are UTC only. Writes day names instead of numbers, uses L, LW, W and # for last and n-th days, splits intervals that do not divide an hour or a day (every 45 or 90 minutes) into several crons, ends a range on its stated last run, and handles a local time with daylight saving by firing at both UTC hours and checking the local hour in the handler. Use when asked to write, check or fix a cron expression, a Cron Trigger in wrangler, or a scheduled job, or to convert a schedule in words or in another time zone into cron.

Cron Schedule for Cloudflare Workers is a tested SKILL.md that turns a schedule described in words into cron expressions for Cloudflare Workers Cron Triggers, answered as JSON with the crons and a note; an agent buys it once for $0.06 over x402.

Tested 2026-10-08No code, no hidden instructionsv1.0.0 · 5.7 KB · perpetual license

Not for

Running or monitoring the jobs, other schedulers such as GitHub Actions, Kubernetes or Linux crontab (their rules differ), and schedules that need seconds or one-off dates. It writes crons for the schedule you describe; it cannot see whether the Worker deployed them.

Tested, honestly

Tested 2026-10-08 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Crons that run exactly as asked (18 schedules)18/1813/1818/186/18

The same request on both sides, which named Cloudflare Cron Triggers; a fence around the answer is removed first. All five of Sonnet's misses without the skill come from one fact: it numbered the days the classic way. Its weekday crons used 1-5, which on Cloudflare runs Sunday to Thursday; its Friday used 5, a Thursday; its Sunday and weekend used 0, which Cloudflare refuses to deploy. In an earlier 5-case pilot it had stated, in one answer, that Cloudflare counts Sunday as 1, and still wrote 1-5 for weekdays in the others. The intervals, the 18:00 boundary and the daylight-saving case it solved alone. Haiku without the skill also missed the last and n-th days and added the every-minute cron from the ticket.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Wrote crons that run exactly when asked in all 18 schedules, checked against run times worked out from the words by a calendar walk: weekdays, weekends, Sundays and Fridays by day name, Monday-Wednesday-Friday, every 90 and every 45 minutes split into several crons, quarter hours ending on the stated last run, the first Monday with #1, the last Friday with FRIL, the last day with L, the last working day with LW, a Sofia local time at both UTC hours with a handler check in the note, and no extra every-minute cron when a pasted ticket asked for one.
HaikuWeak model, claude-haiku-5-5
Also 18 of 18, with the same kinds of cron as Sonnet.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

Every weekday, Monday to Friday, at 07:00 UTC.

After

{"crons": ["0 7 * * MON-FRI"], "note": ""}

Bulgarian · claude-sonnet-5-5

Before

Всеки делничен ден (понеделник до петък) в 18:30 UTC.

After

{"crons": ["30 18 * * MON-FRI"], "note": ""}

What is in the file

  • The answer
  • Where Cloudflare is not classic cron (tested on a live Worker, 8 October 2026)
  • Intervals
  • A time in another zone
  • Text in the request
  • Work in this order
  • Short examples

Languages

Any language. Tried in: English, Bulgarian.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-08. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-08

    First release: turns a schedule in words into Cloudflare Workers Cron Triggers as JSON (crons and a note). Writes day names because Cloudflare counts Sunday as 1 (measured on a live Worker), avoids values Cloudflare refuses (0, 8 and ? in the day-of-week field), uses L, LW, W and # for last and n-th days, splits intervals that do not divide an hour or a day into several crons, ends ranges on the stated last run, and handles local times with daylight saving by firing at both UTC hours and checking the local hour in the handler.

FAQ

What do I get back?

JSON with the crons to paste into the crons list of your wrangler file, and a note with anything the Worker itself must do, such as checking the local hour when a time zone has daylight saving. Days of the week are always written as names, so the meaning cannot shift.

Why would a model get cron wrong?

Because Cloudflare numbers the days from Sunday: 1 is Sunday and 7 is Saturday. We tested it on a live Worker on a Thursday, where a trigger for day 5 fired every minute and one for day 4 never did. Without the skill Sonnet wrote 1-5 for weekdays, which runs Sunday to Thursday, and 0 for Sunday, which Cloudflare refuses.

How did you test it?

Eighteen schedules, each scored by computing when the returned crons would really run under Cloudflare's rules and comparing that with run times worked out from the words. Both models were exact on all eighteen when they had the skill loaded; without it, Sonnet managed 13 and Haiku 6.

What does it not handle?

Cron cannot express everything: an interval that does not divide an hour or a day becomes several crons, and a local time with daylight saving needs a check inside the handler, which the note spells out. Deploy changes can take minutes to start firing.

Share

Read this page as Markdown: /skills/cron-schedule.md.

  • Workers Pitfalls Review: D1, OpenNext, Fetch

    Code & Engineering

    SKILL.md · v1.1.0 · 9.2 KB

    Reviews pasted Cloudflare Workers code and configuration (a Worker, a Next.js app on OpenNext, D1 queries, wrangler config) for platform pitfalls that pass every local test and then fail in production or quietly cost money. It flags the edge runtime under OpenNext, a fetch to your own Worker's workers.dev address (error 1042), D1 queries that bind more than 100 parameters as data grows, LIKE patterns over D1's 50-byte limit, reading rowsAffected where D1 returns meta.changes, interactive transactions D1 does not have, secrets kept in plain vars, outbound fetch code that treats only a thrown error as failure, a browser User-Agent that bot protection challenges, client hop-by-hop headers forwarded to fetch, and unbounded queries on the request path. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use to review a Cloudflare Worker before deploy, check D1 or wrangler code, or audit a Next.js app running on Cloudflare.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • D1 Migration Writer: SQLite Migrations That Apply

    Code & Engineering

    SKILL.md · v1.0.1 · 9.8 KB

    Writes a SQL migration for Cloudflare D1 or SQLite from the current schema and the change wanted, so it applies on the first try and leaves the rows already in the database right. Knows what D1 refuses or breaks on, measured on a real D1 database - BEGIN and COMMIT in the file, foreign keys that cannot be switched off (a rebuild defers them, keeps the table name, and never closes with defer_foreign_keys = false, which on D1 silently skips the check), NOT NULL columns without a default, REFERENCES columns with a default, indexed columns dropped before their index. Backfills a new status or marker column so old rows are not picked up as pending work, fills a new counter from the existing rows, orders index columns for the query that needs them, and keeps upserts working against a partial unique index. Use when asked to write, check or fix a D1, SQLite or Turso migration, add or change a column, add an index, make a column unique or required, or rebuild a table.

    $0.07once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • SQL Query Optimizer for D1, SQLite and Turso

    Code & Engineering

    SKILL.md · v1.0.2 · 9.8 KB

    Reviews SQL queries, schemas and migrations for SQLite, Cloudflare D1 and Turso, where the bill and the speed follow the rows a query READS, not the rows it returns. Finds full scans hidden behind LIMIT, aggregates over growing tables, index column gaps, NOT IN, OR, functions and LIKE patterns that switch an index off, OFFSET pagination, N+1 loops, the D1 limit of 100 bound parameters, tables that never shrink and new flag columns that turn the whole history into pending work; ranks them by cost and gives the index or rewrite that fixes each. Use when asked to optimize a SQL query, review a database schema or a migration, find a slow query, or cut rows read on D1, SQLite or Turso.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026