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.
npx skills add robhowley/py-pit-skills --skill background-jobs-boundariesgit clone --depth 1 https://github.com/robhowley/py-pit-skillsWrote 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.
[](https://agentmods.dev/skills/robhowley/py-pit-skills/background-jobs-boundaries)<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/background-jobs-boundaries"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/background-jobs-boundaries/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.
<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/background-jobs-boundaries"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/background-jobs-boundaries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.00533 |
| Opus 5 | $0.00017 | $0.00267 |
| Sonnet 5 | $0.00007 | $0.00107 |
| Haiku 4.5 | $0.00003 | $0.00053 |
Grade A, and why
background-jobs-boundaries 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: background-jobs-boundaries
Core stance
In-process background tasks are best-effort follow-ups, not job infrastructure.
Use them only for small, fast, non-critical work after a request completes.
Do not use background tasks when the work is:
- long-running
- business-critical
- requires retries
- requires durability
- must run exactly once
These require a real job system.
Hard rules
- Never pass
Request, DB sessions, ORM objects, or DI state. - Persist domain state before triggering background work.
- Do not implement retry logic inside tasks.
- Do not spawn threads or
asyncio.create_task()inside handlers. - Pass IDs or payloads, reload resources inside the task.
Acceptable uses
Small follow-up work such as:
- analytics
- cache invalidation
- webhooks
- audit logging
Tasks must be fast, idempotent, and failure-tolerant.
Correct shape
Background tasks should accept identifiers or simple payloads only and load resources inside the task itself.
Example pattern:
from fastapi import BackgroundTasks
@app.post("/users/{user_id}/welcome")
async def send_welcome(user_id: int, background_tasks: BackgroundTasks):
background_tasks.add_task(send_welcome_email, user_id)
return {"status": "scheduled"}
async def send_welcome_email(user_id: int):
async with AsyncSessionLocal() as session:
user = await session.get(User, user_id)
if not user:
return
await email_service.send_welcome(user.email)
Background task functions must be async def when using async sessions. FastAPI runs async background tasks in the event loop, so this works without threads. For CPU-heavy or truly blocking work, use a real job queue instead.
Key properties:
- Task arguments are IDs or primitives
- The task opens its own DB session
- The task is idempotent and failure-tolerant
- Failures must not affect request behavior
- No retry logic is implemented inside the task
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.
- 11d ago First seen · 95 lines · 34 tokens per session scan A 28489a99ccf8
background-jobs-boundaries is a skill published in the GitHub repository robhowley/py-pit-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 533 once invoked, about $0.0002 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.
Other skills, from other repositories
python-backend
Production Python async patterns including asyncio TaskGroup, FastAPI dependency injection and middleware, SQLAlchemy 2.0 async sessions, and database connection pool tuning. Python 3.11+ runtime concerns such as ExceptionGroup, cancellation semantics, and session rollback. Use when building async services, wiring…
python
Use when building FastAPI applications, implementing async endpoints, setting up Pydantic schemas, working with SQLAlchemy, or writing pytest tests for Python backend services.
FastAPI Customer Support Tech Enablement
Comprehensive FastAPI skill for building modern Python web APIs with focus on customer support systems, ticket management, real-time chat, and backend operations.
fastapi-expert
Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.
asyncio
Python asyncio - Modern concurrent programming with async/await, event loops, tasks, coroutines, primitives, aiohttp, and FastAPI async patterns.
flask
Flask - Lightweight Python web framework for microservices, REST APIs, and flexible web applications with extensive extension ecosystem.