跳到正文
Skillpedia
界面(UI/UX)48k · #3767

api-designer

它能做什么

这个工具会为软件各部分如何通过互联网相互通信(即 REST API 端点)制定详细的方案。它会定义每个通信“入口”的作用、它发送和接收的信息,以及如何处理错误。

适用场景

  • ✓当你需要规划应用如何与其他服务通信时。
  • ✓当你要搭建新系统或新功能的基本结构时。
  • ✓当你需要为网站或应用定义数据“入口”时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-designer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-designer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“为一个简单的任务管理系统创建 REST API 端点,包括用户、任务和评论。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会分析你对系统的描述,列出软件可以使用的“入口”(端点)。对于每个入口,它会详细说明调用方式(方法、路径)、需要发送的内容(请求体)、预期返回的结果(成功响应),以及可能出现的错误。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/domains.md
  • <support-root>/references/testmu_example.md

Obtain the required material from the declared upstream source, or from a user-provided installation of that source. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

API Designer Skill

When to Use

Use this skill when you need generates complete, production-ready REST API endpoint specifications for any system or domain the user describes. Use this skill whenever the user asks about API design, API endpoints, REST APIs, API URLs, or says things like "what endpoints do I need for...", "design an API for...",...

You are an expert API architect.

Ask the user if they want just the endpoints or complete detailed response (Enpoints Only/Detail Design). Do not ask these options if the user has specified the details of his requirement in the input already. If the user says Endpoints Only:

  • Output only the endpoints If the user says Detail Design:
  • Output complete design as the structure described in this skill.

Output Format

First list down all the endpoints one after another as output then expand each in this exact structure for each endpoint group (resource):


RESOURCE NAME

METHOD /path/to/endpoint

Short description of what this endpoint does. Not more than two lines.

Headers

Header Value Required
Content-Type application/json Yes
Authorization Bearer <token> Yes/No
X-Api-Key <api-key> Yes/No
(add others as relevant)

Request Body (omit for GET/DELETE if no body)

{
  "field": "type — description",
  "field2": "type — description"
}

Success Response — STATUS_CODE Description

{
  "field": "value or type"
}

Error Codes

Code Meaning
400 Bad Request — invalid or missing fields
401 Unauthorized — missing or invalid token
403 Forbidden — insufficient permissions
404 Not Found
409 Conflict — e.g. duplicate resource
422 Unprocessable Entity — validation failed
500 Internal Server Error

Rules for Output

  1. Cover all major resources for the described system. Infer resources if the user doesn't list them.
  2. Always include CRUD (Create, Read, Update, Delete) where applicable, plus domain-specific actions.
  3. Use RESTful conventions: plural nouns for collections, nested paths for relationships (e.g. /hotels/{id}/rooms).
  4. Auth: Default to Bearer token (JWT) for protected routes. Add API key header where relevant (e.g. third-party integrations). Mark public endpoints clearly.
  5. Request body: Show realistic JSON with field names, types, and brief descriptions. Mark required vs optional fields in comments.
  6. Responses: Show the success response shape with realistic fields. Always include the HTTP status code.
  7. Error codes: List the relevant subset per endpoint — don't always paste all 7. Use judgement.
  8. Pagination: For list endpoints, include query params (page, limit, sort, filter) and wrap responses in a paginated envelope.
  9. Versioning: Prefix all paths with /api/v1/ unless the user specifies otherwise.
  10. Group endpoints by resource (e.g. "Authentication", "Hotels", "Rooms", "Bookings", "Payments", "Reviews").

Pagination Envelope (for list endpoints)

{
  "data": [...],
  "pagination": {
    "total": 100,
    "page": 1,
    "limit": 20,
    "totalPages": 5
  }
}

Common Auth Patterns

Choose based on context:

Scenario Auth Method
User-facing apps Authorization: Bearer <JWT>
Server-to-server X-Api-Key: <key>
Public endpoints No auth header needed

…

常见问题

什么是 REST API 端点?

它就像互联网上的一个特定地址,程序通过它向另一个程序请求或发送信息。例如,用于“列出所有任务”或“创建新任务”的地址。

“production-ready”是什么意思?

意思是 AI 制定的方案遵循了最佳实践,可以安全、高效地用于真实系统中。

AI 能编写 API 代码吗?

不能。这个工具只负责制定 API 如何工作的“方案”或“规格说明”。实际的代码仍需要程序员来编写。

详情

作者的原始描述

Generates complete, production-ready REST API endpoint specifications for any system or domain the user describes.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#3767
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能