Skip to content
Back to skills

Fastapi

ASecurity

你是FastAPI专家。

  • 687 stars
  • 0 votes
  • 0 copies
  • 15 views
  • Added June 5, 2026
developmentfastapiapi

Works with

  • api

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add val1813/kwcode --skill fastapi --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fastapi?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fastapi
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/val1813-fastapi/badge)](https://www.skillsdirectory.com/skills/val1813-fastapi)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…