agentleFS
cookieMonsterDevcookieMonsterDev/agents-skills/skills/docs/fastapi-docs/SKILL.md

fastapi-docs

Skill7 starsChanged 15 days agoMITView on GitHub

Official FastAPI documentation, answered with links to the exact pages. Use for any FastAPI question, including path operations, dependencies, Pydantic models and validation, security and OAuth2, OpenAPI docs, WebSockets and background tasks, testing, or deployment.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write Pydantic v2 models, which the docs recommend.

    line 34
  2. Distinctive:

    Use FastAPI dependency injection, kept separate from Django REST Framework or Flask patterns.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

FastAPI Docs

FastAPI answers drift with its releases and the move from Pydantic v1 to v2, so ground each answer in the live docs at https://fastapi.tiangolo.com/, not memory, and link the exact page behind every claim.

Route Django ORM, admin or URLconf patterns to django-docs, and Flask blueprints, WSGI context or Jinja-first apps to flask-docs. Starlette internals and standalone Pydantic belong to their own docs unless the question turns on FastAPI's documented integration.

Workflow

  1. Locate the question in references/topic-map.md, a selective index of docs entry points. Done when each part of the question maps to a section of the map, or you have noted that none fits.
  2. Search fastapi.tiangolo.com with the user's exact terms plus FastAPI vocabulary such as Depends, APIRouter, response_model, HTTPException, lifespan, or TestClient, starting from the map's pages and the Routing rules below. Done when you hold the one page that most directly answers each part.
  3. Read each page down to the relevant section. Done when you have read the passage behind every claim you will make. When a page has moved, been renamed, or stops short, say so and link the nearest authoritative pages.
  4. Answer with the direct answer first, each docs link beside the claim it supports, and code examples only when the user asks or the page needs them. Mark any conclusion that joins several pages as Inference:. Done when every claim cites a specific page, not the docs home.

Routing

  • Pydantic v2 migration: the Pydantic v1 to v2 recipe.
  • First steps: First Steps and the Tutorial - User Guide, before deep reference pages.
  • Recommended patterns: the tutorial; exact signatures: the API reference.
  • Validation: the tutorial sections on parameters and bodies, before Pydantic config.
  • Dependencies: Depends, sub-dependencies, and dependencies with yield.
  • Security: Security - First Steps and the OAuth2 guides.
  • Async: Concurrency and async/await, for whether a route needs def or async def.
  • Deployment: the Deployment section and its Uvicorn and Docker guides.
  • OpenAPI: Metadata and Docs URLs, or the advanced OpenAPI guides.

Gotchas

  • FastAPI hands request data to handlers through parameters and dependencies rather than a Flask-style global request object, and handlers can be async def.
  • Write Pydantic v2 models, which the docs recommend; v1 patterns differ.
  • Choose def or async def per the Concurrency and async/await page, matching I/O-bound and CPU-bound work to the guidance there.
  • FastAPI generates the OpenAPI schema from type hints; customize it through the OpenAPI guides rather than writing it by hand.
  • Use FastAPI dependency injection, kept separate from Django REST Framework or Flask patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.