api-protocol
Sunrei项目的API协议指南。在编写 API 端点、请求/响应类型命名和 HTTP 方法约定时使用。
📖 中文导读:Sunrei项目的API协议指南。在编写 API 端点、请求/响应类型命名和 HTTP 方法约定时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: api-protocol description: API protocol guide for Sunrei project. Use when writing API endpoints, request/response type naming, and HTTP method conventions.
API Protocol Guide
RESTful API + OpenAPI 3.0 spec
- Request type:
{HttpMethod}{Name}Params(e.g.,GetUserParams,ListUsersParams) - Response type:
{HttpMethod}{Name}Result(e.g.,GetUserResult,ListUsersResult)
HTTP Method Rules
GET+ singular → single item (e.g.,GET /sunreis/{id})List+ plural → list items (e.g.,GET /sunreis)POST→ createPUT→ full updatePATCH→ partial updateDELETE→ delete
Response Format
- Success:
{ "data": ... }or domain key (e.g.,{ "sunreis": [...] }) - Error:
{ "error": { "code": "...", "message": "..." } } - Pagination:
{ "items": [...], "nextToken": "..." }