business-ops
Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales, productivity, product management.
Generate headless Claude Code cron jobs with safety.
$ npx -y skills add notque/vexjoy-agent --skill headless-cron-creator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/headless-cron-creatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate headless Claude Code cron jobs with safety.
name: headless-cron-creator
promoted_to: cron-automation
description: "Generate headless Claude Code cron jobs with safety."
user-invocable: false
argument-hint: "<name> <schedule> <prompt>"
agent: python-general-engineer
allowed-tools:
- Read
- Write
- Bash
- Edit
- Glob
- Grep
routing:
triggers:
- "create cron job"
- "scheduled task"
- "headless agent"
- "background automation"
- "recurring agent"
category: process
pairs_with:
- cron-job-auditor
- shell-process-patternsGenerate headless Claude Code cron jobs from a task description and schedule. Creates a wrapper script with safety mechanisms (lockfile, budget cap, dry-run default, logging) and installs crontab entries. All crontab mutations go through `scripts/crontab-manager.py`, which writes to temp files and creates timestamped backups in `~/.claude/crontab-backups/` before every change -- never pipe directly to `crontab -` because a mid-stream pipe failure wipes the entire crontab.
Extract job parameters from the user's request.
**Required parameters**:
**Optional parameters** (with defaults):
**Human-readable schedule conversion** -- use off-minutes (7, 23, 47) instead of `:00`/`:30` because every cron job on the system fires at round minutes, creating load spikes:
| Human Input | Cron Expression | |-------------|----------------| | every 12 hours | `7 */12 * * *` | | twice daily | `7 8,20 * * *` | | hourly | `23 * * * *` | | daily at 6am | `7 6 * * *` | | weekly on sunday | `7 9 * * 0` | | every 30 minutes | `*/30 * * * *` |
**Gate**: All required parameters extracted. Proceed to Phase 2.
Create the wrapper script using `crontab-manager.py generate-wrapper`. Embed the prompt via bash heredoc to avoid escaping issues.
python3 ~/.claude/scripts/crontab-manager.py generate-wrapper \
--name "{name}" \
--prompt "{prompt}" \
--schedule "{schedule}" \
--workdir "{workdir}" \
--budget "{budget}" \
--allowed-tools "{allowed_tools}"Review the generated script. Verify it contains:
Do not use the `CronCreate` tool -- it is session-scoped (dies when the session ends, auto-expires after 7 days). Use system `crontab` via `crontab-manager.py` instead.
**Gate**: Script generated and reviewed. Proceed to Phase 3.
Verify the generated script meets cron best practices.
1. Run the script in dry-run mode:
bash -n scripts/{name}-cron.sh # syntax check2. Run `cron-job-auditor` checks:
**Gate**: All checks pass. Proceed to Phase 4.
Install the crontab entry. Every entry gets a `# claude-cron: <tag>` marker so `crontab-manager.py` can identify and manage only its own entries without touching non-Claude crontab lines. All paths in the crontab entry must be absolute because cron has minimal PATH.
1. Show the proposed entry:
python3 ~/.claude/scripts/crontab-manager.py add \
--tag "{name}" \
--schedule "{schedule}" \
--command "{absolute_script_path} --execute >> {logdir}/cron.log 2>&1" \
--dry-run2. **Ask the user for confirmation** before installing. Never install without explicit approval.
3. If confirmed:
python3 ~/.claude/scripts/crontab-manager.py add \
--tag "{name}" \
--schedule "{schedule}" \
--command "{absolute_script_path} --execute >> {logdir}/cron.log 2>&1"4. Verify:
python3 ~/.claude/scripts/crontab-manager.py verify --tag "{name}"**Gate**: Entry installed and verified. Proceed to Phase 5.
Summarize the created cron job and print the exact commands to test and manage it.
Output:
python3 ~/.claude/scripts/crontab-manager.py list # see all claude cron jobs
python3 ~/.claude/scripts/crontab-manager.py verify --tag {name} # health check
python3 ~/.claude/scripts/crontab-manager.py remove --tag {name} # uninstallTo modify an existing wrapper script, regenerate it with `--force` rather than editing in place.
Cause: A cron entry with this tag is already installed. Solution: Either `remove --tag {name}` first, or choose a different name.
Cause: Cron has minimal PATH; `claude` isn't in it. Solution: `generate-wrapper` resolves the absolute path to `claude
Essays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.
Repo: notque/vexjoy-agent
Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales, productivity, product management.
Design workflows — UX copy, design systems, design critique, accessibility review, design handoff, user research synthesis. Use when writing UI copy, reviewing…
Marketing: SEO audits, campaign planning, content strategy, email sequences, competitive analysis, brand review, performance reporting.