Skip to content

Python Background Jobs

Guides the agent to build Python background job systems with task queues, workers, retries and job state tracking.

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

When you ask the agent to build something slow or unreliable in a Python app, this skill tells it to hand that work to a background worker instead of making the user wait. The agent then writes code that returns a job ID right away, queues the task (its examples use Celery with Redis), and tracks the job as pending, running, succeeded or failed. It also nudges the agent toward safe retries, idempotency keys and time limits.

Great for

  • Python developers adding email sending, report exports, uploads or webhooks to a web API
  • Teams that need to decouple slow external calls like payments from request handling
  • Developers who want a checklist of retry, timeout and idempotency patterns for task queues

Skip it if

  • Simple scripts or apps where a synchronous call is fast enough; the queue infrastructure adds complexity
  • Non-Python stacks, since the examples are Python-specific
  • Anyone expecting a ready-made, tested library: the skill only supplies illustrative code snippets that the agent must adapt and verify, and some snippets are incomplete (for example, the idempotency example leaves a placeholder branch and undefined dependencies)

Try asking

  • “Make this export endpoint return a job ID and process the export in a background worker”
  • “Add a Celery task that sends welcome emails without blocking signup”
  • “Set up retries with exponential backoff for calls to our flaky payment provider”
  • “Design a job status table so users can poll whether their report is ready”
Step-by-step guide: how to use Python Background JobsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    python-background-jobs.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip python-background-jobs.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip python-background-jobs.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Name your queue broker and database up front so the agent wires the examples to your real infrastructure instead of localhost defaults.
  • Review generated retry and idempotency logic carefully, especially around payments, because the skill's examples are illustrative and incomplete.
  • Ask the agent to also read references/details.md for advanced patterns when your case goes beyond the basics.

What's inside

  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.