cron-jobs
Skill8 starsChanged 7 months agoMITView on GitHub
Scheduled tasks with Vercel Cron, Inngest, node-cron, crontab syntax, and error handling.
- Reads credentials
Files
Cron Jobs
Rules
- Vercel Cron: define in
vercel.jsonwith{ "crons": [{ "path": "/api/cron/task", "schedule": "0 * * * *" }] } - Secure cron endpoints: verify
Authorization: Bearer ${CRON_SECRET}header — prevent unauthorized invocations - Idempotent handlers — cron jobs can fire twice; always check if work was already done
- Timeout awareness: Vercel functions timeout at 10s (hobby) / 60s (pro) — offload long tasks to queues
- Inngest for complex scheduling:
inngest.createFunction({ id: "...", cron: "0 9 * * *" }, handler) - node-cron for self-hosted:
cron.schedule("*/5 * * * *", task)— only for persistent servers - Crontab syntax:
minute hour day month weekday— use https://crontab.guru to verify - Log every run with start time, end time, success/failure, items processed
- Error handling: wrap in try/catch, report failures to logging/alerting, don't let one failure stop the next run
Patterns
// vercel.json
{
"crons": [
{ "path": "/api/cron/daily-report", "schedule": "0 9 * * *" },
{ "path": "/api/cron/cleanup", "schedule": "0 0 * * 0" }
]
}// Cron route handler
export async function GET(req: Request) {
const authHeader = req.headers.get("authorization");
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response("Unauthorized", { status: 401 });
}
try {
const result = await runScheduledTask();
return Response.json({ success: true, processed: result.count });
} catch (error) {
console.error("Cron job failed:", error);
return Response.json({ success: false, error: String(error) }, { status: 500 });
}
}Common Schedules
| Schedule | Cron | Description |
| Every hour | 0 * * * * | Top of each hour |
| Daily 9am UTC | 0 9 * * * | Morning reports |
| Weekly Sunday | 0 0 * * 0 | Cleanup tasks |
| Every 5 min | */5 * * * * | Polling/sync |
Avoid
- Exposing cron endpoints without auth — anyone could trigger them
- Long-running work inside the handler — offload to a queue for tasks > 10s
- Assuming exact timing — cron jobs can be delayed; design for idempotency
- Forgetting error handling — one uncaught error should not break the schedule
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- openai/plugins★ 7.4ksame name
- ffsshhttiikk/opencode-agents-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository110 other files it gives its agents.
- yepapiSkill
- ab-testingSkill
- accessibilitySkill
- admin-panelSkill
- ai-agentsSkill
- ai-chatbotSkill
- ai-visibilitySkill
- analyticsSkill
- animationsSkill
- api-designSkill
- api-documentationSkill
- api-securitySkill
- auth-securitySkill
- authSkill
- background-jobsSkill
- backlink-researchSkill
- blog-engineSkill
- caching-strategySkill
- chartsSkill
- cli-toolsSkill
- code-reviewSkill
- command-paletteSkill
- comments-discussionsSkill
- competitor-researchSkill
- content-marketingSkill
- content-researchSkill
- content-strategySkill
- copywritingSkill
- csrf-protectionSkill
- dark-modeSkill
- dashboard-designSkill
- databaseSkill
- data-encryptionSkill
- data-pipelinesSkill
- data-visualizationSkill
- dependency-securitySkill
- deploymentSkill
- drag-and-dropSkill
- drizzle-ormSkill
- e2e-testingSkill
- e-commerceSkill
- email-marketingSkill
- emailSkill
- error-handlingSkill
- error-securitySkill
- express-fastifySkill
- feature-flagsSkill
- file-uploadsSkill
- financial-planningSkill
- formsSkill
- funnel-analyticsSkill
- gdpr-complianceSkill
- git-workflowSkill
- i18nSkill
- image-optimizationSkill
- infinite-scrollSkill
- input-validationSkill
- invoice-generatorSkill
- keyword-researchSkill
- landing-pagesSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

