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 chandrudp29/skillhub --skill fastapi-patternsgit clone --depth 1 https://github.com/chandrudp29/skillhubWrote 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/chandrudp29/skillhub/fastapi-patterns)<a href="https://agentmods.dev/skills/chandrudp29/skillhub/fastapi-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/fastapi-patterns/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/chandrudp29/skillhub/fastapi-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/fastapi-patterns.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.00036 | $0.01447 |
| Opus 5.5 | $0.00014 | $0.00579 |
| Sonnet 5.5 | $0.00007 | $0.00289 |
| Haiku 4.5 | $0.00004 | $0.00145 |
Grade A, and why
fastapi-patterns 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 3mo 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 — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FastAPI Patterns
Production FastAPI patterns. Covers the 20% of FastAPI that handles 80% of real use cases.
When to Use
- Building a new FastAPI service
- Reviewing FastAPI code for quality or performance issues
- Adding auth, background tasks, or streaming to an existing service
- Debugging FastAPI errors you don't understand
Project Structure
app/
├── main.py # create_app(), lifespan
├── config.py # Settings (pydantic-settings)
├── dependencies.py # Shared dependencies (DB, auth)
├── routers/
│ ├── jobs.py
│ └── users.py
└── models/
├── requests.py # Pydantic request models
└── responses.py # Pydantic response models
App Setup with Lifespan
# main.py
from contextlib import asynccontextmanager
from fastapi import FastAPI
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup: init DB pools, load models, etc.
app.state.db = await create_db_pool()
app.state.model = load_ml_model()
yield
# Shutdown: cleanup
await app.state.db.close()
app = FastAPI(title="My API", lifespan=lifespan)
app.include_router(jobs.router, prefix="/jobs", tags=["jobs"])
app.include_router(users.router, prefix="/users", tags=["users"])
Dependency Injection
FastAPI's Depends is the right way to share DB connections, auth, and config:
# dependencies.py
from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
security = HTTPBearer()
async def get_db(request: Request) -> AsyncGenerator:
async with request.app.state.db.acquire() as conn:
yield conn # connection returned to pool after request
async def get_current_user(
credentials: HTTPAuthorizationCredentials = Depends(security),
db = Depends(get_db),
) -> User:
token = credentials.credentials
user = await verify_token(token, db)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid or expired token",
headers={"WWW-Authenticate": "Bearer"},
)
return user
# routers/jobs.py — inject where needed
@router.get("/", response_model=list[JobResponse])
async def list_jobs(
current_user: User = Depends(get_current_user),
db = Depends(get_db),
limit: int = Query(default=20, ge=1, le=100),
):
return await db.fetch_jobs(user_id=current_user.id, limit=limit)
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 212 lines · 36 tokens per session scan A 459d3dd2c3a1
fastapi-patterns is a skill published in the GitHub repository chandrudp29/skillhub (14 stars, last pushed 5mo ago), licensed MIT. It adds 36 tokens to every session and 1,447 once invoked, about $0.0001 per session on Opus 5.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.
fastapi-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| fastapi-patternschandrudp29/skillhub | Skill | 14 | 5mo ago | MIT | A | 36 | Claude Code, Codex |
| fastapi-expertpersonamanagmentlayer/pcl | Skill | 46 | 1mo ago | Apache-2.0 | A | 49 | Claude Code |
| fastapiericrisco/rsc-harness | Skill | 691 | 6d ago | MIT | A | 94 | Claude Code, Codex |
| pythonMadAppGang/claude-code | Skill | 290 | 8mo ago | MIT | A | 34 | Claude Code |
| FastAPI PatternsAmariahAK/atlarix-skills | Skill | 0 | 2mo ago | Apache-2.0 | A | 3 | Claude Code, Codex |
| fastapialivirgo/Major-AI-Skills | Skill | 6 | yesterday | MIT | A | 52 | Claude Code |
| fastapimartineserios/thebrana | Skill | 3 | 10d ago | MIT | A | 21 | Claude Code |