cron-scheduler-expert
Skill75 starsChanged 39 days agoMITView on GitHub
Expert guide for scheduled tasks, cron jobs, recurring background work (Vercel Cron, Cloudflare Workers Cron, Inngest, node-cron), and distributed scheduling / Panduan ahli untuk tugas terjadwal, cron job, pekerjaan latar belakang berulang, dan penjadwalan terdistribusi.
- Reads credentials
In this repository149 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/vibes-plug-core.mdcCursor rule
- accessibility-testing-expertSkill
- adaptive-model-cascadeSkill
- affective-computing-emotion-aiSkill
- agentic-coding-workflow-expertSkill
- agentic-memory-architectSkill
- agentic-micro-economy-architectSkill
- ai-code-review-autonomousSkill
- ai-llm-integration-expertSkill
- ai-media-generation-expertSkill
- ai-prompt-engineering-expertSkill
- ai-safety-governance-expertSkill
- angular-expertSkill
- anti-slopSkill
- api-design-expertSkill
- api-gateway-proxy-expertSkill
- app-analyzer-optimizerSkill
- apple-ecosystem-expertSkill
- app-promo-media-expertSkill
- astro-framework-expertSkill
- async-queue-temporal-expertSkill
- authentication-identity-expertSkill
- autonomous-api-drift-healerSkill
- autonomous-red-teamerSkill
- autonomous-tdd-debuggerSkill
- biome-linter-formatter-expertSkill
- blockchain-web3-expertSkill
- brainstormingSkill
- browser-automation-expertSkill
- bun-runtime-expertSkill
- chatbot-messaging-expertSkill
- ci-cd-devops-architectSkill
- cloud-hosting-expertSkill
- coderabbitSkill
- compliance-gdpr-privacy-expertSkill
- composable-mach-architectSkill
- context-window-engineerSkill
- database-orm-expertSkill
- data-pipeline-etl-expertSkill
- data-telemetry-expertSkill
- data-visualization-expertSkill
- deep-research-analystSkill
- dependency-upgrade-migratorSkill
- design-system-architectSkill
- desktop-electron-expertSkill
- documentation-site-expertSkill
- doku-mcp-serverSkill
- doku-payment-gatewaySkill
- domain-driven-design-expertSkill
- e2e-testing-expertSkill
- ecommerce-expertSkill
- email-notification-expertSkill
- ephemeral-generative-ui-architectSkill
- ephemeral-wasm-sandbox-executorSkill
- error-resilience-expertSkill
- event-driven-architectSkill
- feature-flag-analytics-expertSkill
- file-upload-media-expertSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Recommendation: Use Vercel Cron for Next.js apps on Vercel.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cron & Scheduler Expert (2026 Edition)
English | Bahasa Indonesia
<a name="english"></a>
English
Orchestration & Integration
Connects and orchestrates with relevant domain skills like brainstorming, zero-to-prod-orchestrator, and session-memory-manager to ensure cohesive execution.
Description
Production-grade guide for implementing scheduled tasks, cron jobs, and recurring background work in modern web applications. Covers Vercel Cron Jobs, Cloudflare Workers Cron Triggers, Inngest scheduled functions, node-cron, BullMQ repeatable jobs, distributed cron locking (Redis-based), timezone-aware scheduling, and common use cases (cleanup jobs, report generation, health checks, subscription renewals).
Trigger Conditions
Activate this skill when:
- Setting up scheduled/recurring tasks (daily reports, cleanup, health checks).
- Configuring Vercel Cron Jobs or Cloudflare Workers Cron Triggers.
- Implementing subscription renewal checks or billing cycle jobs.
- Building data aggregation or ETL pipelines on a schedule.
- Needing distributed cron locking to prevent duplicate execution.
- Scheduling email digests or notification batches.
Platform Selection Guide
| Platform | Best For | Max Frequency | Invocation Model |
| Vercel Cron | Vercel-hosted Next.js apps | 1/min (Pro), 1/day (Hobby) | HTTP endpoint trigger |
| Cloudflare Workers Cron | Edge-first apps | 1/min | Worker script trigger |
| Inngest | Complex workflows, fan-out | Any (event-driven) | Serverless function |
| BullMQ Repeatable | Self-hosted, Redis-backed | Any | Worker process |
| node-cron | Simple Node.js servers | Any | In-process |
| Trigger.dev v3 | Durable scheduled tasks | Any | Serverless function |
Recommendation: Use Vercel Cron for Next.js apps on Vercel. Use Inngest for complex multi-step scheduled workflows. Use BullMQ repeatable jobs for self-hosted environments.
1. Vercel Cron Jobs
// vercel.json
{
"crons": [
{
"path": "/api/cron/daily-cleanup",
"schedule": "0 3 * * *"
},
{
"path": "/api/cron/hourly-health-check",
"schedule": "0 * * * *"
},
{
"path": "/api/cron/weekly-report",
"schedule": "0 9 * * 1"
}
]
}// app/api/cron/daily-cleanup/route.ts
import { NextResponse } from 'next/server';
export async function GET(request: Request) {
// Verify the request is from Vercel Cron (not public)
const authHeader = request.headers.get('authorization');
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
try {
// Cleanup expired sessions
const deletedSessions = await db.delete(sessions)
.where(lt(sessions.expiresAt, new Date()));
// Cleanup orphaned uploads (older than 24h, not linked to any record)
const deletedUploads = await db.delete(uploads)
.where(and(
isNull(uploads.linkedRecordId),
lt(uploads.createdAt, new Date(Date.now() - 86400000)),
));
return NextResponse.json({
ok: true,
cleaned: { sessions: deletedSessions.rowCount, uploads: deletedUploads.rowCount },
});
} catch (error) {
console.error('Daily cleanup failed:', error);
return NextResponse.json({ ok: false, error: 'Cleanup failed' }, { status: 500 });
}
}
export const runtime = 'nodejs';
export const maxDuration = 60; // Allow up to 60s for cleanup2. Inngest Scheduled Functions
// inngest/functions/weekly-report.ts
import { inngest } from '@/lib/inngest';
export const weeklyReportJob = inngest.createFunction(
{
id: 'weekly-usage-report',
name: 'Generate Weekly Usage Report',
},
{ cron: 'TZ=Asia/Jakarta 0 9 * * 1' }, // Every Monday 9 AM WIB
async ({ step }) => {
// Step 1: Gather data
const metrics = await step.run('gather-metrics', async () => {
return await db.query.usageMetrics.findMany({
where: gte(usageMetrics.createdAt, subDays(new Date(), 7)),
});
});
// Step 2: Generate report
const report = await step.run('generate-report', async () => {
return generateWeeklyReport(metrics);
});
// Step 3: Send to admins
await step.run('send-report', async () => {
const admins = await db.query.users.findMany({
where: eq(users.role, 'admin'),
});
for (const admin of admins) {
await emailQueue.add('weekly-report', { to: admin.email, report });
}
});
return { sent: true, reportId: report.id };
},
);3. BullMQ Repeatable Jobs
// queues/scheduled-jobs.ts
import { Queue, Worker } from 'bullmq';
const scheduledQueue = new Queue('scheduled', {
connection: { host: process.env.REDIS_HOST },
});
// Add repeatable jobs on startup
export async function registerScheduledJobs() {
// Daily cleanup at 3 AM
await scheduledQueue.add('daily-cleanup', {}, {
repeat: { pattern: '0 3 * * *', tz: 'Asia/Jakarta' },
jobId: 'daily-cleanup', // Prevent duplicates on restart
});
// Every 5 minutes: health check
await scheduledQueue.add('health-check', {}, {
repeat: { every: 5 * 60 * 1000 }, // 5 minutes in ms
jobId: 'health-check',
});
// Monthly: subscription renewal check (1st of each month at midnight)
await scheduledQueue.add('subscription-renewal', {}, {
repeat: { pattern: '0 0 1 * *', tz: 'Asia/Jakarta' },
jobId: 'subscription-renewal',
});
}
// Worker
const worker = new Worker('scheduled', async (job) => {
switch (job.name) {
case 'daily-cleanup':
await performDailyCleanup();
break;
case 'health-check':
await performHealthCheck();
break;
case 'subscription-renewal':
await checkSubscriptionRenewals();
break;
}
}, { connection: { host: process.env.REDIS_HOST } });4. Distributed Cron Locking (Redis)
// lib/cron-lock.ts
import { Redis } from 'ioredis';
const redis = new Redis(process.env.REDIS_URL!);
/**
* Acquire a distributed lock to prevent duplicate cron execution
* across multiple server instances.
*/
export async function acquireCronLock(
jobName: string,
ttlSeconds: number = 300,
): Promise<boolean> {
const lockKey = `cron-lock:${jobName}`;
// SET NX (only if not exists) with TTL
const result = await redis.set(lockKey, Date.now().toString(), 'EX', ttlSeconds, 'NX');
return result === 'OK';
}
export async function releaseCronLock(jobName: string): Promise<void> {
await redis.del(`cron-lock:${jobName}`);
}
// Usage in cron handler
export async function GET(request: Request) {
const locked = await acquireCronLock('daily-cleanup', 300);
if (!locked) {
return Response.json({ skipped: true, reason: 'Already running on another instance' });
}
try {
await performDailyCleanup();
return Response.json({ ok: true });
} finally {
await releaseCronLock('daily-cleanup');
}
}Common Cron Patterns
| Schedule | Cron Expression | Description |
| Every minute | * * * * * | Health checks, queue monitoring |
| Every 5 minutes | */5 * * * * | Cache warming, metric aggregation |
| Every hour | 0 * * * * | Data sync, report generation |
| Daily at 3 AM | 0 3 * * * | Cleanup, backups |
| Weekly Monday 9 AM | 0 9 * * 1 | Weekly reports |
| Monthly 1st at midnight | 0 0 1 * * | Billing cycles, subscription renewals |
| Weekdays at 8 AM | 0 8 * * 1-5 | Business notifications |
Common Pitfalls to Avoid
| Anti-Pattern | Problem | Correct Approach |
| No distributed locking | Duplicate execution across instances | Use Redis-based NX lock |
| Long-running cron without timeout | Resource exhaustion, overlapping runs | Set maxDuration and use lock TTL |
| No monitoring of cron failures | Silent failures go unnoticed | Log results, alert on failures |
| Hardcoded timezone | Jobs run at wrong time after DST | Always use explicit tz parameter |
| Cron job does too much work | Timeout, partial completion | Break into smaller steps (Inngest/Temporal) |
Integration with Other Skills
async-queue-temporal-expert— BullMQ repeatable jobs, Inngest scheduled functionscloud-hosting-expert— Vercel Cron, Cloudflare Workers Cron configurationsaas-billing— Subscription renewal checks, billing cycle jobsemail-notification-expert— Scheduled email digests, daily summariesdata-telemetry-expert— Scheduled metric aggregation and reportinglogging-error-tracking-expert— Cron job failure monitoring
<a name="bahasa-indonesia"></a>
Bahasa Indonesia
Integrasi Orkestrasi
Terhubung dan mengorkestrasi skill domain yang relevan seperti brainstorming, zero-to-prod-orchestrator, dan session-memory-manager untuk memastikan eksekusi yang kohesif.
Deskripsi
Panduan tingkat produksi untuk mengimplementasikan tugas terjadwal, cron job, dan pekerjaan latar belakang berulang di aplikasi web modern. Mencakup Vercel Cron Jobs, Cloudflare Workers Cron Triggers, Inngest scheduled functions, node-cron, BullMQ repeatable jobs, distributed cron locking (berbasis Redis), penjadwalan sadar zona waktu, dan kasus penggunaan umum (pembersihan data, pembuatan laporan, health check, perpanjangan langganan).
Kondisi Pemicu
Aktifkan skill ini ketika:
- Menyiapkan tugas terjadwal/berulang (laporan harian, pembersihan, health check).
- Mengonfigurasi Vercel Cron Jobs atau Cloudflare Workers Cron Triggers.
- Mengimplementasikan pemeriksaan perpanjangan langganan atau siklus billing.
- Membangun pipeline agregasi data atau ETL pada jadwal tertentu.
- Membutuhkan penguncian cron terdistribusi untuk mencegah eksekusi duplikat.
Integrasi dengan Skill Lain
async-queue-temporal-expert— BullMQ repeatable jobs, Inngest scheduled functionscloud-hosting-expert— Konfigurasi Vercel Cron, Cloudflare Workers Cronsaas-billing— Pemeriksaan perpanjangan langganan, siklus billingemail-notification-expert— Digest email terjadwal, ringkasan hariandata-telemetry-expert— Agregasi metrik terjadwal dan pelaporan
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.

