vstorm-co/full-stack-ai-agent-template/background-task
Claude Code and agent skill by vstorm-co/full-stack-ai-agent-template
- community
Checking that the SKILL.md file is still in the repository.
Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.background_tasks }}.
Install
npx vskill@latest install vstorm-co/full-stack-ai-agent-template/background-taskSKILL.md
The same SKILL.md was published earlier as vstorm-co/full-stack-ai-agent-template/background-task.
Background Tasks ({{ cookiecutter.background_tasks }})
Tasks live in backend/app/worker/tasks/ (e.g. email_tasks.py, rag_tasks.py, cleanup_tasks.py). The app uses {{ cookiecutter.background_tasks }}. An in-process fallback (worker/background/) exists for trivial cases.
When to use a task vs. inline
- Task: anything slow, retryable, or fire-and-forget — sending email, ingesting/embedding documents, calling slow external APIs, periodic cleanups, materialized-view refreshes.
- Inline: fast, transactional work that the response depends on.
Add a task
- Define it in
backend/app/worker/tasks/<area>.py:
{%- if cookiecutter.use_celery %} ```python from app.worker.celery_app import celery_app
@celery_app.task(name="send_welcome_email") def send_welcome_email(user_id: str) -> dict: ... `` Enqueue: send_welcome_email.delay(user_id) (or .apply_async(args=[...], countdown=60)). {%- elif cookiecutter.use_taskiq %} ``python from app.worker.taskiq_app import broker
@broker.task async def send_welcome_email(user_id: str) -> dict: ... `` Enqueue: await send_welcome_email.kiq(user_id). {%- elif cookiecutter.use_arq %} `python # add the coroutine, then list it in arq_app.WorkerSettings.functions async def send_welcome_email(ctx, user_id: str) -> dict: ... ` Enqueue: await request.state.arq_pool.enqueue_job("send_welcome_email", user_id). {%- elif cookiecutter.use_prefect %} ``python from prefect import flow
@flow(name="send-welcome-email", log_prints=True) async def send_welcome_email_flow(user_id: str) -> dict: ... `` Fire-and-forget from a service: asyncio.create_task(send_welcome_email_flow(user_id))`. {%- endif %}
- Call it from a service (not from the route directly) — keep business logic in
services/, enqueue at the end of the unit of work.
- Schedule it (optional):
{%- if cookiecutter.use_celery %} add to beat_schedule in celery_app.py (run make celery-beat). {%- elif cookiecutter.use_taskiq %} append to SCHEDULES in tasks/schedules.py (run make taskiq-scheduler). {%- elif cookiecutter.use_arq %} add a cron(...) entry to WorkerSettings.cron_jobs in arq_app.py. {%- elif cookiecutter.use_prefect %} register a deployment with a CronSchedule/IntervalSchedule in app/worker/prefect_app.py. {%- endif %}
- Run / verify:
{%- if cookiecutter.use_celery %} make celery-worker (+ make celery-beat for schedules, make celery-flower to monitor). {%- elif cookiecutter.use_taskiq %} make taskiq-worker (+ make taskiq-scheduler for schedules). {%- elif cookiecutter.use_arq %} the worker runs in the dev stack (make dev), or uv run --directory backend arq app.worker.arq_app.WorkerSettings. {%- elif cookiecutter.use_prefect %} the prefect-server + prefect-runner start with make dev; watch runs at <http://localhost:4200>. {%- endif %}
Rules
- Tasks take serializable args (ids, primitives) — not ORM objects or sessions. Re-fetch inside the task with a fresh session.
- Make tasks idempotent where possible (safe to retry).
- Keep heavy imports inside the task function to keep the API import-light.
- See
docs/howto/add-background-task.mdfor the full walkthrough.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtemplate/{{cookiecutter.project_slug}}/.claude/skills/background-task/SKILL.md
Popularity
- Repository stars
- 1,697
- Repository forks
- 319
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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
[](https://verified-skill.com/skills/vstorm-co/full-stack-ai-agent-template/background-task)