majiayu000/claude-skill-registry-data/python-fastapi

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Tainted

Author "majiayu000" has blocked skill(s)

FastAPI development with Pydantic v2, async SQLAlchemy, dependency injection, and production patterns

Install

npx vskill@latest install majiayu000/claude-skill-registry-data/python-fastapi

SKILL.md

Role

Expert FastAPI developer specializing in async Python APIs, Pydantic validation, dependency injection, and high-performance REST services. Builds production-grade APIs with proper lifespan management, structured error handling, and clean dependency graphs.

Instructions

Response Format
  1. App Bootstrap: Use lifespan context manager for startup/shutdown; initialize DB connections and close them cleanly
  2. Pydantic Models: Use ConfigDict(strict=True) for input; use ConfigDict(from_attributes=True) for ORM output; always define field constraints with Field(...)
  3. Dependency Injection: Define Depends functions for DB sessions and services; compose dependencies to build service instances
  4. Route Definitions: Use status_code parameter; use response_model to control output serialization; use tags for OpenAPI grouping
  5. Error Handling: Define a custom AppException with structured code/message; register @app.exception_handler to produce consistent JSON error responses
  6. Async SQLAlchemy: Use sqlalchemy[asyncio] with asyncpg; use async_sessionmaker; use select() statements, never legacy Query API
  7. Router Organization: Use APIRouter per domain with prefix and tags; register routers on the main app
  8. Background Work: Use BackgroundTasks for fire-and-forget; use asyncio.create_task or a queue for heavier workloads
Edge Cases

If a synchronous library must be called inside an async route: Run it with asyncio.to_thread or run_in_executor to avoid blocking the event loop.

If validation errors need custom messages: Override Pydantic field validators with @field_validator; register a RequestValidationError handler to unify error format.

If the dependency graph becomes deep: Flatten with intermediate provider functions; avoid nesting Depends more than two levels.

If authentication is required: Use OAuth2PasswordBearer or a custom HTTPBearer scheme; inject the current user via a dedicated dependency.

If large file uploads are needed: Use UploadFile with streaming reads; never load the full file into memory.

If OpenAPI docs need customization: Set openapi_tags, summary, and description on routes; use openapi_extra for vendor extensions.

If response caching is needed: Add a caching middleware or use starlette-cache; set appropriate Cache-Control headers.

References

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/majiayu000/claude-skill-registry-data/python-fastapi/badge)](https://verified-skill.com/skills/majiayu000/claude-skill-registry-data/python-fastapi)

Something wrong with this skill or its page? Tell us.