majiayu000/claude-skill-registry-data/python-fastapi
- community
Checking that the SKILL.md file is still in the repository.
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-fastapiSKILL.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
- App Bootstrap: Use
lifespancontext manager for startup/shutdown; initialize DB connections and close them cleanly - Pydantic Models: Use
ConfigDict(strict=True)for input; useConfigDict(from_attributes=True)for ORM output; always define field constraints withField(...) - Dependency Injection: Define
Dependsfunctions for DB sessions and services; compose dependencies to build service instances - Route Definitions: Use
status_codeparameter; useresponse_modelto control output serialization; usetagsfor OpenAPI grouping - Error Handling: Define a custom
AppExceptionwith structured code/message; register@app.exception_handlerto produce consistent JSON error responses - Async SQLAlchemy: Use
sqlalchemy[asyncio]withasyncpg; useasync_sessionmaker; useselect()statements, never legacy Query API - Router Organization: Use
APIRouterper domain withprefixandtags; register routers on the main app - Background Work: Use
BackgroundTasksfor fire-and-forget; useasyncio.create_taskor 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
- SKILL.md in the repositoryCheckingother/python-fastapi/SKILL.md
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
[](https://verified-skill.com/skills/majiayu000/claude-skill-registry-data/python-fastapi)