Agent skill · Backend & API

api

RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 10 KB
Bundled scripts: none
Allowed tools: ReadWriteEditBashGrepGlob
Path: skills/api/api/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# API 开发技能 本技能提供 RESTful API 开发的最佳实践和模式。 ## 触发条件 - 创建 API 端点 - 设计 REST API - 实现后端路由 - 处理请求/响应 - API 版本控制 ## RESTful 设计原则 ### URL 设计 ``` # 资源命名 - 使用名词复数 GET /api/v1/users # 获取用户列表 GET /api/v1/users/:id # 获取单个用户 POST /api/v1/users # 创建用户 PUT /api/v1/users/:id # 更新用户(完整替换) PATCH /api/v1/users/:id # 更新用户(部分更新) DELETE /api/v1/users/:id # 删除用户 # 嵌套资源 GET /api/v1/users/:id/orders # 用户的订单 GET /api/v1/users/:id/orders/:orderId # 用户的特定订单 # 动作资源 POST /api/v1/users/:id/activate # 激活用户 POST /api/v1/orders/:id/cancel # 取消订单 ``` ### HTTP 方法语义 | 方法 | 语义 | 幂等 | 安全 | | ------ | -------- | ---- | ---- | | GET | 读取资源 | ✅ | ✅ | | POST | 创建资源 | ❌ | ❌ | | PUT | 完整更新 | ✅ | ❌ | | PATCH | 部分更新 | ❌ | ❌ | | DELETE | 删除资源 | ✅ | ❌ | ## 统一响应格式 ### 成功响应 ```typescript // 单个资源 { "success": true, "data": { "id": "123", "name": "张三", "email": "zhangsan@example.com" } } // 列表资源 { "success": true, "data": [ { "id": "1", "name": "用户1" }, { "id": "2", "name": "用户2" } ], "pagination": { "page": 1, "pageSize": 20, "total": 100, "totalPages": 5 } } // 创建成功 { "success": true, "data": { "id": "123", ... }, "message": "创建成功" } ``` ### 错误响应 ```typescript { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "请求参

What's inside
Steps it walks through
  1. 触发条件
  2. RESTful 设计原则
  3. URL 设计
  4. HTTP 方法语义
  5. 统一响应格式
  6. 成功响应
  7. 错误响应
  8. API 路由实现
  9. Next.js App Router
  10. FastAPI
  11. Express.js
  12. 查询参数处理
  13. 分页
  14. 排序
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the api skill do?

RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going