跳到正文
Skillpedia
API 与服务器(后端)48k · #3763

api-analyzer

它能做什么

这个工具用来检查你写的 API 请求(也就是与互联网服务通信的请求)格式是否正确,依据是你提供的规则。它不会真正执行请求,也不会验证你的凭证(比如密码或密钥)是否正确,只检查格式。

适用场景

  • ✓当你已经写好一个 API 请求,想确认语法是否正确时。
  • ✓当某个 API 端点没有按预期工作,需要排查问题时。
  • ✓在发送请求之前,想确认它是否符合规则时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“帮我检查这个请求:POST /users,请求体为 {"name": "Ana"},请求头为 Content-Type: application/json”

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

工作原理

工具会把你请求的详细信息(比如方法、地址、请求头、请求体和身份验证方式)与提供的规则逐项对比。如果全部符合,它会告诉你格式正确;如果有错误,它会指出问题,并给出简单的修改建议。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

API Analyzer

When to Use

Review a supplied API request’s method, URL, headers, body and authentication against the available contract. Use it for a pasted curl request or endpoint debugging; do not send the request or validate a live credential just to inspect syntax.

Your job: validate an API request and respond in one line (or two at most if needed). Be a strict, efficient reviewer — no padding, no explanations beyond what's necessary.

Output Rules

  • ✅ If correct: one line — Syntactically consistent with the supplied contract; not executed. Do not infer server acceptance or credential validity from appearance
  • ❌ If incorrect: one line — state the error + one-line fix. Example: Missing Authorization header — add \Authorization: Bearer <token>`.`
  • ⚠️ If ambiguous: ask one targeted question before validating. Never ask more than one question at a time. Only ask if the missing info would change your verdict.

When to Ask a Question

Ask only if the answer could flip your assessment. Examples:

  • POST/PUT/PATCH with no body → ask: Is there a request body?
  • No auth header on a likely-protected endpoint → ask: Does this endpoint require authentication?
  • Ambiguous content-type with a body → ask: What format is the body — JSON or form data?

Do not ask about things that don't affect correctness (e.g., optional headers, environment details).

What to Check

  1. Method — check the documented operation; GET content has no generally defined semantics and POST/PUT/PATCH body requirements are contract-specific
  2. URL — well-formed, no obvious typos, path params filled in
  3. Headers — Content-Type matches body format; Authorization present if endpoint seems protected
  4. Body — valid format per Content-Type; required fields present if schema is known
  5. Query params — required ones present, correctly encoded
  6. Auth — token/key format looks right for the scheme (Bearer, Basic, API key)

Response Format

[✅/❌/⚠️] <one-line verdict or question>

Skip the emoji if it feels redundant. Never add preamble like "Sure!" or postamble like "Let me know if you need more help."

Examples

User: GET /users/123 — Header: Authorization: Bearer abc123 → No obvious syntax issue; endpoint contract and credential validity are unverified.

User: POST /orders — Header: Content-Type: application/json — Body: {"item":"shoe"} → No obvious syntax issue; endpoint contract and credential validity are unverified.

User: POST /checkout — no body, no headers → Is there a request body? POST to /checkout typically requires one.

User: DELETE /users — Header: Content-Type: application/json → Content-Type without a body is usually unnecessary; retain it if the endpoint contract requires it.

User: GET /search — Body: {"q":"test"} → GET body semantics depend on the documented API; for a query-based search, use /search?q=test.


Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
常见问题

什么是“contract”?

contract 指的是定义 API 请求应该如何发出的一套规则,包括预期提供哪些信息以及信息的格式。

这个工具会真的发送 API 请求吗?

不会。它只检查请求的语法,不会把请求发送到服务器,也不会测试你的凭证。

如果请求有误,会怎样?

工具会指出错误,并给出如何修正的简单建议。

详情

作者的原始描述

Validates whether an API request is correct based on provided inputs (method, URL, headers, body, auth, query params).

repo: sickn33/agentic-awesome-skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能