# Cronjob Patterns for Daily Briefings

## Schedule Syntax

| Schedule | Meaning |
|---|---|
| `0 9 * * *` | Daily at 9:00 AM |
| `0 9 * * 1-5` | Weekdays at 9:00 AM |
| `0 9,18 * * *` | Twice daily (9 AM, 6 PM) |
| `0 9 * * 1` | Weekly Monday at 9 AM |
| `*/30 * * * *` | Every 30 minutes (for testing) |

## Toolsets

Briefing cron jobs need:
- `"terminal"` — to run the briefing script
- `"send_message"` — to deliver output to messaging platforms

Other optional toolsets:
- `"web"` — if the briefing script uses web_search internally
- `"browser"` — if the briefing script needs to scrape dynamic pages

## Delivery

Set `deliver: "origin"` to send the briefing message back to the chat that created the cron job.

## Prompt Pattern

The cron job prompt should be explicit:

```
1. Run the briefing script via terminal:
   bash /home/$USER/.hermes/scripts/run_briefing.sh
2. Capture the stdout output
3. Send the exact output via send_message with:
   - target: "whatsapp:Contact Name (dm)"
   - message: <the script output>
```

## no_agent Mode for Simple Watchdogs

If the briefing script itself produces the final message (and you just want to pipe it), you can use `no_agent: true` with a shell command in `script`. However, for multi-step tasks (calendar + news + compliment), the LLM-driven agent mode is more flexible.

## WhatsApp Target Format

Find exact target names:
```
send_message action="list"
```

WhatsApp targets look like:
- `whatsapp:Contact Name (dm)`

## Testing a Cron Job Manually

```
cronjob action=run job_id=<your-job-id>
```

This immediately triggers a run without waiting for the scheduled time.
