fastapi

fastapi is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 94 tokens per session (4,947 once invoked), scanned A, original, MIT.

A guide for building and shipping FastAPI services, which are Python programs that provide web APIs. It covers request handling, data validation, database access, authentication, testing, and production setup.

In plain words
What is it for?
It is for building, reviewing, testing, securing, and deploying asynchronous FastAPI services with PostgreSQL and common authentication methods.
Why use it?
It helps keep API routes small and consistent while separating business logic, database work, and security concerns.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ericrisco/rsc-harness/fastapi
Any agent
npx skills add ericrisco/rsc-harness --skill fastapi
Clone the repo
git clone --depth 1 https://github.com/ericrisco/rsc-harness

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 fastapi

README.md
[![agentmods](https://agentmods.dev/badge/skills/ericrisco/rsc-harness/fastapi.svg)](https://agentmods.dev/skills/ericrisco/rsc-harness/fastapi)
Your own site
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/fastapi"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/fastapi.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00094 $0.04947
Opus 5 $0.00047 $0.02474
Sonnet 5 $0.00019 $0.00989
Haiku 4.5 $0.00009 $0.00495

Measured yesterday against content hash 38b5cc80928d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/fastapi/SKILL.md · 470 lines

How it starts

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

FastAPI & modern Python services

The single authoritative skill for building, reviewing, testing, securing and shipping an async FastAPI service on Python 3.12+. The mental model: the app is a thin async HTTP layer over typed dependencies, a service/repository core, and explicit DB sessions. Routes validate and delegate; they never own business logic, raw SQL, or secrets.

Pinned stack: Python 3.12+, FastAPI 0.136+, Starlette 1.0+ (FastAPI 0.136 requires it; avoid <1.0.1, GHSA-86qp-5c8j-p5mr), Pydantic v2 (2.7+) + pydantic-settings 2.x, SQLAlchemy 2.0 async, Alembic 1.13+, asyncpg 0.30 / psycopg 3, httpx 0.28+, pytest 8 + pytest-asyncio 1.0+ (asyncio_mode=auto), ruff 0.7+, mypy 1.13+ strict, uv 0.5+, uvicorn 0.32+ / gunicorn 23+ + uvicorn-worker 0.3+, PyJWT 2.10+, argon2-cffi 23+, pip-audit 2.7+, PostgreSQL 16. (All lower bounds; install the latest in each line.)

⚠️ SDD new-feature gate — read this first. If this skill fired on a new, non-trivial feature or behaviour change and there is no approved spec + plan under 02-DOCS/wiki/sdd/, STOP — do not write feature code yet. Hand off to ../specify/SKILL.md first: it runs brainstorm → spec → plan → tasks before any code, then routes back here once the plan is approved. Build here directly only for a genuinely one-line / low-risk change. Method: ../sdd/SKILL.md.

Out of scope, and where it goes instead: django for Django; Flask / sync WSGI, notebooks and CLI-only scripts (no skill); language-level Python, typing and packaging → python; framework-agnostic REST contracts — status codes, URL naming, versioning, cursor vs offset → api-design (this skill covers their FastAPI implementation); engine-level schema, indexing, EXPLAIN, zero-downtime migrations, PgBouncer → postgresdb; language-agnostic injection / secret / authz theory → secure-coding; Dockerfile, Compose and CI/CD mechanics → deployment (this skill keeps only a Docker note).

Read the full file on GitHub · 470 lines

Files

What ships with it

7 files 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.

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. yesterday First seen · 470 lines · 94 tokens per session scan A 38b5cc80928d

Subscribe to this mod's changes

fastapi is a skill published in the GitHub repository ericrisco/rsc-harness (64 stars, last pushed 2d ago), licensed MIT. It adds 94 tokens to every session and 4,947 once invoked, about $0.0005 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-09-03.