When designing and implementing web interfaces to ensure they are usable by everyone.
中文简介正在准备中。当前显示原文说明。
When creating or extending an HTTP API for client consumption.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
REST APIs MUST be intuitive, predictable, and semantically correct. This skill ensures APIs use HTTP methods correctly, communicate errors clearly via standard formats, and maintain consistency across resources so clients can interact with them reliably without surprise behavior.
/users/{id}/orders ONLY)limit and offset (or cursor-based pagination)/v1/ prefix or header-based versioning from day oneGET /getUsers)GET /getUsers, POST /createOrder (use nouns + HTTP methods){ status: 'error' } payload (use 4xx/5xx status codes)/companies/{id}/departments/{id}/employees/{id}/tasks (use max 2 levels)/api/users without versioning path for future breaking changestype, title, detail, statuslimit and offset parameters/v1/users or header-based)/user-profiles not /userProfiles)type, title, detail, status, instance)limit, offset, total in collection response envelope/v1/ URL prefix or API-Version: 1.0 headerlimit=999999999)❌ Anti-pattern (Verbs in URL, wrong status codes, deep nesting, no pagination):
GET /api/getUsers HTTP/1.1
HTTP/1.1 200 OK
{
"status": "error",
"message": "User not found"
}
GET /api/companies/123/departments/456/employees/789/tasks/assignToUser HTTP/1.1
✅ Correct pattern (Nouns, semantic status, proper nesting, paginated):
GET /v1/users?limit=20&offset=0 HTTP/1.1
HTTP/1.1 200 OK
{
"data": [...],
"pagination": {
"limit": 20,
"offset": 0,
"total": 150
}
}
GET /v1/users/123 HTTP/1.1
HTTP/1.1 404 Not Found
{
"type": "https://api.example.com/errors/resource-not-found",
"title": "Resource Not Found",
"detail": "The requested user does not exist",
"status": 404,
"instance": "/v1/users/123"
}
GET /v1/users/123/orders?limit=10&offset=0 HTTP/1.1
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
When designing and implementing web interfaces to ensure they are usable by everyone.
中文简介正在准备中。当前显示原文说明。
When improving read performance and reducing database load.
中文简介正在准备中。当前显示原文说明。
When configuring automated build, test, and deployment workflows for a repository.
中文简介正在准备中。当前显示原文说明。
When asynchronously reviewing peer code before merging into the main branch.
中文简介正在准备中。当前显示原文说明。
When addressing slow application endpoints, high database CPU usage, or standardizing data access patterns.
中文简介正在准备中。当前显示原文说明。
When isolating and fixing unpredictable or complex software bugs.
中文简介正在准备中。当前显示原文说明。