Design & UI v1.0.0

http-api

Shape HTTP/JSON APIs—resources and verbs, error payloads, pagination, idempotency, and docs. Use when designing new...

codenova58 更新于 2026-03-28 1 浏览
下载 SKILL

技能说明

Shape HTTP/JSON APIs—resources and verbs, error payloads, pagination, idempotency, and docs. Use when designing new endpoints, reviewing PRs, or aligning teams on REST-ish conventions (versioning lifecycle is a separate concern).

使用场景

Design and review HTTP-facing APIs (usually JSON): predictable URLs, honest status codes, and errors clients can build on—without duplicating everything your api-compat skill covers for long-lived versioning policy.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/http-api
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 13 kB
SKILL.md text/markdown
---
name: http-api
description: "Shape HTTP/JSON APIs—resources and verbs, error payloads, pagination, idempotency, and docs. Use when designing new endpoints, reviewing PRs, or aligning teams on REST-ish conventions (versioning lifecycle is a separate concern)."
---

# HTTP API

Design and review **HTTP-facing APIs** (usually JSON): predictable URLs, honest status codes, and errors clients can build on—**without** duplicating everything your **api-compat** skill covers for long-lived versioning policy.

## Scope

- **Modeling**: nouns/resources, collections, actions when RPC-style is clearer than fake REST.
- **HTTP semantics**: which methods, **idempotency**, caching headers when relevant.
- **Errors**: stable machine-readable codes, correlation ids, avoid leaking internals.
- **DX**: examples, OpenAPI snippets, consistent pagination/filter patterns.

## Out of scope (hand off)

- **OAuth/OIDC** protocol details → identity-focused skills.
- **GraphQL-only** schema design → graphql-schema skill.
- **Multi-year deprecation policy** and client migration programs → pair with **api-compat**.

## Review order

1. **Read paths** — Can a client navigate the domain without guessing?
2. **Write safety** — Retries safe? Duplicate submits handled?
3. **Errors** — One shape everywhere; 4xx vs 5xx honest.
4. **Evolution** — Document what may change vs what is stable (compat details in api-compat).

## Smells

- Status 200 with `{error: ...}`; **every** POST returns 200; unbounded list endpoints; secrets in error bodies.

## Done when

- A new engineer can call the API from docs alone; failure cases are **testable** and **consistent**.

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。