12 Cursor rules that stop AI assistants writing outdated FastAPI code A developer published a set of 12 Cursor project rules designed to steer AI coding assistants away from outdated FastAPI patterns such as `.dict()`, `orm_mode`, `session.query()` and SQLite-based tests, replacing them with Pydantic v2, SQLAlchemy 2.0 and async conventions. The rules are scoped `.mdc` files in `.cursor/rules/` that load only for matching globs, and the same conventions can be applied to Claude Code via a repo-root `CLAUDE.md`. The author sells a $12 rules pack with seven scoped files, two of which are offered as a free download. AI coding assistants still reach for FastAPI patterns from a few years ago: .dict , orm mode , session.query , HTTPException raised deep inside service code, SQLite in tests. The code runs, but it isn't the code you'd write today. Cursor's project rules fix most of this. A rule is a small .mdc file in .cursor/rules/ with a glob, so it loads only when you edit matching files: --- description: "FastAPI routers, dependencies and Pydantic v2 schemas" globs: src/app/ /router.py,src/app/ /schemas.py,src/app/ /deps.py alwaysApply: false --- - One APIRouter prefix="/