Python Fastapi Best Practices Cursorrules Prompt F Cursorrules

Apply for python-fastapi-best-practices-cursorrules-prompt-f. --- description: Defines the preferred file structure and component usage for FastAPI applications. globs: **/main.py

Tryboy869 f7c225c 2 files · 1019 B Updated

File contents

python-fastapi-best-practices-cursorrules-prompt-f


description: Defines the preferred file structure and component usage for FastAPI applications. globs: **/main.py

  • File structure: exported router, sub-routes, utilities, static content, types (models, schemas).
  • Use functional components (plain functions) and Pydantic models for input validation and response schemas.
  • Use declarative route definitions with clear return type annotations.
  • Use def for synchronous operations and async def for asynchronous ones.
  • Minimize @app.on_event("startup") and @app.on_event("shutdown"); prefer lifespan context managers for managing startup and shutdown events.
  • Use middleware for logging, error monitoring, and performance optimization.

Tryboy869/dojutsu-for-ai/tree/main/senjutsu/skills/python-fastapi-best-practices-cursorrules-prompt-f-cursorrules commit f7c225c5e8

Frequently asked questions

npx skillmds add tryboy869/python-fastapi-best-practices-cursorrules-prompt-f-cursorrul