·api-design-patterns
</>

api-design-patterns

hieutrtr/ai1-skills

使用 Pydantic v2 的 FastAPI 项目的 API 合约设计约定。在设计阶段规划新的 API 端点、定义请求/响应契约、设计分页或过滤、标准化错误响应或规划 API 版本控制时使用。涵盖 RESTful 命名、HTTP 方法语义、Pydantic v2 模式命名约定 (XxxCreate/XxxUpdate/XxxResponse)、基于游标的分页、标准错误格式和 OpenAPI 文档。不涵盖实现细节(使用 python-backend-expert)或系统级架构(使用 system-architecture)。

11安装·1热度·@hieutrtr

安装

$npx skills add https://github.com/hieutrtr/ai1-skills --skill api-design-patterns

SKILL.md

| GET /v1/users | GET /v1/getUsers | No verbs — HTTP method implies action | | POST /v1/users | POST /v1/user/create | POST to collection = create | | GET /v1/order-items | GET /v1/orderItems | Kebab-case, not camelCase | | GET /v1/users/{id}/orders | GET /v1/users/{id}/orders/{oid}/items | Max 2 nesting levels |

| POST /v1/orders/{id}/actions/cancel | POST /v1/cancelOrder/{id} | Action sub-resource for non-CRUD |

| Method | Purpose | Request Body | Success Status | Idempotent |

使用 Pydantic v2 的 FastAPI 项目的 API 合约设计约定。在设计阶段规划新的 API 端点、定义请求/响应契约、设计分页或过滤、标准化错误响应或规划 API 版本控制时使用。涵盖 RESTful 命名、HTTP 方法语义、Pydantic v2 模式命名约定 (XxxCreate/XxxUpdate/XxxResponse)、基于游标的分页、标准错误格式和 OpenAPI 文档。不涵盖实现细节(使用 python-backend-expert)或系统级架构(使用 system-architecture)。 来源:hieutrtr/ai1-skills。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/hieutrtr/ai1-skills --skill api-design-patterns
分类
</>开发工具
认证
收录时间
2026-02-05
更新时间
2026-02-18

快速解答

什么是 api-design-patterns?

使用 Pydantic v2 的 FastAPI 项目的 API 合约设计约定。在设计阶段规划新的 API 端点、定义请求/响应契约、设计分页或过滤、标准化错误响应或规划 API 版本控制时使用。涵盖 RESTful 命名、HTTP 方法语义、Pydantic v2 模式命名约定 (XxxCreate/XxxUpdate/XxxResponse)、基于游标的分页、标准错误格式和 OpenAPI 文档。不涵盖实现细节(使用 python-backend-expert)或系统级架构(使用 system-architecture)。 来源:hieutrtr/ai1-skills。

如何安装 api-design-patterns?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/hieutrtr/ai1-skills --skill api-design-patterns 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/hieutrtr/ai1-skills