Agent skill · Backend & API

backend/api-development

后端API开发方法论,包括RESTful/GraphQL设计、请求验证、错误处理和安全实现

echoVicgithub.com/echoVicGitHub ↗
claude-codecursorMIT
Install
npx skills add echoVic/boss-skill --skill api-development --agent claude-code

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

Facts
Files in the skill folder: 1
SKILL.md size: 8 KB
Bundled scripts: none
Path: skill/skills/backend/api-development/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 557
Language: TypeScript

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

From the SKILL.md

# 后端 API 开发方法论 ## API 契约管理 ### 契约来源 实现 API 前,**必须**阅读 `architecture.md` §5(API 设计),获取: - API 规范(RESTful/GraphQL) - 接口列表(方法、路径、描述、认证要求) - 请求/响应格式约定 - 错误码规范 ### 契约遵守原则 1. **严格实现**:API 端点的方法、路径、参数必须与 architecture.md §5 一致 2. **响应格式**:遵循统一的成功/错误响应结构 3. **偏差记录**:如需偏离契约,必须在输出报告中标注原因 4. **类型导出**:将请求/响应类型导出到共享文件,供前端引用 ## RESTful API 设计 ### 资源命名规范 | 操作 | HTTP 方法 | 路径 | 说明 | |------|-----------|------|------| | 列表 | GET | `/api/users` | 获取用户列表 | | 详情 | GET | `/api/users/:id` | 获取单个用户 | | 创建 | POST | `/api/users` | 创建新用户 | | 更新 | PUT/PATCH | `/api/users/:id` | 更新用户 | | 删除 | DELETE | `/api/users/:id` | 删除用户 | ### 统一响应格式 **成功响应**: ```json { "success": true, "data": { ... }, "message": "Operation successful" } ``` **错误响应**: ```json { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid input data", "details": [ { "field": "email", "message": "Invalid email format" } ] } } ``` ### 分页规范 **请求参数**: ``` GET /api/users?page=1&pageSize=20&sortBy=createdAt&order=desc ``` **响应格式**: ```json { "success": true, "data": { "items": [...], "pagination": { "page": 1, "pageSize": 20, "total": 100, "totalPages": 5 } } } ``` ## 请求验证 ### 输入验证层级 1. **路由层**:验证路径参数和查询参数 2. **中间件层**:验证请求体格式和必填字段

What's inside
Steps it walks through
  1. API 契约管理
  2. 契约来源
  3. 契约遵守原则
  4. RESTful API 设计
  5. 资源命名规范
  6. 统一响应格式
  7. 分页规范
  8. 请求验证
  9. 输入验证层级
  10. 验证示例
  11. 常见验证规则
  12. 错误处理
  13. 错误分类
  14. 统一错误处理中间件
More from boss-skill
All skills →
About this skill
What does the backend/api-development skill do?

后端API开发方法论,包括RESTful/GraphQL设计、请求验证、错误处理和安全实现

How do I install it?

Run `npx skills add echoVic/boss-skill --skill api-development --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 echoVic/boss-skill, a repository with 557 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