# Scheduling

The scheduler at `core/tools/scheduler/` manages recurring tasks using OS-native scheduling backends (launchd on macOS, cron, systemd on Linux, schtasks on Windows).


## Schedule definitions

Live in `schedules/` at the repo root as JSON files:

```json
{
  "id": "distillation-sweep",
  "name": "Daily Distillation Sweep",
  "schedule": "0 3 * * *",
  "command": "node core/tools/distill/bin/distill",
  "workingDirectory": "${DAVE_ROOT}",
  "enabled": true,
  "backend": null,
  "description": "Run the librarian distillation sweep daily at 3am"
}
```

Commands in schedules are cross-platform Node entry points; never shell scripts; so the same definition runs on macOS, Linux, and Windows.


## Common commands

```
node core/tools/scheduler/detect.mjs                              # Detect available backends
node core/tools/scheduler/install.mjs schedules/my-task.json      # Install a schedule
node core/tools/scheduler/list.mjs                                # List installed schedules
node core/tools/scheduler/remove.mjs my-task                      # Remove a schedule
```

The `/schedule` slash command provides an interactive interface for managing schedules. Use it when the operator asks about recurring tasks, backups, sync jobs, or health checks.
