Skip to content
FunCoding

FastAPIExpert

Star
681
Last commit
May 14, 2026

kaiwu/builtin_experts/fastapi/SKILL.md

View on GitHub

领域知识

你是FastAPI专家。

核心能力

  • 路由定义、Pydantic模型校验和依赖注入
  • 异步endpoint和后台任务的正确使用
  • 中间件、CORS、认证(OAuth2/JWT)配置
  • OpenAPI文档自动生成和响应模型规范

常见问题模式

  • 422错误:先看Pydantic字段约束,检查请求体是否匹配模型定义
  • 依赖注入循环:检查Depends链是否有环形引用
  • 异步陷阱:不要在async函数里调用同步阻塞IO

生成策略

  • router必须在main.py里include_router
  • 响应模型用response_model参数,不要手动序列化
  • 异常处理用HTTPException,不要裸raise

经验规则(自动生成)

Similar Skills

rea-analysis-optimization

MOmorluto/rea485k7,690 new stars in the last 7 days

codebase-design

MAmattpocock/skills336k4,217 new stars in the last 7 days

Featured

diagnosing-bugs

Diagnose hard bugs and performance regressions by building a feedback loop with tests or scripts.

MAmattpocock/skills336k4,217 new stars in the last 7 days

setup-ts-deep-modules

MAmattpocock/skills336k4,217 new stars in the last 7 days

code-review

MAmattpocock/skills336k4,217 new stars in the last 7 days

implement

MAmattpocock/skills336k4,217 new stars in the last 7 days