Home › Python / FastAPI › Python FastAPI AGENTS.md

Python FastAPI AGENTS.md

Universal AGENTS.md for Codex, Jules, Cursor and other agents working on a FastAPI + uv project.

AGENTS.mdPython / FastAPI

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md

## Setup
- `uv sync` installs everything. Run commands with `uv run`.
- Start: `uv run fastapi dev app/main.py`

## Checks (all must pass before you finish)
- `uv run ruff format . && uv run ruff check .`
- `uv run mypy app`
- `uv run pytest -q`

## Conventions
- Routers stay thin; logic goes in `app/services/`.
- Pydantic v2 schemas for all I/O. Use `model_config = ConfigDict(from_attributes=True)` for ORM mapping.
- New env vars must be added to `app/config.py` and `.env.example`.

## PRs
- Title: `<area>: <imperative summary>`. Include what changed, why, and how it was tested.
- Keep diffs focused; no drive-by reformatting of untouched files.

Related rules

Flutter AGENTS.md

AGENTS.md for Flutter apps with Riverpod, go_router and clean feature-first structure.

AGENTS.mdFlutter

Godot 4 GDScript AGENTS.md

AGENTS.md for Godot 4 projects using typed GDScript, signals and scene composition.

AGENTS.mdGodot

MCP server (TypeScript) AGENTS.md

AGENTS.md for building Model Context Protocol servers in TypeScript with clear tools, zod schemas and safe defaults.

AGENTS.mdMCP servers

Python FastAPI rules

Cursor rules for FastAPI services with Pydantic v2, SQLAlchemy 2.0, async, and pytest.

CursorPython / FastAPI

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.