background-task

background-task is a skill for Claude Code, Codex from vstorm-co/full-stack-ai-agent-template. It costs 62 tokens per session (955 once invoked), scanned A, original, MIT.

A workflow for adding background tasks that run outside the normal request-and-response cycle, such as sending emails, processing documents, handling webhooks, or scheduled cleanup.

In plain words
What is it for?
Use it to define and queue work with the project's configured task system, including periodic jobs and calls to slow external services.
Why use it?
It keeps slow, retryable, or fire-and-forget work from delaying a user's request.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/vstorm-co/full-stack-ai-agent-template/background-task
Any agent
npx skills add vstorm-co/full-stack-ai-agent-template --skill background-task
Clone the repo
git clone --depth 1 https://github.com/vstorm-co/full-stack-ai-agent-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for background-task

README.md
[![agentmods](https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/background-task.svg)](https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/background-task)
Your own site
<a href="https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/background-task"><img src="https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/background-task.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.00955
Opus 5 $0.00031 $0.00477
Sonnet 5 $0.00012 $0.00191
Haiku 4.5 $0.00006 $0.00096

Measured 4d ago against content hash aba527143c88, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

background-task scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/{{cookiecutter.project_slug}}/.claude/skills/background-task/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

  1. Define it in backend/app/worker/tasks/<area>.py: {%- if cookiecutter.use_celery %}

    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 %}

    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 %}

    # 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 %}

    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 %}

  2. Call it from a service (not from the route directly) — keep business logic in services/, enqueue at the end of the unit of work.

  3. 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 %}

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 80 lines · 62 tokens per session scan A aba527143c88

Subscribe to this mod's changes

background-task is a skill published in the GitHub repository vstorm-co/full-stack-ai-agent-template (1,862 stars, last pushed 5d ago), licensed MIT. It adds 62 tokens to every session and 955 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.