schedule

Schedule recurring dog_stack commands using natural language (every 2h, daily 09:00, weekly Mon 10:00). Persists entries in ~/.dog/cron/{id}.json and documents integration with at/cron/systemd-timer. Use when you want to run a command on a recurring schedule.

/dog:schedule — Natural Language Cron Scheduler

Parse natural language schedule expressions, persist entries, and document how to wire them into the OS scheduler.

When to Use

  • Running /dog:health on a schedule (e.g., daily)
  • Polling a canary endpoint every 2 hours after a deploy
  • Running /dog:cso weekly for security posture tracking

When NOT to Use

  • One-time commands — just run them directly
  • Commands that need interactive input

Natural Language Parser

Supported patterns:

InputCron expressionNotes
every 30m*/30 * * * *Every 30 minutes
every 2h0 */2 * * *Every 2 hours
every 6h0 */6 * * *Every 6 hours
daily 09:000 9 * * *Daily at 09:00 local time
daily0 9 * * *Daily at 09:00 (default hour)
weekly Mon 10:000 10 * * 1Every Monday at 10:00
weekly Mon0 9 * * 1Every Monday at 09:00 (default)
hourly0 * * * *Every hour on the hour

Storage Schema

File: ~/.dog/cron/{id}.json

{
  "id": "dog-cron-1713180000",
  "created_at": "2026-04-15T12:00:00Z",
  "schedule_expr": "every 2h",
  "cron_expr": "0 */2 * * *",
  "cmd": "/dog:health",
  "delivery": "stdout",
  "output_path": null,
  "enabled": true
}

Delivery options:

  • stdout — output to terminal (default)
  • file — write to ~/.dog/cron/out/{id}-{ts}.log
  • notify — send desktop notification (requires /dog:notify configured)

Process

Step 1 — Parse schedule

input: "every 2h" "/dog:health"
→ cron_expr: "0 */2 * * *"
→ cmd: "/dog:health"
→ delivery: "stdout" (default)

Step 2 — Generate entry

Create ~/.dog/cron/{id}.json with the schema above.

ID="dog-cron-$(date +%s)"
mkdir -p ~/.dog/cron
cat > ~/.dog/cron/${ID}.json <<EOF
{...}
EOF
echo "Scheduled: ${ID}"

Step 3 — Show OS integration recipe

After saving the entry, print the recipe for the user's platform:

macOS (launchd):

<!-- ~/.dog/cron/{id}.plist -->
<plist version="1.0"><dict>
  <key>Label</key><string>com.dog-stack.{id}</string>
  <key>ProgramArguments</key>
  <array><string>/usr/local/bin/claude</string><string>-p</string><string>/dog:health</string></array>
  <key>StartCalendarInterval</key>
  <dict><key>Minute</key><integer>0</integer></dict>
</dict></plist>
<!-- Install: launchctl load ~/.dog/cron/{id}.plist -->

Linux (cron):

# Add to crontab:
crontab -e
# Append: 0 */2 * * * claude -p "/dog:health" >> ~/.dog/cron/out/{id}.log 2>&1

Linux (systemd-timer):

# ~/.config/systemd/user/dog-{id}.service
[Service]
ExecStart=/usr/local/bin/claude -p "/dog:health"

# ~/.config/systemd/user/dog-{id}.timer
[Timer]
OnCalendar=*-*-* 00/2:00:00
[Install]
WantedBy=timers.target

# Enable: systemctl --user enable --now dog-{id}.timer

Step 4 — List scheduled entries

/dog:schedule list → reads all ~/.dog/cron/*.json files and displays:

ID                    Schedule      Command          Delivery
dog-cron-1713180000   every 2h      /dog:health      stdout
dog-cron-1713190000   daily 09:00   /dog:cso supply  file

Step 5 — Remove entry

/dog:schedule remove {id} → deletes ~/.dog/cron/{id}.json

Verification

ls ~/.dog/cron/*.json | wc -l  # should be > 0 after scheduling
cat ~/.dog/cron/$(ls ~/.dog/cron/ | head -1) | jq .cron_expr

Related

  • Command: /dog:health, /dog:canary, /dog:cso
  • Skill: dog:deployment-patterns
schedule — skill by rogeriojunior31 | Shared Context