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: npx skills add https://github.com/wshobson/agents --skill fastapi-templates Extended with Granian server, native SSE (FastAPI 0.135.0+), and additional async conventions.

Core rules — apply always

  1. 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 with asyncio.to_thread().
  2. Granian is the server. Never use uvicorn or fastapi dev. See references/granian.md.
  3. SSE streaming uses the native EventSourceResponse from fastapi.sse (added in FastAPI 0.135.0). Never use third-party sse-starlette. See references/sse.md.
  4. Always use uv for dependency management. Never pip, poetry, or pipenv.
  5. No ORM. Database access uses psycopg directly via AsyncConnectionPool. Follow the postgres-best-practices skill for all DB patterns (queries in .sql files, pg_* helpers, PostgresTableModel, named parameters).

Project structure

Related skills
Installs
6
Repository
bmsuisse/skills
GitHub Stars
2
First Seen
Mar 25, 2026