Agentic-skills celery-development-best-practices
Comprehensive Celery distributed task queue framework with 60+ prioritized rules across configuration, task execution, Canvas workflows, monitoring, security, performance, routing, periodic tasks, serialization, worker management, and advanced patterns. Use when implementing background tasks, periodic jobs, or distributed processing with Celery.
git clone https://github.com/GNSubrahmanyam/agentic-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/GNSubrahmanyam/agentic-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/celery" ~/.claude/skills/gnsubrahmanyam-agentic-skills-celery-development-best-practices && rm -rf "$T"
skills/celery/SKILL.mdCelery Development Best Practices
Comprehensive background task processing framework with 60+ prioritized rules across 21 categories for building reliable, scalable distributed task systems with Celery.
When to Apply
Reference these guidelines when:
- Implementing background task processing
- Setting up distributed job queues
- Configuring periodic tasks with Celery Beat
- Optimizing task performance and reliability
- Monitoring and debugging Celery applications
- Implementing task routing and result handling
- Managing Celery workers and brokers
- Ensuring security in distributed task environments
- Designing complex workflows with Canvas primitives
- Handling serialization and data transmission
- Deploying Celery in production environments
Rule Categories by Priority
| Priority | Category | Rules | Impact | Prefix |
|---|---|---|---|---|
| 1 | Configuration & Setup | 2 | CRITICAL | |
| 2 | Task Definition & Execution | 3 | CRITICAL | |
| 3 | Error Handling & Reliability | 1 | HIGH | |
| 4 | Canvas: Designing Work-flows | 4 | HIGH | |
| 5 | Monitoring & Logging | 2 | HIGH | / |
| 6 | Performance & Scaling | 2 | MEDIUM-HIGH | |
| 7 | Security | 1 | MEDIUM-HIGH | |
| 8 | Result Backends | 2 | MEDIUM-HIGH | |
| 9 | Routing & Queues | 1 | MEDIUM | |
| 10 | Periodic Tasks | 1 | MEDIUM | |
| 11 | Serialization | 1 | MEDIUM | |
| 12 | Worker Management | 1 | MEDIUM | |
| 13 | Signals and Events | 1 | MEDIUM | |
| 14 | Remote Control and Inspection | 1 | MEDIUM | |
| 15 | Testing Celery Applications | 1 | MEDIUM-HIGH | |
| 16 | Daemonization and Process Management | 1 | MEDIUM | |
| 17 | Debugging Celery Applications | 1 | HIGH | |
| 18 | Extensions and Bootsteps Customization | 1 | LOW | |
| 19 | Advanced Patterns | 1 | LOW | |
Quick Reference
1. Configuration & Setup (CRITICAL)
: Properly configure message broker (Redis/RabbitMQ)config-broker-setup
: Separate configurations for different environmentsconfig-environment-separation
2. Task Definition & Execution (CRITICAL)
: Choose appropriate calling methods (delay/apply_async/call)task-calling-methods
: Ensure tasks are atomic and idempotenttask-atomic-operations
3. Error Handling & Reliability (HIGH)
: Implement intelligent retry mechanismserror-retry-strategy
2. Task Definition & Execution (CRITICAL)
: Choose appropriate calling methods (delay/apply_async/call)task-calling-methods
: Ensure tasks are atomic and idempotenttask-atomic-operations
: Configure task behavior and reliability optionstask-options-configuration
3. Error Handling & Reliability (HIGH)
: Implement intelligent retry mechanismserror-retry-strategy
4. Canvas: Designing Work-flows (HIGH)
: Sequential task execution and error propagationcanvas-chain-workflows
: Parallel task execution for performancecanvas-group-parallel
: Complex workflows with parallel execution and synchronizationcanvas-chord-synchronization
: Efficient batch processing and data transformationscanvas-map-starmap
5. Monitoring & Logging (HIGH)
: Track task execution and performancemonitoring-task-tracking
: Performance optimization and issue detectionperf-monitoring-metrics
6. Performance & Scaling (MEDIUM-HIGH)
: Optimize worker concurrency settingsperf-concurrency-tuning
7. Security (MEDIUM-HIGH)
: Prevent unauthorized task executionsecurity-task-authentication
8. Result Backends (MEDIUM-HIGH)
: Choose appropriate result backendresult-backend-selection
: Manage result expiration policiesresult-expiry-management
9. Routing & Queues (MEDIUM)
: Intelligent task routing and queue managementrouting-task-distribution
10. Periodic Tasks (MEDIUM)
: Reliable scheduled task executionperiodic-celery-beat
11. Serialization (MEDIUM)
: Reliable data transmission and storageserial-data-handling
12. Worker Management (MEDIUM)
: Reliable worker operation and resource managementworker-lifecycle-management
13. Signals and Events (MEDIUM)
: Hook into Celery events for monitoring and extensionsignals-events-system
14. Remote Control and Inspection (MEDIUM)
: Runtime management and troubleshooting of workersremote-control-inspection
15. Testing Celery Applications (MEDIUM-HIGH)
: Comprehensive testing strategies for async applicationstesting-celery-applications
16. Daemonization and Process Management (MEDIUM)
: Production deployment and service managementdaemonization-process-management
17. Debugging Celery Applications (HIGH)
: Effective troubleshooting and issue resolutiondebugging-celery-applications
18. Advanced Performance Optimization (MEDIUM-HIGH)
: High-throughput optimization techniquesadvanced-performance-optimization
19. Extensions and Bootsteps Customization (LOW)
: Advanced customization and extensionextensions-bootsteps-customization
20. Advanced Patterns (LOW)
: Complex workflow orchestrationadvanced-task-chaining
How to Use
Read individual rule files for detailed explanations and code examples:
rules/config-broker-setup.md # Broker configuration rules/task-calling-methods.md # Task execution methods rules/task-options-configuration.md # Task behavior options rules/canvas-chain-workflows.md # Sequential workflows rules/canvas-group-parallel.md # Parallel execution rules/canvas-chord-synchronization.md # Complex synchronization rules/canvas-map-starmap.md # Batch processing rules/monitoring-task-tracking.md # Task monitoring rules/result-backend-selection.md # Result storage rules/routing-task-distribution.md # Task routing rules/periodic-celery-beat.md # Scheduled tasks rules/serial-data-handling.md # Data serialization rules/signals-events-system.md # Event hooking rules/remote-control-inspection.md # Worker management rules/testing-celery-applications.md # Testing strategies rules/security-task-authentication.md # Task security rules/daemonization-process-management.md # Production deployment rules/debugging-celery-applications.md # Troubleshooting rules/advanced-performance-optimization.md # High-performance tuning rules/extensions-bootsteps-customization.md # Advanced customization
Each rule file contains:
- Impact level and category
- Problem description with consequences
- Solution with code examples
- Common mistakes to avoid
- When to apply the rule
Reference Documentation
Detailed guides for complex topics:
references/worker-management.md # Worker deployment and scaling
Additional reference guides planned: monitoring setup, troubleshooting, Canvas patterns
Full Compiled Document
For the complete Celery best practices guide with all rules expanded:
AGENTS.md
Celery Version Support: Compatible with Celery 4.x, 5.x, and 6.x (latest)</content> <parameter name="filePath">skills/celery-skill/SKILL.md