python-fastapi-setup

python-fastapi-setup is a skill for Claude Code, Codex from Victory-7291/project-scaffold-setup-skills. It costs 84 tokens per session (1,905 once invoked), scanned A, original, MIT.

A setup method for Python web services built with FastAPI, a framework for creating APIs. It organizes application code, settings, routes, middleware, health checks, tests, and deployment files.

In plain words
What is it for?
It is for creating or modernizing FastAPI services, including startup configuration, API endpoints, testing, Docker, and production server setup.
Why use it?
It gives a service a predictable structure so developers can find and maintain its main parts without searching through wrapper scripts.

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/victory-7291/project-scaffold-setup-skills/python-fastapi-setup
Any agent
npx skills add Victory-7291/project-scaffold-setup-skills --skill python-fastapi-setup
Clone the repo
git clone --depth 1 https://github.com/Victory-7291/project-scaffold-setup-skills

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 python-fastapi-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/victory-7291/project-scaffold-setup-skills/python-fastapi-setup.svg)](https://agentmods.dev/skills/victory-7291/project-scaffold-setup-skills/python-fastapi-setup)
Your own site
<a href="https://agentmods.dev/skills/victory-7291/project-scaffold-setup-skills/python-fastapi-setup"><img src="https://agentmods.dev/badge/skills/victory-7291/project-scaffold-setup-skills/python-fastapi-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,905 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00084 $0.01905
Opus 5 $0.00042 $0.00953
Sonnet 5 $0.00017 $0.00381
Haiku 4.5 $0.00008 $0.00191

Measured 3d ago against content hash 391f0a2302e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-fastapi-setup scanned grade A with 1 finding 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 3d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/gunicorn.conf.py, scripts/scaffold_fastapi_project.py), 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsS http://127.0.0.1:8000/health
skills/python-fastapi-setup/SKILL.md · 182 lines

How it starts

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

Python FastAPI Setup

Overview

Create or modernize FastAPI services around a small repeatable structure:

app/main.py -> app/core/config.py -> app/api/v1/endpoints/ -> middleware -> tests -> deployment

Prefer direct startup commands, typed settings, explicit lifespan ownership for process-level resources, and a minimal test suite. Keep the scaffold boring on purpose: a future maintainer should be able to find the app, settings, routers, health check, and startup command without hunting through wrapper scripts.

Workflow

  1. Classify the workspace before writing files.

    • Treat the target as greenfield if it is empty or the user asks for a new service.
    • Treat it as existing if it has Python source, pyproject.toml, requirements.txt, an ASGI app, tests, Docker files, CI, or git history.
    • For existing projects, inventory the current entrypoint, router layout, dependency manager, settings pattern, middleware, tests, deployment files, and startup commands before editing.
  2. For greenfield scaffolds, run the bundled script from this skill directory:

python3 scripts/scaffold_fastapi_project.py \
  --name inventory_api \
  --out /path/to/inventory_api
  • The scaffold always generates gunicorn.conf.py, Docker, and Compose files for a production-ready default.
  • The scaffold script renders reusable project and deployment configuration from assets/ for pyproject.toml, Docker, Compose, and Gunicorn. Update those assets when the shared standard changes; update the Python script when generation logic, arguments, app files, or dependency policy change.
  • Read references/python-fastapi-blueprint.md before changing generated files or adding new script options.
  1. For existing projects, patch conservatively.
    • Preserve working endpoints and behavior.
    • Before moving routes, record the existing endpoint contract: path, method, status code, response shape, sample payloads, headers, and any query/path parameters visible in the current code or tests.
    • Add or update regression tests for those existing contracts before or during the refactor. The tests should assert the old payloads and status codes, not newly invented placeholder data.
    • Move toward app/main.py only when it improves clarity or matches the user's request.
    • Retire wrapper launchers such as run_service.py after replacing them with documented direct commands.
    • Keep the repo's dependency manager unless there is a clear reason to change it.
    • Add only the modules and settings the service actually uses.
    • Do not replace legacy route payloads, IDs, names, or response field types with new sample fixtures just because the code moved into a cleaner module.

Read the full file on GitHub · 182 lines

Files

What ships with it

9 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. 3d ago First seen · 182 lines · 84 tokens per session scan A 391f0a2302e0

Subscribe to this mod's changes

python-fastapi-setup is a skill published in the GitHub repository Victory-7291/project-scaffold-setup-skills (7 stars, last pushed 1mo ago), licensed MIT. It adds 84 tokens to every session and 1,905 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

python-project

Scaffold and modernize a Python project with uv. Sets up the src/ layout; a pyproject.toml on uv's native uvbuild backend; runtime deps plus a dev dependency group (PEP 735) pinning developer tooling like ruff, ty (or pyright), and pytest; a committed uv.lock and pinned interpreter; a thin main entry point; and a…

bitwise-media-group/skills · 226 tokens

python-typing

Python static typing and type annotations, checked with a static type checker — ty (Astral) or pyright (Microsoft/Pylance). Use when adding, writing, or reviewing type hints or annotations on Python functions, methods, parameters, or return values; adding return type annotations across a module; fixing or resolving…

bitwise-media-group/skills · 204 tokens

python-style

Modern Python house style: ruff is the single formatter and linter (replacing black, isort, flake8, pylint, pyupgrade) with an opinionated lint select set, plus idioms ruff cannot enforce — pathlib over os.path, module-level logging instead of print, specific chained exceptions, dataclasses for data, comprehensions…

bitwise-media-group/skills · 189 tokens

python-testing

Python test authoring and review with pytest. Use when writing, adding, generating, or reviewing Python tests or unit tests for a function, module, or class; running pytest or a single test (the -k flag and other invocation flags for a Makefile or CI); parametrizing test cases into the table-driven pattern; setting up…

bitwise-media-group/skills · 178 tokens

msgspec

Auto-activate for msgspec, Struct, Meta, msgspec.json, msgspec.msgpack, tagged unions, enchook, dechook, convert(), or Litestar DTO shapes. Not for Pydantic or ORM models — use their stack-specific skill.

litestar-org/litestar-skills · 55 tokens

litestar-build

Auto-activate for uv build, hatch build, PyApp, PYAPP, wheel assets, GitHub release matrices, cargo-zigbuild, or python-build-standalone. Not for runtime deployment.

litestar-org/litestar-skills · 46 tokens