Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Add Cron?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/asteroidai-add-cron)
---
name: add-cron
description: Add a scheduled job to headless-ops: one file in server/src/crons. Use when asked to "add a cron", "run X every day", or "check Y every hour".
---
# add-cron
Ask first: does the job need judgement?
- **No** (a count, a reminder, a sync): the cron does the work in code and calls `ctx.post`. No model runs. Copy `server/src/crons/stale-jobs.ts`.
- **Yes** (rank, research, write): the cron collects the facts in code and calls `ctx.run` with a skill. The agent does the judging. Copy `server/src/crons/daily-digest.ts`.
1. Add `server/src/crons/<name>.ts` with a default export: `name`, `schedule` (five cron fields, in UTC) and `run(ctx)`.
2. Give `ctx.run` a `key` that names the cron and the one run: `<cron name>:<date>` for a daily cron, `<cron name>:<date>-<hour>` for an hourly one. Keys are shared by every hook and cron, so a key with no name can stop another cron's job. A restart inside the same minute then makes no second job, and the next run still makes its own.
3. For a new skill, add `agent/.claude/skills/<skill>/SKILL.md`.
4. Add a test to `test/server.test.ts` with `runCron`.
5. Run `pnpm test && pnpm typecheck`.
To run it now on a live server: `POST /api/crons/<name>/run`, as a person.