Cron
Overview
Use this skill to manage Codex automations through the native Zig cron CLI. Runtime paths are Zig-only (no Python fallback, no shell launchd wrappers).
Zig CLI Iteration Repos
When iterating on cron, use these two repos:
skills-zig (/Users/tk/workspace/tk/skills-zig): source for the cron binary, build/test wiring, release tags.
homebrew-tap (/Users/tk/workspace/tk/homebrew-tap): formula/checksum updates for released binaries.
Quick Start
run_cron_tool() {
install_cron_direct() {
local repo="${SKILLS_ZIG_REPO:-$HOME/workspace/tk/skills-zig}"
if ! command -v zig >/dev/null 2>&1; then
echo "zig not found. Install Zig from https://ziglang.org/download/ and retry." >&2
return 1
fi
if [ ! -d "$repo" ]; then
echo "skills-zig repo not found at $repo." >&2
echo "clone it with: git clone https://github.com/tkersey/skills-zig \"$repo\"" >&2
return 1
fi
if ! (cd "$repo" && zig build build-cron -Doptimize=ReleaseFast); then
echo "direct Zig build failed in $repo." >&2
return 1
fi
if [ ! -x "$repo/zig-out/bin/cron" ]; then
echo "direct Zig build did not produce $repo/zig-out/bin/cron." >&2
return 1
fi
mkdir -p "$HOME/.local/bin"
install -m 0755 "$repo/zig-out/bin/cron" "$HOME/.local/bin/cron"
}
local os="$(uname -s)"
if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then
cron "$@"
return
fi
if [ "$os" = "Darwin" ]; then
if ! command -v brew >/dev/null 2>&1; then
echo "homebrew is required on macOS: https://brew.sh/" >&2
return 1
fi
if ! brew install tkersey/tap/cron; then
echo "brew install tkersey/tap/cron failed." >&2
return 1
fi
elif ! (command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"); then
if ! install_cron_direct; then
return 1
fi
fi
if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then
cron "$@"
return
fi
echo "cron binary missing or incompatible after install attempt." >&2
if [ "$os" = "Darwin" ]; then
echo "expected install path: brew install tkersey/tap/cron" >&2
else
echo "expected direct path: SKILLS_ZIG_REPO=<skills-zig-path> zig build build-cron -Doptimize=ReleaseFast" >&2
fi
return 1
}
- List automations:
run_cron_tool list
- Show one automation:
run_cron_tool show --id <id>
- Create an automation:
run_cron_tool create --name "Weekly release notes" --prompt-file /path/to/prompt.md --rrule "RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0"
- Update an automation:
run_cron_tool update --id <id> --rrule "RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0"
- Enable or disable:
run_cron_tool enable --id <id> or run_cron_tool disable --id <id>
- Run immediately:
run_cron_tool run-now --id <id>
- Delete:
run_cron_tool delete --id <id>
- Run due automations once:
run_cron_tool run-due
- Run due automations dry-run:
run_cron_tool run-due --dry-run
- Install/start launchd scheduler (macOS):
run_cron_tool scheduler install
- Stop/remove launchd scheduler (macOS):
run_cron_tool scheduler uninstall
- Show scheduler status (macOS):
run_cron_tool scheduler status
Runtime bootstrap policy mirrors seq/cas/lift: require the Zig binary, default to Homebrew install on macOS, and fallback to direct Zig install from skills-zig on non-macOS.
Subcommand --help prints top-level usage. For detailed options, use the matrix below.
Workflow
- Choose working directories (
cwds). Default is current repo if omitted on create.
- Write the automation prompt (use
--prompt-file for multi-line prompts).
- Provide an RFC5545 RRULE string.
- Create or update with
cron.
- For unattended execution, install scheduler via
cron scheduler install.
Headless Runner
cron run-due executes due automations by calling codex exec and updates:
automations.last_run_at
automations.next_run_at
automation_runs rows
cron run-due --dry-run is read-only:
- no
automation_runs rows are inserted/updated
- no
automations.last_run_at/next_run_at updates
- no automation files or
memory.md writes
--codex-bin accepts executable name or absolute path (default resolves $CODEX_BIN or codex in PATH).
- Locking is label-scoped and fail-closed (
--lock-label, or env CRON_LAUNCHD_LABEL).
--lock-label uses strict label validation: only [A-Za-z0-9._-] (no slashes/spaces).
run-due default batch limit is 10 automations per invocation (--limit overrides).
- Scheduler commands are macOS-only and manage
~/Library/LaunchAgents/<label>.plist directly from Zig.
- Launchd scheduler runs
run-due with default DB path and default limit unless you invoke cron manually with overrides.
- Logs:
~/Library/Logs/codex-automation-runner/out.log and ~/Library/Logs/codex-automation-runner/err.log.
Command Options (High Signal)
list: --status <ACTIVE|PAUSED>, --json
show: --id <id> or --name <name>, optional --json
create: --name, --prompt|--prompt-file, --rrule, optional --status, --cwd (repeatable), --cwds-json, --clear-cwds, --next-run-at
update: --id|--name, optional --new-name, --prompt|--prompt-file, --rrule, --status, --cwd (repeatable), --cwds-json, --clear-cwds, --next-run-at, --clear-next-run-at
enable|disable|run-now|delete: --id or --name
run-due: optional --id, --limit, --dry-run, --codex-bin, --lock-label ([A-Za-z0-9._-] only)
scheduler install: optional --label, --interval-seconds, --path, --codex-bin
scheduler uninstall|status: optional --label
- Scheduler
--label is strict: only [A-Za-z0-9._-] (no slashes/spaces).
Clarify When Ambiguous
Ask questions only when the request is ambiguous or when the user explicitly asks for guidance. Do not block otherwise.
Essential elements to confirm or infer:
- Automation name.
- Prompt content (single line or file path).
- Schedule as an RFC5545 RRULE string (include
RRULE: prefix).
- Working directories (
cwds), default to current repo if not specified.
- Status if explicitly requested; otherwise default to
ACTIVE.
When ambiguous, ask for missing details. Examples:
- If user says “daily”/“weekly” without time, ask for required time/day fields.
- If user says “run it for this repo” without paths, confirm repo root as
cwd.
Schedule (RRULE)
- Accept only RFC5545 RRULE strings. Cron expressions are unsupported.
- Rules are canonicalized to
RRULE:-prefixed form.
- Legacy non-prefixed stored values (
FREQ=...) are still accepted at run time for compatibility.
- Validation is fail-closed.
BYHOUR/BYMINUTE are interpreted in UTC.
- Supported frequencies:
HOURLY requires BYMINUTE
DAILY requires BYHOUR and BYMINUTE
WEEKLY requires BYDAY, BYHOUR, and BYMINUTE
Example rules:
- Daily at 09:00:
RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0
- Weekly on Friday at 09:00:
RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0
- Every 24 hours:
RRULE:FREQ=HOURLY;INTERVAL=24;BYMINUTE=0
Task Examples
Daily standup summary
Name: Summarize yesterday's git activity
Prompt: Summarize yesterday's git activity for standup. Include notable commits, files touched, and any risks or follow-ups.
Schedule: RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0
Weekly release notes
Name: Draft weekly release notes
Prompt: Draft weekly release notes from merged PRs. Include links when available and group by area.
Schedule: RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0
CI failure triage
Name: Summarize CI failures
Prompt: Summarize CI failures and flaky tests from the last CI window, group by root cause, and suggest minimal fixes.
Schedule: RRULE:FREQ=DAILY;BYHOUR=8;BYMINUTE=30
Data Model Reference
See references/db.md for schema and field notes.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: cron3description: Create and manage Codex app automations stored in the local SQLite database (~/.codex/sqlite/codex-dev.db). Use when you need to add, list, update, enable/disable, delete, or run-now automations; edit automation names, prompts, RRULE schedules, or cwd scopes; or inspect automation records while troubleshooting app automation behavior. Use when this capability is needed.4---56# Cron78## Overview9Use this skill to manage Codex automations through the native Zig `cron` CLI. Runtime paths are Zig-only (no Python fallback, no shell launchd wrappers).1011## Zig CLI Iteration Repos1213When iterating on `cron`, use these two repos:1415- `skills-zig` (`/Users/tk/workspace/tk/skills-zig`): source for the `cron` binary, build/test wiring, release tags.16- `homebrew-tap` (`/Users/tk/workspace/tk/homebrew-tap`): formula/checksum updates for released binaries.1718## Quick Start19```bash20run_cron_tool() {21 install_cron_direct() {22 local repo="${SKILLS_ZIG_REPO:-$HOME/workspace/tk/skills-zig}"23 if ! command -v zig >/dev/null 2>&1; then24 echo "zig not found. Install Zig from https://ziglang.org/download/ and retry." >&225 return 126 fi27 if [ ! -d "$repo" ]; then28 echo "skills-zig repo not found at $repo." >&229 echo "clone it with: git clone https://github.com/tkersey/skills-zig \"$repo\"" >&230 return 131 fi32 if ! (cd "$repo" && zig build build-cron -Doptimize=ReleaseFast); then33 echo "direct Zig build failed in $repo." >&234 return 135 fi36 if [ ! -x "$repo/zig-out/bin/cron" ]; then37 echo "direct Zig build did not produce $repo/zig-out/bin/cron." >&238 return 139 fi40 mkdir -p "$HOME/.local/bin"41 install -m 0755 "$repo/zig-out/bin/cron" "$HOME/.local/bin/cron"42 }4344 local os="$(uname -s)"45 if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then46 cron "$@"47 return48 fi4950 if [ "$os" = "Darwin" ]; then51 if ! command -v brew >/dev/null 2>&1; then52 echo "homebrew is required on macOS: https://brew.sh/" >&253 return 154 fi55 if ! brew install tkersey/tap/cron; then56 echo "brew install tkersey/tap/cron failed." >&257 return 158 fi59 elif ! (command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"); then60 if ! install_cron_direct; then61 return 162 fi63 fi6465 if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then66 cron "$@"67 return68 fi69 echo "cron binary missing or incompatible after install attempt." >&270 if [ "$os" = "Darwin" ]; then71 echo "expected install path: brew install tkersey/tap/cron" >&272 else73 echo "expected direct path: SKILLS_ZIG_REPO=<skills-zig-path> zig build build-cron -Doptimize=ReleaseFast" >&274 fi75 return 176}77```7879- List automations: `run_cron_tool list`80- Show one automation: `run_cron_tool show --id <id>`81- Create an automation: `run_cron_tool create --name "Weekly release notes" --prompt-file /path/to/prompt.md --rrule "RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0"`82- Update an automation: `run_cron_tool update --id <id> --rrule "RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0"`83- Enable or disable: `run_cron_tool enable --id <id>` or `run_cron_tool disable --id <id>`84- Run immediately: `run_cron_tool run-now --id <id>`85- Delete: `run_cron_tool delete --id <id>`86- Run due automations once: `run_cron_tool run-due`87- Run due automations dry-run: `run_cron_tool run-due --dry-run`88- Install/start launchd scheduler (macOS): `run_cron_tool scheduler install`89- Stop/remove launchd scheduler (macOS): `run_cron_tool scheduler uninstall`90- Show scheduler status (macOS): `run_cron_tool scheduler status`9192Runtime bootstrap policy mirrors `seq`/`cas`/`lift`: require the Zig binary, default to Homebrew install on macOS, and fallback to direct Zig install from `skills-zig` on non-macOS.9394Subcommand `--help` prints top-level usage. For detailed options, use the matrix below.9596## Workflow971. Choose working directories (`cwds`). Default is current repo if omitted on `create`.982. Write the automation prompt (use `--prompt-file` for multi-line prompts).993. Provide an RFC5545 RRULE string.1004. Create or update with `cron`.1015. For unattended execution, install scheduler via `cron scheduler install`.102103## Headless Runner104- `cron run-due` executes due automations by calling `codex exec` and updates:105 - `automations.last_run_at`106 - `automations.next_run_at`107 - `automation_runs` rows108- `cron run-due --dry-run` is read-only:109 - no `automation_runs` rows are inserted/updated110 - no `automations.last_run_at`/`next_run_at` updates111 - no automation files or `memory.md` writes112- `--codex-bin` accepts executable name or absolute path (default resolves `$CODEX_BIN` or `codex` in `PATH`).113- Locking is label-scoped and fail-closed (`--lock-label`, or env `CRON_LAUNCHD_LABEL`).114- `--lock-label` uses strict label validation: only `[A-Za-z0-9._-]` (no slashes/spaces).115- `run-due` default batch limit is `10` automations per invocation (`--limit` overrides).116- Scheduler commands are macOS-only and manage `~/Library/LaunchAgents/<label>.plist` directly from Zig.117- Launchd scheduler runs `run-due` with default DB path and default limit unless you invoke `cron` manually with overrides.118- Logs: `~/Library/Logs/codex-automation-runner/out.log` and `~/Library/Logs/codex-automation-runner/err.log`.119120## Command Options (High Signal)121- `list`: `--status <ACTIVE|PAUSED>`, `--json`122- `show`: `--id <id>` or `--name <name>`, optional `--json`123- `create`: `--name`, `--prompt|--prompt-file`, `--rrule`, optional `--status`, `--cwd` (repeatable), `--cwds-json`, `--clear-cwds`, `--next-run-at`124- `update`: `--id|--name`, optional `--new-name`, `--prompt|--prompt-file`, `--rrule`, `--status`, `--cwd` (repeatable), `--cwds-json`, `--clear-cwds`, `--next-run-at`, `--clear-next-run-at`125- `enable|disable|run-now|delete`: `--id` or `--name`126- `run-due`: optional `--id`, `--limit`, `--dry-run`, `--codex-bin`, `--lock-label` (`[A-Za-z0-9._-]` only)127- `scheduler install`: optional `--label`, `--interval-seconds`, `--path`, `--codex-bin`128- `scheduler uninstall|status`: optional `--label`129- Scheduler `--label` is strict: only `[A-Za-z0-9._-]` (no slashes/spaces).130131## Clarify When Ambiguous132Ask questions only when the request is ambiguous or when the user explicitly asks for guidance. Do not block otherwise.133134Essential elements to confirm or infer:1351. Automation name.1362. Prompt content (single line or file path).1373. Schedule as an RFC5545 RRULE string (include `RRULE:` prefix).1384. Working directories (`cwds`), default to current repo if not specified.1395. Status if explicitly requested; otherwise default to `ACTIVE`.140141When ambiguous, ask for missing details. Examples:142- If user says “daily”/“weekly” without time, ask for required time/day fields.143- If user says “run it for this repo” without paths, confirm repo root as `cwd`.144145## Schedule (RRULE)146- Accept only RFC5545 RRULE strings. Cron expressions are unsupported.147- Rules are canonicalized to `RRULE:`-prefixed form.148- Legacy non-prefixed stored values (`FREQ=...`) are still accepted at run time for compatibility.149- Validation is fail-closed.150- `BYHOUR`/`BYMINUTE` are interpreted in UTC.151- Supported frequencies:152 - `HOURLY` requires `BYMINUTE`153 - `DAILY` requires `BYHOUR` and `BYMINUTE`154 - `WEEKLY` requires `BYDAY`, `BYHOUR`, and `BYMINUTE`155156Example rules:157- Daily at 09:00: `RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0`158- Weekly on Friday at 09:00: `RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0`159- Every 24 hours: `RRULE:FREQ=HOURLY;INTERVAL=24;BYMINUTE=0`160161## Task Examples162### Daily standup summary163Name: `Summarize yesterday's git activity`164Prompt: Summarize yesterday's git activity for standup. Include notable commits, files touched, and any risks or follow-ups.165Schedule: `RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0`166167### Weekly release notes168Name: `Draft weekly release notes`169Prompt: Draft weekly release notes from merged PRs. Include links when available and group by area.170Schedule: `RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0`171172### CI failure triage173Name: `Summarize CI failures`174Prompt: Summarize CI failures and flaky tests from the last CI window, group by root cause, and suggest minimal fixes.175Schedule: `RRULE:FREQ=DAILY;BYHOUR=8;BYMINUTE=30`176177## Data Model Reference178See `references/db.md` for schema and field notes.179180---181> Converted and distributed by [TomeVault](https://tomevault.io/claim/tkersey) — claim your Tome and manage your conversions.182<!-- tomevault:4.0:skill_md:2026-04-11 -->