Production-ready Celery task templates with error handling, retries, rate limiting, time limits, and custom task classes. Use when creating Celery tasks, implementing retry logic, adding rate limiting, setting time limits, building custom task classes, validating task inputs with Pydantic, handling database operations, making API calls, or when user mentions task patterns, retry mechanisms, task templates, error handling, task best practices.
View on GitHubFebruary 1, 2026
Select agents to install to:
npx add-skill https://github.com/vanman2024/ai-dev-marketplace/blob/main/plugins/celery/skills/task-patterns/SKILL.md -a claude-code --skill task-patternsInstallation paths:
.claude/skills/task-patterns/# Task Patterns Skill Production-ready Celery task templates with comprehensive error handling, retry mechanisms, rate limiting, and custom behavior patterns. ## Overview This skill provides battle-tested templates and patterns for building robust Celery tasks. Each template demonstrates production-ready code with proper error handling, logging, retry logic, and security best practices. ## Core Patterns ### 1. Basic Task Template **Template**: `templates/basic-task.py` Simple task with standard error handling and logging. **Use when**: - Creating your first Celery task - Need straightforward task execution - No complex retry or limiting requirements **Features**: - Proper logging setup - Basic error handling - Synchronous and asynchronous execution examples - Clear docstrings ### 2. Retry Task Template **Template**: `templates/retry-task.py` Tasks with automatic retry mechanisms and exponential backoff. **Use when**: - Calling external APIs that may fail transiently - Database operations that could timeout - Network operations prone to connection issues **Features**: - Automatic retry with `autoretry_for` - Exponential backoff with jitter - Manual retry control - Fixed delay retries - Configurable max retries **Example**: See `examples/task-with-retries.md` for complete implementation guide ### 3. Rate Limited Task Template **Template**: `templates/rate-limited-task.py` Tasks with rate limiting to control execution speed. **Use when**: - Respecting external API rate limits - Protecting database from overload - Controlling resource consumption - Meeting SLA requirements **Features**: - Per-second, per-minute, per-hour limits - Batch processing with rate control - Large dataset handling - Dynamic rate limit adjustment **Example**: See `examples/rate-limiting.md` for complete guide ### 4. Time Limited Task Template **Template**: `templates/time-limited-task.py` Tasks with soft and hard time limits to prevent runaway execution. **Use when**: - L