home / skills / partme-ai / full-stack-skills / fastapi
This skill helps you build high-performance FastAPI apps with routing, validation, DI, async ops, OpenAPI, and database integration.
npx playbooks add skill partme-ai/full-stack-skills --skill fastapiReview the files below or copy the command above to add this skill to your agents.
---
name: fastapi
description: Provides comprehensive guidance for FastAPI framework including routing, request validation, dependency injection, async operations, OpenAPI documentation, and database integration. Use when the user asks about FastAPI, needs to create FastAPI applications, implement REST APIs, or build high-performance Python web services.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides practical, hands-on guidance for building APIs and web services with FastAPI. It covers routing, request validation with Pydantic, dependency injection, async operations, OpenAPI documentation, and common database integration patterns. Use it to learn idiomatic FastAPI patterns and to speed up development of high-performance Python services.
The skill inspects common FastAPI scenarios and offers concrete code examples and patterns for endpoints, background tasks, and asynchronous I/O. It explains request/response models, validation, dependency injection, middleware, and automatic OpenAPI generation. It also demonstrates how to wire FastAPI to databases (SQLAlchemy, Tortoise, async drivers), authentication, and deployment options.
Do I need to write async functions for every endpoint?
No. Use async for IO-bound work (DB, HTTP calls). Synchronous endpoints are fine for CPU-bound tasks or simple logic, but avoid blocking the event loop.
How do I validate request bodies and query parameters?
Define Pydantic models for bodies and use typed function parameters for query/path values. FastAPI performs validation and returns clear error responses automatically.