Cron Schedule Explainer and Validator
--- name: cron-schedule-explainer description: Explains, validates, and writes cron schedules - translates a cron expression into plain English, lists the next run times, and flags pitfalls such as the day-of-month OR…
Open the source (opens github.com) https://github.com/f/prompts.chat
What it is
Prompts from f.
The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.
The prompt
--- name: cron-schedule-explainer description: Explains, validates, and writes cron schedules - translates a cron expression into plain English, lists the next run times, and flags pitfalls such as the day-of-month OR day-of-week rule, dates that never occur, daylight saving gaps, time zone confusion, and overlapping or too-frequent jobs. Use when a user pastes a crontab line, Kubernetes CronJob, GitHub Actions schedule, or asks "when will this run?" or "write a cron for every second Tuesday". --- # Cron Schedule Explainer You make scheduled jobs predictable. For every schedule you give a plain-English meaning, concrete next run times, and the risks that would surprise someone at 2 a.m. ## Files in this skill - `scripts/cron_explain.py` - parser, explainer, next-run calculator, and pitfall checker (Python 3 standard library only) - `references/cron-syntax.md` - field ranges, special characters, macros, and platform differences - `references/scheduling-pitfalls.md` - common mistakes and how to avoid them - `templates/schedule-review.md` - review format - `examples/example-backup-review.md` - a worked review of three crontab lines ## Workflow ### 1. Identify the platform Standard 5-field cron (Vixie cron, cronie, Kubernetes CronJob, GitHub Actions) is the default. Ask or check if the user means Quartz (6 or 7 fields with seconds and `?`), AWS EventBridge (6 fields with year), or systemd timers; see `references/cron-syntax.md`. Note the time zone: GitHub Actions always uses UTC; Kubernetes uses the controller's time zone unless `timeZone` is set. ### 2. Run the checker ```bash python3 scripts/cron_explain.py "30 2 * * 1-5" python3 scripts/cron_explain.py "0 9 1 * MON" --count 8 --from "2026-10-08 10:00" python3 scripts/cron_explain.py --file crontab.txt ``` It prints a plain-English explanation, the next N run times (naive local time of the server), and warnings. Exit code is 1 when an expression is invalid or never runs. If you cannot run the script, apply the same rules by hand and say so. ### 3. Explain For each schedule give: 1. One-sentence plain-English meaning. 2. The next 3 to 5 runs with the time zone stated. 3. Warnings from the script and from `references/scheduling-pitfalls.md` that apply (overlap with long jobs, DST, UTC versus local, missed runs while the machine is off). ### 4. Write or fix schedules When the user describes a schedule in words, write the expression, then run it through the checker to confirm the next runs match their intent. For things cron cannot express directly (every second Tuesday, the last weekday of the month), give a cron expression plus a guard in the command, for example `[ "$(date +\%d)" -le 07 ] && run-job`, and explain why. ### 5. Report Use `templates/schedule-review.md`, as in `examples/example-backup-review.md`. ## Rules - Always state the time zone you are assuming. - Remember that `%` must be escaped as `\%` inside crontab command fields. - Never edit a live crontab for the user; show the line to add and the `crontab -e` step. - Recommend a lock (for example `flock -n /tmp/job.lock cmd`) whenever a job could run longer than its interval. FILE:references/cron-syntax.md # Cron Syntax Reference (5-field standard) ``` +------------- minute (0-59) | +----------- hour (0-23) | | +--------- day of month (1-31) | | | +------- month (1-12 or JAN-DEC) | | | | +----- day of week (0-7 or SUN-SAT; 0 and 7 are both Sunday) | | | | | * * * * * command ``` ## Special characters | Symbol | Meaning | Example | |---|---|---| | `*` | every value | `* * * * *` every minute | | `,` | list | `0 8,12,18 * * *` at 08:00, 12:00, 18:00 | | `-` | range | `0 9 * * 1-5` 09:00 Monday to Friday | | `/` | step | `*/15 * * * *` every 15 minutes; `10-50/20` = 10, 30, 50 | Names are case-insensitive. Ranges of names (`MON-FRI`) work in most implementations, lists of names work everywhere. ## Macros | Macro | Equivalent | |---|---| | `@yearly` / `@annually` | `0 0 1 1 *` | | `@monthly` | `0 0 1 * *` | | `@weekly` | `0 0 * * 0` | | `@daily` / `@midnight` | `0 0 * * *` | | `@hourly` | `0 * * * *` | | `@reboot` | once at startup (not time based) | ## The day rule If both day of month and day of week are restricted (neither is `*`), the job runs when EITHER matches. `0 9 1 * MON` runs on the 1st of every month AND every Monday. ## Platform differences | Platform | Fields | Time zone | Notes | |---|---|---|---| | Linux cron (cronie, Vixie) | 5 | system local time | `CRON_TZ=` supported by cronie | | Kubernetes CronJob | 5 | controller time zone, or `spec.timeZone` | use `concurrencyPolicy: Forbid` to prevent overlaps | | GitHub Actions `schedule` | 5 | always UTC | runs can be delayed under load; minimum interval 5 minutes | | Quartz (Java) | 6-7 (seconds first, optional year) | configurable | `?` for "no specific value", `L`, `W`, `#` supported | | AWS EventBridge | 6 (with year) | UTC unless a scheduler time zone is set | either day-of-month or day-of-week must be `?` | The script in this skill supports the 5-field standard plus the macros above (except `@reboot`, which it reports as not time based). FILE:references/scheduling-pitfalls.md # Scheduling Pitfalls ## 1. Day of month OR day of week `0 0 13 * 5` is NOT "Friday the 13th". It runs on every 13th and every Friday. Use `0 0 13 * *` plus a guard: `[ "$(date +\%u)" = 5 ] && cmd`. ## 2. Dates that never or rarely occur - `0 0 30 2 *` never runs (February has no 30th). - `0 0 31 * *` runs only in 7 months of the year. - `0 0 29 2 *` runs only in leap years. For "last day of the month" use `0 0 28-31 * *` with a guard: `[ "$(date -d tomorrow +\%d)" = 01 ] && cmd`. ## 3. Daylight saving time In local time zones with DST, times between about 01:00 and 03:00 can be skipped (spring forward) or run twice (fall back), depending on the cron implementation. Schedule critical jobs outside that window, or run cron in UTC. ## 4. UTC versus local time GitHub Actions and many cloud schedulers use UTC. "Every day at…
Written by the prompts.chat (CC0 prompt collection) community (f). Not tested by InnerVault.
How to get it
Setup steps: not applicable.
Related
-
--- name: car-maintenance-service-schedule-planner description: Plans car maintenance from your service schedule and service history - estimates how far you drive from odometer readings, works out what is overdue, due…
-
--- name: houseplant-watering-schedule-planner description: Builds a houseplant watering check calendar from a list of plants with pot size and material, light, drainage and last watering date. Adjusts each interval…
-
Shell Script Safety Reviewer
Prompts--- name: shell-script-safety-reviewer description: Reviews bash and POSIX sh scripts before they run in CI, cron or production. Flags missing strict mode, rm -rf on variables that may be empty, curl piped to a shell…
-
Act as a Web Developer specializing in task management applications. You are tasked with creating a web app that enables users to manage tasks through a weekly calendar and board view. Your task is to: - Design a…
-
Step 6: Publication
PromptsPrepare the final deliverable for publication. Final steps: - Format for target platform - Create accompanying materials - Set up distribution - Prepare announcement - Schedule publication - Monitor initial reception…
-
Loan Amortization Planner
Prompts--- name: loan-amortization-planner description: Builds fixed-rate loan and mortgage amortization schedules, shows how much of each payment goes to interest, and compares payoff strategies such as extra monthly…