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 agentmods add skills/robhowley/py-pit-skills/request-correlationnpx skills add robhowley/py-pit-skills --skill request-correlationgit 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/request-correlation)<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/request-correlation"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/request-correlation.svg" alt="Measured on agentmods" 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 | $0.00086 | $0.01071 |
| Opus 5 | $0.00043 | $0.00535 |
| Sonnet 5 | $0.00017 | $0.00214 |
| Haiku 4.5 | $0.00009 | $0.00107 |
Grade A, and why
request-correlation 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.
How it starts
The opening of the file, as written. The whole thing — 183 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: request-correlation
Core stance
Every request or job must produce a traceable log story.
A single correlation ID must propagate through:
- HTTP handlers
- service functions
- outbound HTTP calls
- background jobs and async tasks
The correlation ID must appear automatically in logs.
Infrastructure vs. convention: Some rules are wired once at app startup (middleware, logging config, HTTP client factory). Others are conventions followed everywhere (raise don't log in services, never pass correlation as a function argument). Keep them separate in your mental model -- the infrastructure makes the conventions effortless.
Canonical locations
Correlation infrastructure must live in predictable modules.
Use:
{pkg_name}/observability/correlation.py
{pkg_name}/observability/logging.py
Do not duplicate correlation logic elsewhere.
Rules
1. Wire correlation at entrypoints
Entrypoints include HTTP requests, background job workers, CLI tasks, and async task roots.
For HTTP requests, use a functional middleware to read x-request-id if
present, otherwise generate one, then set it into context:
import uuid
from fastapi import Request
from {pkg_name}.observability.correlation import correlation_id
@app.middleware("http")
async def correlation_middleware(request: Request, call_next):
cid = request.headers.get("x-request-id") or str(uuid.uuid4())
correlation_id.set(cid)
response = await call_next(request)
response.headers["x-request-id"] = cid
return response
Prefer @app.middleware("http") over BaseHTTPMiddleware — the class-based
approach can swallow exceptions and interfere with streaming responses.
For job workers and CLI entrypoints, set correlation_id before executing
the task -- either from a passed value or a freshly generated one.
2. Store correlation in contextvars
Correlation must live in a contextvars.ContextVar.
Never store it on request objects or pass it through every function argument.
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.
- 4d ago First seen · 183 lines · 86 tokens per session scan A 83fb3acb8c36
request-correlation is a skill published in the GitHub repository robhowley/py-pit-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 86 tokens to every session and 1,071 once invoked, about $0.0004 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
Use when building FastAPI applications, implementing async endpoints, setting up Pydantic schemas, working with SQLAlchemy, or writing pytest tests for Python backend services.
database
Relational database authority — PostgreSQL, async ORM (SQLAlchemy 2 / asyncpg), Alembic schema migrations, Supabase Python and JS clients, query optimisation, index strategy, connection pooling, transaction patterns, and bulk operations across Python and Node stacks.
crudauth
Use when building or modifying authentication in a FastAPI app with crudauth (the crudauth PyPI package) — covers CRUDAuth, the AuthUserMixin / makeauthidentity user model, IdentityConfig, currentuser(...) gates, session + bearer transports, OAuth (Google/GitHub), email verification / password reset / change, custom…
FastAPI Testing Patterns
FastAPI application testing with TestClient, dependency injection overrides, async testing, database testing with SQLAlchemy, and OpenAPI validation.
pytest
Advanced Python unit testing framework for customer support tech enablement, covering FastAPI, SQLAlchemy, PostgreSQL, async operations, mocking, fixtures, parametrization, coverage, and comprehensive testing strategies for backend support systems.
alembic
Comprehensive Alembic database migration management for customer support systems.