schedules

$npx mdskill add vercel-labs/hatchery/schedules

Create `schedules/<name>/job.py`. Only direct files with that exact name are discovered; neighboring Python files are ordinary helpers.

SKILL.md

.github/skills/schedulesView on GitHub ↗
---
name: schedules
description: Run Python jobs on durable cron or interval schedules from this agent's workspace.
---

# Scheduled jobs

Create `schedules/<name>/job.py`. Only direct files with that exact name are
discovered; neighboring Python files are ordinary helpers.

Use this for every recurring task. The `signal(note, delay)` tool is only for a
one-shot follow-up in the current conversation; it does not accept cron rules.

```python
"""Remove stale cache entries each morning."""

from hatchery.sdk import prompt

SCHEDULE = {"cron": "0 8 * * *", "tz": "America/New_York"}


def run(job):
    prompt(f"Cleanup ran for slot {job.scheduled_for}")
    return {"complete": True}
```

Use exactly one literal rule:

- `{"cron": "0 8 * * *", "tz": "America/New_York"}` uses five-field cron.
- `{"every": "4h"}` accepts durations of at least one minute ending in `s`, `m`, `h`, or `d`.

Cron defaults to UTC. Always set an IANA `tz` when the team means a local wall
clock. Set `"enabled": False`, assign `SCHEDULE = None`, comment out `SCHEDULE`,
or delete `job.py` to stop the durable ticker after the change reaches `main`.

`run` may be synchronous or asynchronous. It receives `hatchery.sdk.Job` with
`id`, `name`, `scheduled_for`, and `revision`. Return a JSON-compatible dict/list,
text, bytes, or `None`. Scheduled delivery and retries are at least once; use
`job.id` as an idempotency key for external writes.

Jobs share root `requirements.txt`, owner secrets, and the same persistent
`/workspace/data` as API handlers. Put reusable Python modules in top-level `lib/`
so scripts, API routes, and scheduled jobs can import them. Never store secrets in
workspace files. Use `secret_request` for environment values.

`prompt()` works as it does in API routes. Its default conversation key is
`schedule:<name>`, and its default effect key derives from the occurrence ID.

More from vercel-labs/hatchery

SkillDescription
apiPublish HTTP handlers for external webhooks and callbacks on this agent's subdomain.
authAuthentication integration guidance — Clerk (native Vercel Marketplace), Descope, and Auth0 setup for Next.js applications, plus Sign in with Vercel, Vercel Passport, and Vercel KMS. Covers proxy.ts auth patterns, sign-in/sign-up flows, and Marketplace provisioning. Use when implementing user authentication or protecting deployments.
cdn-cachingDebug Vercel CDN caching — cache hit rate, stale content, revalidation behavior, ISR + PPR, per-request cache reasons (cacheReason) and PPR state (ppr_state), and costs.
codingChange code in a repository safely - explore, plan, edit, verify.
create-a-backendBackend architecture guidance. Use when planning, building, or migrating an API or backend; choosing between Functions, Services, containers, Workflow, Queues, and Marketplace databases; or selecting a supported backend framework or runtime.
marketplaceVercel Marketplace expert guidance — discovering, installing, and managing third-party integrations via the `vercel integration` CLI. Use when building any app that needs an external capability without a dedicated skill — commerce (stores, storefronts, selling products), payments (checkout, subscriptions, billing), observability/monitoring, messaging/email, search, or CMS — or when discovering, installing, or managing integrations.
neon>-
neon-postgres>-
queuesVercel Queues guidance — durable topics with at-least-once delivery, independent consumer groups, retries, delays, and idempotency keys via @vercel/queue (JS) or vercel-queue (Python). Use when deferring background work, buffering traffic, fanning out events, or choosing between Queues and Workflows.
vercel-cliVercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, querying metrics, managing domains, managing feature flags with vercel flags, or interacting with the Vercel platform from the command line.