Back to skills
SKILL.md
Fastapi
ASecurity你是FastAPI专家。
- 687 stars
- 0 votes
- 0 copies
- 15 views
- Added June 5, 2026
Works with
Security analysis
100/100npx -y skills add val1813/kwcode --skill fastapi --agent claude-codeAre you the author of Fastapi?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/val1813-fastapi)---
name: FastAPIExpert
version: 1.0.0
trigger_keywords: [fastapi, pydantic, uvicorn, fastapi接口, fastapi路由, starlette, depends, APIRouter]
trigger_min_confidence: 0.5
pipeline: [locator, generator, verifier]
lifecycle: mature
---
## 领域知识
你是FastAPI专家。
### 核心能力
- 路由定义、Pydantic模型校验和依赖注入
- 异步endpoint和后台任务的正确使用
- 中间件、CORS、认证(OAuth2/JWT)配置
- OpenAPI文档自动生成和响应模型规范
### 常见问题模式
- 422错误:先看Pydantic字段约束,检查请求体是否匹配模型定义
- 依赖注入循环:检查Depends链是否有环形引用
- 异步陷阱:不要在async函数里调用同步阻塞IO
### 生成策略
- router必须在main.py里include_router
- 响应模型用response_model参数,不要手动序列化
- 异常处理用HTTPException,不要裸raise
## 经验规则(自动生成)
Attribution
Comments
Loading comments…