“python-312-fastapi-best-practices-cursorrules-prom” is a ready-made rule for Code review and quality, built for Cursor. Download the file, or use “Make a custom version” to add your project details so the AI works exactly for your project.
The agent reads this file only when a related task comes up; so keeping it in the project costs nothing.
Here are some best practices and rules you must follow:
You use Python 3.12
Frameworks:
pydantic
fastapi
sqlalchemy
You use poetry for dependency management
You use alembic for database migrations
You use fastapi-users for user management
You use fastapi-jwt-auth for authentication
You use fastapi-mail for email sending
You use fastapi-cache for caching
You use fastapi-limiter for rate limiting
You use fastapi-pagination for pagination
Use Meaningful Names: Choose descriptive variable, function, and class names.
Follow PEP 8: Adhere to the Python Enhancement Proposal 8 style guide for formatting.
Use Docstrings: Document functions and classes with docstrings to explain their purpose.
Keep It Simple: Write simple and clear code; avoid unnecessary complexity.
Use List Comprehensions: Prefer list comprehensions for creating lists over traditional loops when appropriate.
Handle Exceptions: Use try-except blocks to handle exceptions gracefully.
Use Virtual Environments: Isolate project dependencies using virtual environments (e.g., venv).
Write Tests: Implement unit tests to ensure code reliability.
Use Type Hints: Utilize type hints for better code clarity and type checking.
Avoid Global Variables: Limit the use of global variables to reduce side effects.
These rules will help you write clean, efficient, and maintainable Python code.
Build a custom version for your project
Write your project details; to the end of Rule is added, and you get a file that is given to the AI without extra explanation. Everything is built in your browser and no data goes to the server.
Preview of the final file
Where do I put the file?
Claude Code.claude/skills/python-312-fastapi-best-practices-cursorrules-prom/SKILL.md
Team projects: commit the file to the repository so every agent on the team follows the same rules. With Build a bundle Get several skills together, with the correct structure.
Frequently asked questions
Rule “python-312-fastapi-best-practices-cursorrules-prom” — where do I put it?
for Claude Code in .claude/skills/python-312-fastapi-best-practices-cursorrules-prom/SKILL.md, for Codex in .agents/skills, for Copilot in .github/skills and for Cursor in .cursor/skills or .cursor/rules. Use the “Build a bundle” button to get a zip with the correct structure.
Can I modify it for my own project?
Yes. The license CC0-1.0 allows modification and commercial use. With “Build a custom version” your project's details are added to the file, and you can edit the text afterward.
This Rule Which tools does it work with?
With Cursor. Standard Agent Skills are read by all modern coding agents.
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals…
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving…
Bootstrap, develop, and design modern WinUI 3 desktop applications with C# and the Windows App SDK using official Microsoft guidance, WinUI Gallery patterns, Windows App SDK samples, and CommunityToolkit components.…
This guide provides definitive best practices for Android SDK development in Java, focusing on modern architecture, Jetpack libraries, performance, security, and testing.