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/mfmezger/ai_agent_dotfiles/fastapinpx skills add mfmezger/ai_agent_dotfiles --skill fastapigit clone --depth 1 https://github.com/mfmezger/ai_agent_dotfilesWrote 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/mfmezger/ai_agent_dotfiles/fastapi)<a href="https://agentmods.dev/skills/mfmezger/ai_agent_dotfiles/fastapi"><img src="https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/fastapi.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.00087 | $0.01212 |
| Opus 5 | $0.00044 | $0.00606 |
| Sonnet 5 | $0.00017 | $0.00242 |
| Haiku 4.5 | $0.00009 | $0.00121 |
Grade A, and why
fastapi 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 — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FastAPI Conventions
Assume the general Python tooling conventions from the python-stack skill. This skill only covers FastAPI-specific patterns.
App Layout
Prefer a small, explicit structure:
src/<package>/
main.py
routers/
__init__.py
items.py
dependencies.py
schemas.py
models.py
settings.py
- Keep the ASGI app in
main.py - Group path operations into routers by bounded area
- Put shared dependency helpers in
dependencies.py - Keep request/response schemas separate from persistence models when that improves clarity
Running the App
Prefer the FastAPI CLI over invoking Uvicorn directly.
uv run fastapi dev src/<package>/main.py
uv run fastapi run src/<package>/main.py
If the project has a stable app entrypoint, prefer configuring it in pyproject.toml:
[tool.fastapi]
entrypoint = "src.<package>.main:app"
Path Operations
Use one HTTP operation per function. Do not collapse multiple methods into a single handler.
Use Annotated for request parameters and dependencies:
from typing import Annotated
from fastapi import APIRouter, Depends, Path, Query
router = APIRouter(prefix="/items", tags=["items"])
ItemId = Annotated[int, Path(ge=1)]
SearchQuery = Annotated[str | None, Query(max_length=100)]
@router.get("/{item_id}")
async def get_item(item_id: ItemId, q: SearchQuery = None) -> dict[str, str | int | None]:
return {"item_id": item_id, "q": q}
- Prefer reusable type aliases for common dependencies and parameter declarations
- Do not use
...as a required marker in FastAPI parameters or Pydantic fields - Do not use
@app.api_route(..., methods=[...])unless there is a strong reason
Request and Response Models
Declare response types deliberately.
- Prefer a concrete return type when the returned value already matches the public schema
- Use
response_model=when the runtime return value differs from the public schema - Treat response models as a data-exposure boundary; never return raw internal models that contain secrets or extra fields
- Prefer regular Pydantic models or standard typed containers over
RootModel
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 · 167 lines · 87 tokens per session scan A 0733a98072a8
fastapi is a skill published in the GitHub repository mfmezger/ai_agent_dotfiles (5 stars, last pushed 1mo ago), licensed MIT. It adds 87 tokens to every session and 1,212 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-patterns
Python idioms — type hints, dataclasses, async/await, generators, pytest, common pitfalls. Activate when writing or reviewing Python code.
embedded-dev
Use when developing firmware on ESP32/STM32/RP2040/nRF52, experiencing DMA overflow, SPI timeout, LCD blank display, frame corruption, GPIO conflicts, sensor reading errors, Wi-Fi disconnect, or needing driver configuration, hardware debugging, display/GUI setup, protocol implementation, serial monitoring. Use even if…
embedded-dev
Guide for embedded systems development on ESP32, STM32, RP2040, nRF52 chips. Use this skill whenever the user mentions embedded systems, firmware development, MCU programming, hardware drivers, sensors, LCD displays, IMU devices, SPI/I2C/UART interfaces, compilation, debugging, remote monitoring, Wi-Fi/BLE/MQTT…
embedded-gui-feedback
Use for LCD/GUI projects after verification passes - captures display via camera, analyzes layout/font/color, detects display issues.
embedded-verification
Use after implementation complete - runs build-flash-monitor loop, verifies runtime behavior, no completion claims without fresh evidence.
embedded-brainstorming
Use before any embedded development - explores hardware requirements, confirms configuration, validates feasibility, saves design spec.