Background jobs is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Implements background job processing using Bull/BullMQ (Node.js), Celery (Python), Sidekiq (Ruby), and cron scheduling. Covers job prioritization, retry strategies (exponential backoff), dead letter handling, job monitoring, rate-limited queues, and graceful shutdown. Use when offloading work from r
Claude Code: save it as .claude/skills/background-jobs/SKILL.md
Cursor: save it as .cursor/rules/background-jobs.md
Codex: save it as .agents/skills/background-jobs/SKILL.md
ChatGPT, Gemini and other assistants: paste it into custom or project instructions
Skill file
Background Jobs
When to use
Offloading slow or unreliable work from HTTP request handlers
Choosing a job queue library for a given language and stack
Designing retry policies for different job types (email, payment, webhook)
Implementing dead letter queues and admin tooling for failed jobs
Building multi-step job pipelines or workflows
Setting up cron/scheduled tasks with distributed lock protection
Configuring graceful worker shutdown for zero-job-loss deploys
Core principles
Idempotency is non-negotiable — every job runs safely multiple times; design for retries from day one
Pass IDs, not data — fetch fresh state inside the job; stale payloads cause subtle bugs
Retries are tiered by criticality — payment jobs retry 5 times over an hour; analytics sync retries 3 times over 15 minutes
DLQ depth is an alert, not a log — non-zero means someone needs to look at it now
Graceful shutdown beats a kill -9 — always drain in-flight jobs before the process exits
Reference Files
references/job-design-retries-dlq.md — technology selection table, idempotency/atomicity/serialization rules, exponential backoff formula, retry config by job type, non-retryable error classification, DLQ setup, job prioritization, and cron scheduling with distributed locks
references/pipelines-shutdown-monitoring.md — BullMQ Flows and Celery chain examples for multi-step workflows, graceful SIGTERM shutdown patterns for Node.js and Python workers, metrics and alerting guidance, and structured log field conventions
Use this skill with your AI agent:Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.