fastapi-endpoint
使用异步 SQLAlchemy、Pydantic v2 模型、用于身份认证的依赖注入及 pytest 测试,规划并构建可用于生产的 FastAPI 端点。采用访谈式规划,在编写任何代码之前明确数据模型、身份认证方式、分页策略和缓存。
译文已校对查看英文原文
Plan and build production-ready FastAPI endpoints with async SQLAlchemy, Pydantic v2 models, dependency injection for auth, and pytest tests. Uses interview-driven planning to clarify data models, authentication method, pagination strategy, and caching before writing any code.
适用对象:软件开发与测试。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- FastAPI Endpoint Builder
- When to use
- Phase 1: Explore (Plan Mode)
- Project structure
- Existing patterns
- Test patterns
- Phase 2: Interview (AskUserQuestion)
- Round 1: Core endpoint
Use this skill when you need to: Add new API endpoints to an existing FastAPI project Build CRUD operations with proper validation and error handling Set up authenticated endpoints with dependency injection Create async database queries with SQLAlchemy 2.0 Generate complete test coverage for API routes Enter plan mode. Before writing any code, explore the existing project to understand: Find the FastAPI app entry point (main.py, app.py, or app/init.py) Identify the router organization pattern (single file vs routers/ directory) Check for existing models/, schemas/, crud/, or services/ directories Look at pyproject.toml or requirements.txt for installed dependencies How are existing endpoints structured? (function-based vs class-based) What ORM is used? (SQLAlchemy 2.0 async, Tortoise, raw SQL, none) How is the database session managed? (Depends(getdb), middleware, other) What auth pattern exists? (OAuth2PasswordBearer, API key header, custom) Are there existing Pydantic base models or shared schemas? What response format is standard? (direct model, wrapped {"data": ..., "meta": ...}) Where do tests live? (tests/, test.py, test.py) What test client is used? (httpx AsyncClient, TestC
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- davila7/claude-code-templates
- 源文件
- cli-tool/components/skills/web-development/fastapi-endpoint/SKILL.md
- 固定版本
- 21be197f100a12b8d0dd9a211cc244c8179f84d3
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:davila7/claude-code-templates · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:40.826Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。