lct1407/sidcorp-skills/python-async-workers

Claude Code and agent skill by lct1407/sidcorp-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Generate Python background workers, cron jobs, message queue consumers. Use when creating scheduled tasks (APScheduler), Celery workers, RabbitMQ/Redis queue consumers, or async job processing. Follows project async patterns and integrates with existing services.

Install

npx vskill@latest install lct1407/sidcorp-skills/python-async-workers

SKILL.md

Python Async Workers

Background processing patterns for FastAPI applications.

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│ FastAPI Application │
├─────────────────────────────────────────────────────────────┤
│ API Request │ Cron Scheduler │ Queue Consumer │
│ ↓ │ ↓ │ ↓ │
│ Enqueue Job │ Trigger Task │ Process Message │
│ ↓ │ ↓ │ ↓ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Service Layer │ │
│ │ (Shared Business Logic) │ │
│ └─────────────────────────────────────────────────────┘ │
│ ↓ ↓ ↓ │
│ Message Queue Database External APIs │
│ (RabbitMQ/Redis) (PostgreSQL) │
└─────────────────────────────────────────────────────────────┘

Components

ComponentPurposeLocation
Cron JobsScheduled recurring tasksapp/jobs/
Celery TasksDistributed task queueapp/tasks/
Queue ConsumersMessage processingapp/consumers/
WorkersBackground processorsapp/workers/

When to Use What

Use CaseSolution
Run every X minutes/hoursCron (APScheduler)
Async processing after API callCelery Task
Process messages from external systemQueue Consumer
Long-running background processWorker with asyncio
Distributed across multiple serversCelery + RabbitMQ
Simple in-process backgroundFastAPI BackgroundTasks

Key Principles

1. Reuse Service Layer

Workers should call existing services, not duplicate logic:

python
# GOOD: Reuse service
async def process_order(order_id: int):
async with get_session() as session:
service = OrderService(session)
await service.process(order_id)
# BAD: Duplicate logic in worker
async def process_order(order_id: int):
# Don't copy-paste service code here!
pass
2. Idempotency

All background tasks must be idempotent (safe to retry):

python
# GOOD: Check before processing
async def send_email(user_id: int, email_type: str):
if await was_email_sent(user_id, email_type):
return # Already sent, skip
await do_send_email(user_id, email_type)
await mark_email_sent(user_id, email_type)
3. Error Handling

Always handle errors gracefully with retries:

python
@celery.task(bind=True, max_retries=3)
def process_payment(self, payment_id: int):
try:
# Process
pass
except TransientError as e:
raise self.retry(exc=e, countdown=60)
except PermanentError as e:
# Log and don't retry
logger.error(f"Payment {payment_id} failed permanently: {e}")

Reference Navigation

Scheduling:

Task Queues:

Message Queues:

Integration with python-backend-development

This skill extends python-backend-development:

  • Workers call Services from app/services/
  • Use same Repository pattern for database access
  • Follow same async patterns (async def, await)
  • Use same error handling (custom exceptions)
  • Share configuration from app/core/config.py

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Refreshed 26 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lct1407/sidcorp-skills/python-async-workers/badge)](https://verified-skill.com/skills/lct1407/sidcorp-skills/python-async-workers)

Something wrong with this skill or its page? Tell us.