·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