Skip to content

FastAPI Patterns

Guides an agent to write and review production FastAPI services with best-practice structure.

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

When installed, the agent follows a set of FastAPI conventions when you ask it to build or review a Python web API. It suggests a layout that separates routes, Pydantic request/response schemas, dependency injection, and database logic, and it provides copy-ready code examples for async endpoints, authentication dependencies, error handling, and OpenAPI docs. It also points out common production risks, such as leaking password hashes in responses or combining wildcard CORS origins with credentials.

Great for

  • Python developers building or refactoring a FastAPI backend
  • Teams reviewing a FastAPI pull request for security and structure issues
  • Developers who want consistent project layout and response models

Skip it if

  • Non-Python projects or other web frameworks, since the guidance is FastAPI-specific
  • Beginners expecting a complete, ready-to-deploy app; the file gives patterns and snippets, not a finished project
  • Security-critical sign-off on its own; the examples are guidance and should be verified against current library versions

Try asking

  • “Review my FastAPI app's main.py and routers for production issues”
  • “Set up a FastAPI project layout with dependencies, schemas, and tests”
  • “Write an async FastAPI endpoint that paginates users from a SQLAlchemy database”
  • “Add JWT-based authentication dependency to my FastAPI routes”
Step-by-step guide: how to use FastAPI PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    fastapi-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip fastapi-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip fastapi-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Name the specific file or route you want reviewed so the agent applies the relevant section.
  • Ask for the pattern adapted to your own models and database, rather than pasting the examples unchanged.
  • Check generated auth and CORS code against your framework version and security requirements before deploying.

What's inside

  • SKILL.md

Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.