---
name: cron-script-jobs
description: Script-only Hermes cron jobs (no_agent) for reliable scheduled automation.
version: 1.0.0
author: Hermes Agent
license: MIT
category: autonomous-ai-agents
---

# Script-only cron jobs

Use this skill when a Hermes cron job should run as a script, not as an LLM-driven agent.

## When to use
- watchdogs and heartbeats
- periodic API pollers
- report generators where the script output is already the message
- jobs that should be silent when nothing changed

## Workflow
1. Write a shell or Python script under `~/.hermes/scripts/`.
2. Make the script authoritative: it decides whether to emit output.
3. Create or update the cron job with `no_agent: true` and `script: <script-name>`.
4. Keep a valid `schedule` on updates.
5. Run the script locally before triggering the cron job.
6. Use `cronjob run` once to validate the end-to-end path.
7. Read stored output: `~/.hermes/cron/output/<job_id>/` stores timestamped `.md` files for every run (success or failure). Each file has a metadata header (Job ID, Run Time, Mode) followed by the script's stdout verbatim. The most recent file by timestamp is the last run's result — useful for reusing the output in dashboards, landings, or reports without re-executing.

## Recommended script structure
- `set -euo pipefail`
- `export LC_ALL=C.UTF-8` and `export LANG=C.UTF-8`
- use a temporary workdir for downloaded assets and intermediate files
- emit structured markdown if the job is meant for chat delivery
- keep stdout empty when the job is intentionally silent

## Cron job shape
- `no_agent: true`
- `script: <relative-script-name>`
- `deliver: origin` or the target platform
- clear prompt content when switching from agent-driven to script-driven mode

## Common pitfalls
- `cronjob update` still needs a valid schedule, even if only the script changes
- a bad script can fail before any useful output exists, so local execution matters
- script-only jobs should not depend on the model/provider state
- UTF-8 issues can corrupt delivered text if the script or locale is not clean

## Reference material
- `references/cron-script-jobs.md` for a hardened example and verification checklist
