Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wshobson avatar

Fastapi Templates

  • 22k installs
  • 38.3k repo stars
  • Updated July 22, 2026
  • wshobson/agents

fastapi-templates is an agent skill that generates production-ready FastAPI project structures with async patterns, dependency injection, and Pydantic schemas for developers starting Python REST or microservice APIs.

About

A production agentic plugin marketplace with 92 plugins, 199 agents, 162 skills, and 106 commands. Emits harness-native artifacts from a single Markdown source for Claude Code, Codex, Cursor, OpenCode, Gemini, and GitHub Copilot. Includes a three-layer plugin quality evaluation framework.

  • 92 production-ready plugins with 199 domain-expert agents across 5 harnesses
  • One Markdown source, five native artifact generators
  • Progressive disclosure with 162 skills plus plugin-eval quality certification framework

Fastapi Templates by the numbers

  • 21,975 all-time installs (skills.sh)
  • +395 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #48 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/wshobson/agents --skill fastapi-templates

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs22k
repo stars38.3k
Security audit3 / 3 scanners passed
Last updatedJuly 22, 2026
Repositorywshobson/agents

How do you scaffold a production FastAPI project?

A production agentic plugin marketplace with 92 plugins, 199 agents, 162 skills, and 106 commands. Emits harness-native artifacts from a single Markdown source for Claude Code, Codex, Cursor, OpenCod

Who is it for?

Python developers starting new async FastAPI services who want DI, repositories, and testing structure out of the box.

Skip if: Teams extending mature Django monoliths or needing only a single-endpoint script without full project layout.

When should I use this skill?

User starts a new FastAPI app, async REST API, or Python microservice backend from scratch.

What you get

FastAPI directory tree, async router modules, Pydantic schemas, repository layer, middleware, and test stubs.

  • FastAPI project directory
  • router and repository modules
  • test suite stubs

Files

SKILL.mdMarkdownGitHub ↗

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

Detailed worked examples and patterns

Detailed sections (starting with ## Implementation Patterns) live in references/details.md. Read that file when the navigation summary above is insufficient.

Testing

# tests/conftest.py
import pytest
import asyncio
from httpx import AsyncClient
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker

from app.main import app
from app.core.database import get_db, Base

TEST_DATABASE_URL = "sqlite+aiosqlite:///:memory:"

@pytest.fixture(scope="session")
def event_loop():
    loop = asyncio.get_event_loop_policy().new_event_loop()
    yield loop
    loop.close()

@pytest.fixture
async def db_session():
    engine = create_async_engine(TEST_DATABASE_URL, echo=True)
    async with engine.begin() as conn:
        await conn.run_sync(Base.metadata.create_all)

    AsyncSessionLocal = sessionmaker(
        engine, class_=AsyncSession, expire_on_commit=False
    )

    async with AsyncSessionLocal() as session:
        yield session

@pytest.fixture
async def client(db_session):
    async def override_get_db():
        yield db_session

    app.dependency_overrides[get_db] = override_get_db

    async with AsyncClient(app=app, base_url="http://test") as client:
        yield client

# tests/test_users.py
import pytest

@pytest.mark.asyncio
async def test_create_user(client):
    response = await client.post(
        "/api/v1/users/",
        json={
            "email": "test@example.com",
            "password": "testpass123",
            "name": "Test User"
        }
    )
    assert response.status_code == 201
    data = response.json()
    assert data["email"] == "test@example.com"
    assert "id" in data

Related skills

How it compares

Pick fastapi-templates over generic Python snippets when you need a full layered FastAPI repo with async DI, repositories, and tests—not a single-file demo.

FAQ

What does fastapi-templates generate?

fastapi-templates creates a production-ready FastAPI project with async patterns, dependency injection, Pydantic schemas, repository layers, middleware, error handling, and a testing setup suitable for PostgreSQL or MongoDB backends.

When should I use fastapi-templates?

Use fastapi-templates when starting a new FastAPI application, building async REST APIs, or setting up Python microservices that need consistent structure, DI, and test coverage from the first commit.

Is Fastapi Templates safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.