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/victory-7291/project-scaffold-setup-skills/python-fastapi-setupnpx skills add Victory-7291/project-scaffold-setup-skills --skill python-fastapi-setupgit clone --depth 1 https://github.com/Victory-7291/project-scaffold-setup-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/victory-7291/project-scaffold-setup-skills/python-fastapi-setup)<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>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.00084 | $0.01905 |
| Opus 5 | $0.00042 | $0.00953 |
| Sonnet 5 | $0.00017 | $0.00381 |
| Haiku 4.5 | $0.00008 | $0.00191 |
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.
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 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
-
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.
-
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/forpyproject.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.mdbefore changing generated files or adding new script options.
- 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.pyonly when it improves clarity or matches the user's request. - Retire wrapper launchers such as
run_service.pyafter 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.
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.
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.
- 3d ago First seen · 182 lines · 84 tokens per session scan A 391f0a2302e0
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.
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…
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…
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…
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…
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-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.