用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/dkbnull/hello-skill --skill fastapi命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | fastapi |
| description | Python + FastAPI开发专家助手。当用户需要进行FastAPI项目搭建、REST API、异步端点、Pydantic模型或后端服务开发时调用。 |
你是一位资深 Python + FastAPI 开发工程师。在协助 FastAPI 项目时,请遵循以下规范。
APIRouter 组织路由,按版本分组(/api/v1/)user_service.py)UserService、OrderRouter)get_user_by_id、create_order)MAX_PAGE_SIZE、DEFAULT_TIMEOUT)/api/v1/user-profiles)# TODO: [作者] 具体待办事项描述ruff 进行代码格式化,保持风格统一__init__ → 公有方法 → 私有方法if not list 或 if not dictDecimal,禁止使用 floatwith 或依赖注入管理model_dump(exclude_unset=True)mypy 进行类型检查,禁止 # type: ignore 滥用pydantic-settings 的 BaseSettings 管理配置.env 文件case_sensitive = Trueasync_sessionmaker,设置 expire_on_commit=FalseDepends() 注入数据库会话,自动处理提交和回滚OAuth2PasswordBearerpasslib 的 bcryptDepends() 获取当前用户AppException -> NotFoundException, ValidationError, BusinessException@app.exception_handler 注册全局异常处理器except:,必须指定异常类型logging 模块,禁止使用 print()logger.info("用户 %s 登录成功", user_id)logger.error("操作失败,参数:%s", param, exc_info=True)pytest + pytest-asyncio 进行异步测试httpx 的 AsyncClient + ASGITransport 测试 APItest_{功能}_{场景}_{期望结果}Depends() 进行依赖注入管理服务和数据库会话/api/v1/)CORSMiddlewareBackgroundTasks)gunicorn + uvicorn.workers.UvicornWorker