api-conventions
API 設計慣例。定義 RESTful 規範、錯誤格式、分頁策略等。 PM、Architect、Backend Dev、QA Reviewer 應注入此 skill。
by maxyeh0817★ 32 GitHub stars
Install api-conventions in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
API Conventions 規範
RESTful 慣例
- 資源命名:複數名詞(
/users,/todos) - HTTP 方法語義:
GET— 讀取(無副作用)POST— 創建PUT— 全量更新PATCH— 部分更新DELETE— 刪除
- URL 路徑:kebab-case(
/user-profiles) - 巢狀資源:最多兩層(
/users/:id/todos)
狀態碼
200— 成功201— 創建成功204— 刪除成功(無回應體)400— 請求格式錯誤401— 未認證403— 無權限404— 資源不存在422— 驗證失敗500— 伺服器內部錯誤
錯誤格式
{
"error": {
"code": "VALIDATION_ERROR",
"message": "人類可讀的錯誤描述",
"details": [
{ "field": "email", "message": "格式不正確" }
]
}
}
分頁策略
- 預設採用 cursor-based 分頁
- 請求參數:
?cursor={cursor}&limit={limit} - 回應格式:
{
"data": [],
"pagination": {
"next_cursor": "abc123",
"has_more": true
}
}
- 預設 limit: 20,最大 limit: 100
版本策略
- URL path versioning(
/api/v1/...) - 只在破壞性變更時升版
已知注意事項
(由 QA 迭代時追加)
詳細模式參考:references/patterns.md 歷史教訓:references/lessons.md
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the api-conventions skill do?
API 設計慣例。定義 RESTful 規範、錯誤格式、分頁策略等。 PM、Architect、Backend Dev、QA Reviewer 應注入此 skill。
How do I install the api-conventions skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the api-conventions skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…