background-tasks

background-tasks is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 51 tokens per session (1,619 once invoked), scanned A, original, MIT.

A guide to running Python work outside the main program, either immediately, on a schedule, or through a Redis queue. It covers Celery workers, APScheduler timers, retries, failed-task queues, monitoring, and Docker Compose setup.

In plain words
What is it for?
Use it for background pipelines, scheduled jobs, queued work, retryable processing, and worker containers.
Why use it?
It helps keep slow or failure-prone work from blocking the application and gives tasks controlled retry and failure handling.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for background pipelines, scheduled jobs, queued work, retryable processing, and worker containers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luuow/meridian-mcp/background-tasks
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.

Any agent
npx skills add LuuOW/meridian-mcp --skill background-tasks
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

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-tasks

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/background-tasks/github.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/background-tasks)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/background-tasks"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/background-tasks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for background-tasks

Your own site · 80×15
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/background-tasks"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/background-tasks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,619 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00051 $0.01619
Opus 5 $0.00026 $0.00809
Sonnet 5 $0.00010 $0.00324
Haiku 4.5 $0.00005 $0.00162

Measured 8d ago against content hash 9cd03718426c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

background-tasks 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 8d 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.

skills/background-tasks/SKILL.md · 219 lines

How it starts

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

background-tasks

Covers async task execution: Celery + beat for scheduled/queued work, APScheduler for in-process cron, and bare Redis queues for lightweight pipelines.

1) Celery setup (Python)

# celery_app.py
from celery import Celery

celery = Celery(
    "tasks",
    broker="redis://localhost:6379/1",    # DB 1 for queues (never evicted)
    backend="redis://localhost:6379/2",   # DB 2 for results
    include=["app.tasks"],
)

celery.conf.update(
    task_serializer="json",
    result_expires=3600,
    timezone="UTC",
    enable_utc=True,
    worker_prefetch_multiplier=1,   # process one task at a time (prevents memory spike)
    task_acks_late=True,            # ack after success, not on receive (safe retry on crash)
)

2) Defining tasks

from celery_app import celery

@celery.task(bind=True, max_retries=3, default_retry_delay=60)
def generate_article(self, domain: str, slug: str) -> dict:
    try:
        result = run_pipeline(domain, slug)
        return result
    except TemporaryError as exc:
        raise self.retry(exc=exc)     # exponential back-off via default_retry_delay
    except PermanentError:
        # Don't retry — log and fail cleanly
        logger.error("permanent_failure", domain=domain, slug=slug)
        return {"status": "failed"}

# Enqueue
task = generate_article.delay(domain="keto", slug="keto-diet-guide")
print(task.id)            # track this ID

3) Celery Beat (scheduled tasks)

from celery.schedules import crontab

celery.conf.beat_schedule = {
    "serp-delta-check": {
        "task":     "app.tasks.run_serp_delta",
        "schedule": crontab(hour="*/6"),      # every 6h
    },
    "link-score-refresh": {
        "task":     "app.tasks.refresh_link_scores",
        "schedule": crontab(hour=3, minute=0),  # 3am UTC
    },
}

4) Docker Compose: worker + beat

services:
  worker-default:
    build: .
    command: celery -A celery_app worker -Q default -c 2 --loglevel=info
    environment:
      - REDIS_URL=redis://redis:6379/1
    depends_on: [redis]
    restart: unless-stopped

  worker-scraping:
    build: .
    command: celery -A celery_app worker -Q scraping -c 1 --loglevel=info
    depends_on: [redis]
    restart: unless-stopped

  beat:
    build: .
    command: celery -A celery_app beat --loglevel=info --scheduler celery.beat.PersistentScheduler
    depends_on: [redis]
    restart: unless-stopped

Read the full file on GitHub · 219 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. 8d ago First seen · 219 lines · 51 tokens per session scan A 9cd03718426c

Subscribe to this mod's changes

background-tasks is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed 4d ago), licensed MIT. It adds 51 tokens to every session and 1,619 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-31.

Related

Other skills, from other repositories

sqlalchemy-models

Create or modify SQLAlchemy models, queries, and Alembic migrations. Use when: defining new database tables, writing queries, creating migrations, checking model conventions, or understanding the database layer.

tedivm/robs_awesome_python_template · 44 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

asyncio

Python asyncio - Modern concurrent programming with async/await, event loops, tasks, coroutines, primitives, aiohttp, and FastAPI async patterns.

bobmatnyc/claude-mpm-skills · 32 tokens

aiocache

Configure or use the aiocache caching layer. Use when: adding cache reads/writes, configuring cache backends, working with TTLs, enabling/disabling caching, or understanding the NoOpCache fallback pattern.

tedivm/robs_awesome_python_template · 47 tokens

fastapi-routes

Create or modify FastAPI routes. Use when: adding new API endpoints, creating Pydantic request/response models, registering routers, designing REST APIs, or following route conventions for this project.

tedivm/robs_awesome_python_template · 44 tokens

typer-cli

Add or modify CLI commands using Typer. Use when: adding new CLI subcommands, wrapping async functions for CLI use, understanding the CLI entrypoint structure, or following the @syncify pattern for async commands.

tedivm/robs_awesome_python_template · 47 tokens