FastAPI Cursor Rules Starter (Free)

Three FastAPI rules that fix the mistakes agents make most often, ready to drop into .cursor/rules/, plus a linter.

FastAPI Cursor Rules Starter (Free) cover

What it is

3 Cursor project rules for FastAPI you can drop into a repo today, plus lint_rules.py, which tells you why a Cursor rule isn't loading.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 5 tests OK on Python 3.13 and 3.10.

Real terminal output from FastAPI Cursor Rules Starter: demo and passing tests

The rules (in .cursor/rules/)

RuleLoadsFirst instruction
fastapi-overview.mdcalwaysCheck the installed fastapi version before using an API
fastapi-routes-deps.mdcby file (app//*.py, src//*.py, main.py)Declare parameters with Annotated: user: Annotated[User, Depends(get_current_user)], q: Annotated[str / None,...
fastapi-pydantic.mdcby file (app/schemas//*.py, app/models//*.py, /schemas.py)Use v2 APIs: model_config = ConfigDict(...), model_dump(), model_validate(), field_validator, model_validator

Install

Copy .cursor/rules/ into your project root (keep the .mdc extension). Then check them against your code:

python3 tools/lint_rules.py .cursor/rules --project .
./tools/demo.sh        # copies the rules into examples/sample-app and lints them
./run_tests.sh

Honest limits

  • Rules guide the model; they don't enforce anything.
  • Check version-specific advice against your installed versions.

Format and license

Zip, 11 KB, v1.0, 19 files. Free to use, modify and share for any purpose, including commercial work, as long as this notice stays in copies. Not affiliated with or endorsed by Cursor (Anysphere) or the FastAPI project.

FAQ

Which FastAPI version?
Written against 0.162 (Nov 2026); each version-specific rule names the release it changed in, and the overview rule tells the agent to check the installed version.
Is it really free?
Yes, free to use, change and share.
What's in the paid pack?
7 rules: Annotated dependencies, Pydantic v2 schemas, SQLAlchemy 2 and Alembic, security and CORS, testing with dependency overrides, performance.
How do I get the files?
Click Download free. The zip downloads straight away: no checkout, no account.
Do I have to sign up for the newsletter?
No. The form is optional and the download works without it.

Get FastAPI Cursor Rules Starter (Free)

Free FastAPI Cursor rules in .mdc format, checked against current FastAPI docs, plus a linter that shows why a rule isn't applying.

Pairs well with

Download$12

Cursor Rules for SvelteKit

7 Cursor rules for SvelteKit, written against current docs. Installs in one command, exports AGENTS.md for Claude Code and Codex. $12 once.

View Cursor Rules for SvelteKit
DownloadFree

SvelteKit Cursor Rules Starter (Free)

Free SvelteKit Cursor rules in .mdc format, checked against current SvelteKit docs, plus a linter that shows why a rule isn't applying.

View SvelteKit Cursor Rules Starter (Free)
Download$12

Cursor Rules for Expo (React Native)

6 Cursor rules for Expo, written against current docs. Installs in one command, exports AGENTS.md for Claude Code and Codex. $12 once.

View Cursor Rules for Expo (React Native)

Related