lbedner/aegis-stack/add-scheduled-job
Claude Code and agent skill by lbedner/aegis-stack
- community
Checking that the SKILL.md file is still in the repository.
Use when adding a job that runs on a schedule (periodic or at a fixed time) in this project. Covers writing the job function and listing it in its service's scheduled_jobs.py.
Install
npx vskill@latest install lbedner/aegis-stack/add-scheduled-jobSKILL.md
Add scheduled job
Each service lists its scheduled work as JOBS in app/services/<service>/scheduled_jobs.py; the scheduler finds every such module on disk (app.core.schedule.service_jobs) and schedules every entry. In a project with a worker, the scheduler only enqueues: each entry is scheduled as an enqueue of the job's function name onto the system queue, and the worker registers the same entry as a task under that name and runs it. Without a worker, the scheduler runs the job itself.
When to use
Use when work must run periodically or at a fixed time (a cron-like schedule).
Do NOT use for work triggered by a request (see the add-background-job skill if a worker is present, or add-api-endpoint for a synchronous route).
Files that change
app/services/<service>/jobs.py: the job function, with the service it
belongs to.
app/services/<service>/scheduled_jobs.py: import the job function and add
a ServiceJob entry to JOBS (function, id, name, trigger, and a timeout if a worker should let it run past the queue's five minutes). Create the file if the service has none; nothing else needs editing.
Procedure
- Write the failing test first for the job function's behavior, independent
of the schedule. Confirm it fails for the right reason.
- Write the job as an
async deftaking no arguments that does one unit of
work.
- Add a
ServiceJobto the service'sJOBS: the function, a stable id, a display
name, and the trigger as add_job keyword arguments (for example {"trigger": "cron", "hour": 3}).
- Keep the job idempotent: a schedule can fire late or twice, and a failed
write-back runs it again, so a run must be safe to repeat.
- Run the gates and fix anything red.
Gates
make check: lint, typecheck, and test. With a worker,
tests/components/test_scheduler_jobs.py fails if a scheduled name is not a registered worker task.
Pitfalls
- A job function that is not in some service's
JOBSnever runs. - A
scheduled_jobs.pywithoutJOBS, or two entries sharing an id or a
function name, fails at startup rather than scheduling the wrong thing.
- Do not call
scheduler.add_job(...)for a service job inmain.py: with a
worker it would run in the scheduler process, outside the worker's limits and retries.
- The scheduler's run history times the enqueue when a worker is present; the
job's own run time is on the worker's page.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingaegis/templates/copier-aegis-project/{{ project_slug }}/.claude/skills/add-scheduled-job/SKILL.md
Popularity
- Repository stars
- 130
- Repository forks
- 10
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lbedner/aegis-stack/add-scheduled-job)