fastapi-guideline
Installation
SKILL.md
FastAPI Skill
Production-ready FastAPI with async-first patterns, Granian as the server, and native SSE streaming.
Base patterns sourced from:
bun x skills add https://github.com/wshobson/agents --skill fastapi-templates(recommended) /npx skills add ...Extended with Granian server, native SSE (FastAPI 0.135.0+), and additional async conventions.
Core rules — apply always
- Every function must be
async def. No sync route handlers, no sync service methods, no sync repository methods. If you call a blocking library, wrap it withasyncio.to_thread(). - Granian is the server. Never use
uvicornorfastapi dev. Seereferences/granian.md. - SSE streaming uses the native
EventSourceResponsefromfastapi.sse(added in FastAPI 0.135.0). Never use third-partysse-starlette. Seereferences/sse.md. - Always use
uvfor dependency management. Never pip, poetry, or pipenv. - No ORM. Database access uses psycopg directly via
AsyncConnectionPool. Follow thepostgres-best-practicesskill for all DB patterns (queries in.sqlfiles,pg_*helpers,PostgresTableModel, named parameters).