mirror of
https://github.com/secondsky/claude-skills.git
synced 2026-09-18 19:54:22 +08:00
292c93845e
- Rewrites AI-sounding text to read human; 8 editing passes + review-only mode - Adapted from jpeggdev/humanize-writing (MIT); npm installer scaffolding dropped - Frontmatter condensed to 238 chars (sync enforces 250 max for single-skill plugins) - Lockstep bump 3.8.0 -> 3.9.0: all 145 plugins, both marketplaces, package.json - CHANGELOG entry for 3.9.0
Cloudflare Cron Triggers
Status: Production Ready ✅ Last Updated: 2025-10-23 Token Savings: ~60% (vs. manual implementation) Errors Prevented: 6 documented issues
Auto-Trigger Keywords
This skill automatically activates when Claude detects:
Core Technologies
- cloudflare cron
- cron triggers
- scheduled workers
- scheduled handler
- cloudflare scheduled
- worker cron
- wrangler cron
Handler Keywords
- scheduled() handler
- scheduled event
- ScheduledController
- scheduled function
- export scheduled
- async scheduled
Configuration Keywords
- triggers.crons
- wrangler.jsonc cron
- cron configuration
- wrangler triggers
- cron expression
- cron syntax
Use Cases
- periodic tasks
- scheduled tasks
- background jobs
- maintenance tasks
- scheduled execution
- automated tasks
- recurring jobs
- scheduled workflow
Common Errors
- "scheduled handler not found"
- "handler does not export"
- "cron expression invalid"
- "changes not propagating"
- "cron not executing"
- "wrong execution time"
- "UTC timezone"
- "CPU time limit exceeded"
Related Features
- green compute
- workflow triggers
- scheduled maintenance
- data collection
- report generation
- database cleanup
What This Skill Provides
Complete knowledge domain for Cloudflare Cron Triggers - scheduling Workers to execute periodically using cron expressions.
Key Topics Covered
-
Scheduled Handler Setup
- Correct ES modules format
- Handler naming requirements
- TypeScript types
-
Cron Expression Syntax
- 5-field format explanation
- Common patterns library
- Validation guidelines
-
Configuration
- wrangler.jsonc setup
- Multiple cron triggers
- Environment-specific schedules
-
Testing
- Local development with
--test-scheduled /__scheduledendpoint- Debugging scheduled handlers
- Local development with
-
Integration Patterns
- Standalone scheduled Worker
- Combined with Hono (fetch + scheduled)
- Multiple schedules with routing
- Accessing environment bindings
- Triggering Workflows
-
UTC Timezone Handling
- All crons run on UTC
- Time zone conversion guide
- DST considerations
Known Issues Prevented
| Issue | Error Message | Prevention |
|---|---|---|
| Propagation Delay | Changes not taking effect | Document 15-minute wait time |
| Wrong Handler Name | "Handler does not export" | Enforce exact scheduled name |
| UTC Confusion | Cron runs at wrong time | Timezone conversion guide |
| Invalid Syntax | Cron doesn't execute | Validation with Crontab Guru |
| Service Worker Format | "Must use ES modules" | ES modules examples |
| CPU Limits | "CPU time exceeded" | Limits configuration guide |
Quick Example
// src/index.ts
export default {
async scheduled(
controller: ScheduledController,
env: Env,
ctx: ExecutionContext
): Promise<void> {
console.log('Cron executed:', controller.cron);
await performScheduledTask(env);
},
};
// wrangler.jsonc
{
"triggers": {
"crons": ["0 * * * *"] // Every hour
}
}
# Test locally
npx wrangler dev --test-scheduled
curl "http://localhost:8787/__scheduled?cron=0+*+*+*+*"
When to Use This Skill
Use this skill when:
- ✅ Setting up scheduled Workers for the first time
- ✅ Configuring cron expressions in wrangler.jsonc
- ✅ Combining scheduled handlers with Hono
- ✅ Testing cron triggers locally
- ✅ Converting local timezone to UTC
- ✅ Handling multiple cron schedules
- ✅ Troubleshooting cron execution issues
- ✅ Integrating crons with Workflows
- ✅ Enabling Green Compute for scheduled tasks
- ✅ Understanding ScheduledController API
Official Documentation
- Cloudflare Docs: https://developers.cloudflare.com/workers/configuration/cron-triggers/
- Scheduled Handler API: https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/
- Cron Examples: https://developers.cloudflare.com/workers/examples/cron-trigger/
Related Skills
- cloudflare-worker-base - Required for Worker setup
- cloudflare-workflows - For long-running scheduled tasks
- cloudflare-queues - For async processing triggered by crons
- cloudflare-d1 - For database operations in scheduled handlers
License: MIT Maintainer: Claude Skills Maintainers | maintainers@example.com