AgentSkillsCN

Backend API

遵循 REST 原则,以恰当的 HTTP 方法、状态码与 URL 规范设计并实现 RESTful API 端点。适用于创建或修改 API 路由、路由处理器、API 端点文件、负责处理 HTTP 请求与响应的控制器文件,或任何用于定义 RESTful 端点的服务器端文件时使用。在进行 API 版本控制、实施速率限制、设计基于资源的 URL、处理用于筛选/排序/分页的查询参数,或规划嵌套资源端点时,均可运用此技能。适用于在 routes.js、api.js、controllers/、handlers/、endpoints/ 等文件中编写代码,或任何用于定义 HTTP API 路由与响应的文件时使用。

SKILL.md
--- frontmatter
name: Backend API
description: Design and implement RESTful API endpoints following REST principles with proper HTTP methods, status codes, and URL conventions. Use this skill when creating or modifying API routes, route handlers, API endpoint files, controller files that handle HTTP requests and responses, or any server-side files that define RESTful endpoints. Use this when working on API versioning, implementing rate limiting, designing resource-based URLs, handling query parameters for filtering/sorting/pagination, or structuring nested resource endpoints. Use this when writing code in files like routes.js, api.js, controllers/, handlers/, endpoints/, or any file that defines HTTP API routes and responses.

Backend API

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend API.

When to use this skill:

  • When creating or editing API route definition files (e.g., routes.js, api.ts, router.js)
  • When writing or modifying API controller files that handle HTTP requests and responses
  • When implementing RESTful endpoints with HTTP methods (GET, POST, PUT, PATCH, DELETE)
  • When designing resource-based URL structures (e.g., /users, /products, /orders)
  • When implementing API versioning strategies in your endpoints
  • When adding query parameters for filtering, sorting, pagination, or search functionality
  • When setting up rate limiting headers and response structures
  • When returning appropriate HTTP status codes (200, 201, 400, 404, 500, etc.)
  • When working on nested resource endpoints
  • When structuring consistent API response formats

Instructions

For details, refer to the information provided in this file: backend API