celery-patterns
Installation
SKILL.md
Celery Patterns for Django
Core Philosophy
- Idempotent tasks: Running a task twice must produce the same result
- Pass IDs, not objects: Arguments must be JSON-serializable
- Always handle failures: Log errors, never swallow exceptions silently
- Proper retry strategies: Use exponential backoff for external services
Task Design
Structure
- Place tasks in
apps/<app>/tasks.py - Use
@shared_taskfor reusable tasks across projects - Use
bind=Truewhen needing access to task instance (retries, task ID, state updates) - Add type hints to task signatures
- Log task start, completion, and failures