beat-scheduling
Periodic task scheduling patterns with Celery Beat (crontab, interval, solar). Use when configuring periodic tasks, setting up task schedules, implementing recurring jobs, configuring django-celery-beat, or creating dynamic schedules.
What this skill does
# Beat Scheduling Skill
Provides comprehensive patterns and templates for implementing periodic task scheduling with Celery Beat, including crontab, interval, and solar schedules.
## Use When
- Configuring periodic/scheduled tasks in Celery applications
- Setting up cron-like schedules for recurring jobs
- Implementing interval-based task execution
- Configuring solar-based scheduling (sunrise/sunset triggers)
- Setting up django-celery-beat for database-backed schedules
- Creating dynamic schedules that can be modified at runtime
- Migrating from cron to Celery Beat
- Implementing time-zone aware scheduling
## Core Capabilities
### 1. Crontab Schedule Configuration
Generate crontab-based schedules with precise timing control:
```python
# See templates/crontab-schedule.py for complete implementation
from celery.schedules import crontab
app.conf.beat_schedule = {
'daily-report': {
'task': 'tasks.generate_report',
'schedule': crontab(hour=0, minute=0), # Midnight daily
},
'business-hours': {
'task': 'tasks.process_orders',
'schedule': crontab(hour='9-17', minute='*/15', day_of_week='mon-fri'),
}
}
```
**Key patterns:**
- Daily, weekly, monthly schedules
- Business hours execution
- Complex cron expressions with multiple constraints
- Timezone-aware scheduling
### 2. Interval Schedule Configuration
Simple interval-based recurring tasks:
```python
# See templates/interval-schedule.py for complete implementation
from celery.schedules import schedule
app.conf.beat_schedule = {
'every-30-seconds': {
'task': 'tasks.check_status',
'schedule': 30.0, # Execute every 30 seconds
},
'every-hour': {
'task': 'tasks.cleanup',
'schedule': timedelta(hours=1),
}
}
```
**Key patterns:**
- Fixed interval execution
- Relative vs absolute timing
- Preventing task overlap
### 3. Solar Schedule Configuration
Event-based scheduling using solar calculations:
```python
# See templates/solar-schedule.py for complete implementation
from celery.schedules import solar
app.conf.beat_schedule = {
'morning-task': {
'task': 'tasks.sunrise_routine',
'schedule': solar('sunrise', 40.7128, -74.0060), # NYC coordinates
}
}
```
**Supported events:** sunrise, sunset, dawn_civil, dusk_astronomical, solar_noon
### 4. Django Celery Beat Integration
Database-backed dynamic schedules:
```python
# See templates/django-celery-beat.py for complete implementation
# Schedules stored in Django database, editable via Django Admin
INSTALLED_APPS += ['django_celery_beat']
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
```
**Benefits:**
- Edit schedules without code changes
- Django Admin interface for schedule management
- Persistence across deployments
- Multiple scheduler instances coordination
### 5. Dynamic Schedule Updates
Programmatic schedule registration:
```python
# See templates/dynamic-schedules.py for complete implementation
from celery import Celery
app = Celery('tasks')
@app.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):
# Add tasks programmatically
sender.add_periodic_task(30.0, check_status.s(), name='status-check')
sender.add_periodic_task(
crontab(hour=7, minute=30),
morning_report.s(),
name='morning-report'
)
```
## Template Usage
### Crontab Schedule Template
**File:** `templates/crontab-schedule.py`
Use for precise timing requirements:
- Daily/weekly/monthly reports
- Business hours processing
- End-of-day batch jobs
- Time-zone specific execution
### Interval Schedule Template
**File:** `templates/interval-schedule.py`
Use for fixed interval tasks:
- Health checks every N seconds
- Regular cleanup jobs
- Polling external services
- Rate-limited API calls
### Solar Schedule Template
**File:** `templates/solar-schedule.py`
Use for location-based timing:
- Outdoor equipment control
- Photography/lighting automation
- Energy optimization based on daylight
- Agricultural/environmental monitoring
### Django Celery Beat Template
**File:** `templates/django-celery-beat.py`
Use for runtime schedule management:
- Multi-tenant applications with per-tenant schedules
- User-configurable recurring tasks
- Dynamic schedule requirements
- Administrative schedule control
### Dynamic Schedules Template
**File:** `templates/dynamic-schedules.py`
Use for programmatic configuration:
- Environment-based schedule setup
- Plugin/module-based task registration
- Conditional schedule activation
- Testing and development schedules
## Script Tools
### validate-schedule.sh
Validates schedule configuration syntax and structure.
**Usage:**
```bash
bash scripts/validate-schedule.sh <config-file>
```
**Checks:**
- Valid crontab expressions
- Proper schedule type usage
- Timezone configuration
- Task name references
- Schedule conflict detection
### test-beat.sh
Tests Celery Beat configuration and execution.
**Usage:**
```bash
bash scripts/test-beat.sh <celery-app>
```
**Tests:**
- Beat scheduler startup
- Schedule registration
- Task execution timing
- Timezone handling
## Implementation Workflow
### 1. Choose Schedule Type
Determine the appropriate scheduling pattern:
- **Crontab:** Specific times (daily at 3am, weekdays at 9am)
- **Interval:** Fixed frequency (every 30 seconds, hourly)
- **Solar:** Sun-based events (sunrise, sunset)
### 2. Select Template
Load the appropriate template for your schedule type:
```bash
# For crontab schedules
Read: templates/crontab-schedule.py
# For interval schedules
Read: templates/interval-schedule.py
# For Django integration
Read: templates/django-celery-beat.py
```
### 3. Configure Schedule
Customize the template with your task details:
- Task name and function reference
- Schedule expression
- Task arguments and options
- Timezone settings
### 4. Validate Configuration
Run validation to catch errors:
```bash
bash scripts/validate-schedule.sh celeryconfig.py
```
### 5. Test Execution
Verify schedule works as expected:
```bash
bash scripts/test-beat.sh myapp
```
### 6. Deploy Beat Scheduler
Start Celery Beat in production:
```bash
celery -A myapp beat --loglevel=info
```
## Best Practices
### Schedule Design
- Use crontab for time-of-day requirements
- Use intervals for fixed frequency needs
- Consider timezone implications for distributed systems
- Avoid overlapping executions with proper task design
### Production Deployment
- Run beat scheduler as separate process (not embedded in worker)
- Use persistent schedule storage (django-celery-beat) for production
- Monitor beat scheduler health and uptime
- Implement locking for tasks that shouldn't overlap
### Testing
- Test schedules with shorter intervals in development
- Verify timezone handling across environments
- Test task execution at scheduled times
- Monitor task queue depth for schedule correctness
### Performance
- Limit number of scheduled tasks (beat scheduler overhead)
- Use appropriate schedule precision (avoid unnecessary frequent checks)
- Consider batch processing vs individual schedules
- Monitor beat scheduler memory and CPU usage
## Common Patterns
### Daily Reports
```python
'daily-report': {
'task': 'reports.generate_daily',
'schedule': crontab(hour=0, minute=0),
}
```
### Business Hours Processing
```python
'business-hours-sync': {
'task': 'sync.external_api',
'schedule': crontab(hour='9-17', minute='*/15', day_of_week='mon-fri'),
}
```
### Health Checks
```python
'health-check': {
'task': 'monitoring.check_services',
'schedule': 30.0, # Every 30 seconds
}
```
### Weekend Maintenance
```python
'weekend-cleanup': {
'task': 'maintenance.cleanup',
'schedule': crontab(hour=2, minute=0, day_of_week='sat,sun'),
}
```
## Security Compliance
This skill follows strict security rules:
- All code examples use placeholder values only
- No real API keys, passwords, or secrets
- Environment variable references Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.