backend-api

设计并实现具有适当HTTP方法、状态码和一致命名约定的RESTful API端点。在创建或修改API路由、端点或服务器端请求处理程序时使用此技能。在处理src/pages/api/中的文件、包含API路由定义的文件、实现REST端点的文件、处理HTTP请求和响应的文件、API请求的服务器中间件、API身份验证和授权逻辑以及定义API版本控制策略的文件时使用此功能。在设计资源的URL结构、实现过滤/排序/分页的查询参数处理、为API端点设置速率限制或配置CORS和API安全标头时使用此功能。

📖 中文导读:设计并实现具有适当HTTP方法、状态码和一致命名约定的RESTful API端点。在创建或修改API路由、端点或服务器端请求处理程序时使用此技能。在处理src/pages/api/中的文件、包含API路由定义的文件、实现REST端点的文件、处理HTTP请求和响应的文件、API请求的服务器中间件、API身份验证和授权逻辑以及定义API版本控制策略的文件时使用此功能。在设计资源的URL结构、实现过滤/排序/分页的查询参数处理、为API端点设置速率限制或配置CORS和API安全标头时使用此功能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Backend API description: Design and implement RESTful API endpoints with proper HTTP methods, status codes, and consistent naming conventions. Use this skill when creating or modifying API routes, endpoints, or server-side request handlers. When working on files in src/pages/api/, files containing API route definitions, files implementing REST endpoints, files handling HTTP requests and responses, server middleware for API requests, API authentication and authorization logic, and files defining API versioning strategies. When designing URL structures for resources, implementing query parameter handling for filtering/sorting/pagination, setting up rate limiting for API endpoints, or configuring CORS and API security headers.

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 files (e.g., src/pages/api/*.ts, src/pages/api/*.js)
  • When implementing RESTful endpoints with GET, POST, PUT, PATCH, DELETE methods
  • When designing resource-based URL structures and route hierarchies
  • When handling query parameters for filtering, sorting, pagination, or search functionality
  • When defining API response formats and HTTP status codes
  • When implementing API versioning strategies (URL path or header-based)
  • When setting up rate limiting, throttling, or API quota management
  • When configuring API security headers, CORS policies, or authentication middleware
  • When writing server-side request handlers or middleware functions
  • When working on API documentation or OpenAPI/Swagger specifications

Instructions

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