drunk-mcp-proxy: Skill for Claude Code

.claude/skills/fastapi-templates/SKILL.md

fastapi-templates is a skill for Claude Code from baoduy/drunk-mcp-proxy. It costs 37 tokens per session (3,610 once invoked), scanned A, a copy of fastapi-templates, MIT.

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

In plain words
What is it for?
It helps start Python REST APIs, web services, microservices, and database-backed applications with organized routes, models, configuration, services, and tests.
Why use it?
It gives a new API project a consistent structure and common engineering patterns, reducing the need to design the foundation from scratch.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is baoduy/drunk-mcp-proxy's own configuration. It tells Claude Code how to work on drunk-mcp-proxy itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything drunk-mcp-proxy configures →

Reuse

Borrowing it

Nothing to install: this file belongs to baoduy/drunk-mcp-proxy. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/baoduy/drunk-mcp-proxy/main/.claude/skills/fastapi-templates/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/baoduy/drunk-mcp-proxy

Made for: Claude Code.

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/baoduy/drunk-mcp-proxy/fastapi-templates/github.svg)](https://agentmods.dev/skills/baoduy/drunk-mcp-proxy/fastapi-templates)
Your own site
<a href="https://agentmods.dev/skills/baoduy/drunk-mcp-proxy/fastapi-templates"><img src="https://agentmods.dev/badge/skills/baoduy/drunk-mcp-proxy/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/baoduy/drunk-mcp-proxy/fastapi-templates"><img src="https://agentmods.dev/badge/skills/baoduy/drunk-mcp-proxy/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 3,610 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.
Origin 100% copy Near-identical to another mod 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.03610
Opus 5.5 $0.00015 $0.01444
Sonnet 5.5 $0.00007 $0.00722
Haiku 4.5 $0.00004 $0.00361

Measured 1mo ago against content hash 07d7ca985809, 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 1mo 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

This is a copy

100% identical to fastapi-templates — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/fastapi-templates/SKILL.md · 565 lines

How it starts

The opening of the file, as written. The whole thing — 565 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

Implementation Patterns

Pattern 1: Complete FastAPI Application

# main.py
from fastapi import FastAPI, Depends
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager

@asynccontextmanager
async def lifespan(app: FastAPI):
    """Application lifespan events."""
    # Startup
    await database.connect()
    yield
    # Shutdown
    await database.disconnect()

app = FastAPI(
    title="API Template",
    version="1.0.0",
    lifespan=lifespan
)

# CORS middleware
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Include routers
from app.api.v1.router import api_router
app.include_router(api_router, prefix="/api/v1")

# core/config.py
from pydantic_settings import BaseSettings
from functools import lru_cache

class Settings(BaseSettings):
    """Application settings."""
    DATABASE_URL: str
    SECRET_KEY: str
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
    API_V1_STR: str = "/api/v1"

    class Config:
        env_file = ".env"

@lru_cache()
def get_settings() -> Settings:
    return Settings()

# core/database.py
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from app.core.config import get_settings

settings = get_settings()

engine = create_async_engine(
    settings.DATABASE_URL,
    echo=True,
    future=True
)

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

Base = declarative_base()

async def get_db() -> AsyncSession:
    """Dependency for database session."""
    async with AsyncSessionLocal() as session:
        try:
            yield session
            await session.commit()
        except Exception:
            await session.rollback()
            raise
        finally:
            await session.close()

Read the full file on GitHub · 565 lines

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. 1mo ago First seen · 565 lines · 37 tokens per session scan A 07d7ca985809

Subscribe to this mod's changes

fastapi-templates is a skill published in the GitHub repository baoduy/drunk-mcp-proxy (0 stars, last pushed 7mo ago), licensed MIT. It adds 37 tokens to every session and 3,610 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to fastapi-templates, differing in 3 lines, and is treated as a copy.