fastapi-templates

fastapi-templates is a skill for Claude Code from wshobson/agents. It costs 37 tokens per session (1,015 once invoked), scanned A, original, MIT.

A template and guidance for creating FastAPI applications, which are Python web services that expose APIs. It covers asynchronous code, dependency injection, error handling, databases, and project structure.

In plain words
What is it for?
Use it to start FastAPI services, REST APIs, microservices, or applications connected to PostgreSQL or MongoDB.
Why use it?
It provides a consistent starting layout and development approach for backend API projects.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the api-scaffolding plugin — 1 skill, 4 agents shipped together

Good fit Use it to start FastAPI services, REST APIs, microservices, or applications connected to PostgreSQL or MongoDB.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wshobson/agents/fastapi-templates
About the project

Agentic Plugin Marketplace is a collection of reusable plugins, agents, skills, commands, and rules for coding-agent tools including Claude Code, Codex CLI, Cursor, OpenCode, Antigravity CLI, and GitHub Copilot. It is for developers assembling agentic workflows across multiple harnesses from shared Markdown sources, and the catalogue entries are examples or subsets of those workflow components.

wshobson/agents · 41,018 stars · on GitHub · sethhobson.com

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.

Any agent
npx skills add wshobson/agents --skill fastapi-templates
Clone the repo
git clone --depth 1 https://github.com/wshobson/agents

Made for: Claude Code.

Or install api-scaffolding, the plugin that ships this one along with the rest of its 1 skill, 4 agents.

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-templates

README.md
[![agentmods](https://agentmods.dev/badge/skills/wshobson/agents/fastapi-templates/github.svg)](https://agentmods.dev/skills/wshobson/agents/fastapi-templates)
Your own site
<a href="https://agentmods.dev/skills/wshobson/agents/fastapi-templates"><img src="https://agentmods.dev/badge/skills/wshobson/agents/fastapi-templates/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.

agentmods 80×15 button for fastapi-templates

Your own site · 80×15
<a href="https://agentmods.dev/skills/wshobson/agents/fastapi-templates"><img src="https://agentmods.dev/badge/skills/wshobson/agents/fastapi-templates.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,015 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Oct 2026
  • Snyk pass 15 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00037 $0.01015
Opus 5.5 $0.00015 $0.00406
Sonnet 5.5 $0.00007 $0.00203
Haiku 4.5 $0.00004 $0.00102

Measured 3d ago against content hash dba8e1287ae0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fastapi-templates 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 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.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/api-scaffolding/skills/fastapi-templates/SKILL.md · 157 lines

How it starts

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

FastAPI Project Templates

Production-ready FastAPI project structures with async patterns, dependency injection, middleware, and best practices for building high-performance APIs.

When to Use This Skill

  • Starting new FastAPI projects from scratch
  • Implementing async REST APIs with Python
  • Building high-performance web services and microservices
  • Creating async applications with PostgreSQL, MongoDB
  • Setting up API projects with proper structure and testing

Core Concepts

1. Project Structure

Recommended Layout:

app/
├── api/                    # API routes
│   ├── v1/
│   │   ├── endpoints/
│   │   │   ├── users.py
│   │   │   ├── auth.py
│   │   │   └── items.py
│   │   └── router.py
│   └── dependencies.py     # Shared dependencies
├── core/                   # Core configuration
│   ├── config.py
│   ├── security.py
│   └── database.py
├── models/                 # Database models
│   ├── user.py
│   └── item.py
├── schemas/                # Pydantic schemas
│   ├── user.py
│   └── item.py
├── services/               # Business logic
│   ├── user_service.py
│   └── auth_service.py
├── repositories/           # Data access
│   ├── user_repository.py
│   └── item_repository.py
└── main.py                 # Application entry

2. Dependency Injection

FastAPI's built-in DI system using Depends:

  • Database session management
  • Authentication/authorization
  • Shared business logic
  • Configuration injection

3. Async Patterns

Proper async/await usage:

  • Async route handlers
  • Async database operations
  • Async background tasks
  • Async middleware

4. Dependencies

The packages the examples import:

# requirements.txt
fastapi
uvicorn[standard]
pydantic-settings
sqlalchemy[asyncio]>=2.0  # DeclarativeBase; [asyncio] installs greenlet for the async engine
asyncpg                   # PostgreSQL driver: postgresql+asyncpg://...
PyJWT
pwdlib[argon2]
python-multipart          # only for a login route that uses OAuth2PasswordRequestForm

# requirements-dev.txt
pytest
pytest-asyncio
httpx
aiosqlite                 # test database: sqlite+aiosqlite:///:memory:

Read the full file on GitHub · 157 lines

Files

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.

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 Changed · +20 lines dba8e1287ae0
  2. 1mo ago First seen · 137 lines · 37 tokens per session scan A 92d4394d0300

Subscribe to this mod's changes

fastapi-templates is a skill published in the GitHub repository wshobson/agents (41,018 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 1,015 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.

Related

Other skills, from other repositories

async-fastapi

Build async FastAPI applications with async/await endpoints, background tasks, middleware, lifespan events, WebSockets, and streaming responses. Use when the user builds a FastAPI app, asks about async patterns, implements real-time features, or needs non-blocking I/O. Trigger when you see synchronous code in FastAPI…

VersoXBT/claude-initial-setup · 72 tokens

dependency-injection-fastapi

Implement FastAPI dependency injection with Depends(), security dependencies, database session management, request-scoped deps, and testing with overrides. Use when the user builds FastAPI endpoints, manages database connections, implements auth, or asks about dependency injection. Trigger when you see repeated setup…

VersoXBT/claude-initial-setup · 70 tokens

pydantic-validation

Validate data with Pydantic v2: BaseModel, Field validators, model validators, computed fields, discriminated unions, and custom types. Use when the user defines API schemas, validates input data, works with Pydantic models, or asks about data validation in Python. Trigger when you see dict-based data handling that…

VersoXBT/claude-initial-setup · 77 tokens

python-dev

Python backend conventions for this project. Use when implementing or modifying API endpoints, database models/migrations, services, schemas, or backend tests.

jaansokk/cursor_tools · 31 tokens

django-patterns

Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.

affaan-m/ECC · 32 tokens

fastapi-patterns

FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.

affaan-m/ECC · 35 tokens