Token导航 LogoToken导航

Agent Skill · 开发

engineering-rest-api-design(engineering rest API 设计)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

engineering-rest-api-design 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 20,588。

总安装 218周安装 9GitHub Stars 4下载 71核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:engineering-rest-api-design(engineering rest API 设计)
来源仓库:https://github.com/jimnguyendev/jimmy-skills
仓库路径:skills/engineering-rest-api-design
安装命令:
npx skills add https://github.com/jimnguyendev/jimmy-skills --skill engineering-rest-api-design
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jimnguyendev/jimmy-skills --skill engineering-rest-api-design

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于 RESTful API 设计与文档编写,遵循消费者优先的设计原则。提供命名规范、错误封装、分页机制与异步模式等最佳实践指引。可辅助生成 OpenAPI 草稿并审计现有接口合规性。生成文档时应基于已有 schema 或接口样例,避免虚构字段定义。

engineering-rest-api-design 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/engineering-rest-api-design

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jimnguyendev/jimmy-skills --skill engineering-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

engineering-rest-api-design 怎么安装?

在终端执行 npx skills add https://github.com/jimnguyendev/jimmy-skills --skill engineering-rest-api-d…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

engineering-rest-api-design 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

engineering-rest-api-design 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

engineering-rest-api-design 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

engineering-rest-api-design 用的人多吗?

公开数据是累计安装 218 次,近一周安装 9 次,下载 71 次,GitHub 4 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

engineering-rest-api-design 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
engineering-rest-api-design

engineering rest API 设计 · 本页

2184需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Persona: You are a senior API architect. Every endpoint you design is a contract — once published, it becomes someone else's dependency. Design for the consumer first, optimize for the maintainer second.

Modes:

  • Design mode — designing new endpoints: apply conventions top-down, validate against checklist in references/checklist.md.
  • Review mode — reviewing existing API contracts: audit naming, pagination, error envelope, idempotency, and async patterns against this skill's rules. Flag violations with severity (breaking / inconsistent / style).
  • Document mode — writing API documentation: follow the spec template in references/api-document-template.md.

REST API Design

Mindset

  1. Design first — think at the high level, cover edge cases on paper, reduce implementation cost.
  2. Scalable — endpoints should handle growth in consumers, data volume, and team size.
  3. Consistent — one convention across all services; deviation requires justification.
  4. Inspect every aspect — URL, method, headers, body, pagination, errors, async behavior.
  5. No one-size-fits-all — document trade-offs explicitly when deviating from conventions.

HTTP Methods

MethodOperationSafeIdempotent
GETReadYesYes
POSTCreate / Batch readNoNo
PUTUpdate (full or partial)NoYes
DELETERemove / disableNoYes

Safety means the method does not alter server state. Idempotency means sending the same request multiple times produces the same result.

PUT over PATCH — use PUT for all updates. Clients always send the full set of mutable fields. This eliminates ambiguity about which fields are being changed vs intentionally omitted, and keeps the operation unconditionally idempotent. Do not use PATCH.

POST for batch reads — when fetching multiple resources by a list of IDs, use POST with a JSON body instead of GET with query parameters. GET query strings have length limits and become unwieldy with many IDs. Pattern: POST /resources/batch with body {"ids": ["id1", "id2"]}.

Create returns 200 — POST create endpoints return 200 with the created resource in the response body. Do not use 201 Created. This simplifies client handling — consumers check the same status code for all successful operations.

For non-idempotent POST requests, use a unique request ID or Idempotency-Key header so the server can detect and deduplicate retries.

URL Conventions

Rules

  1. Nouns, not verbs — the resource is the noun, the method is the verb.
  2. Plural nouns — /users, not /user.
  3. Nesting for relationships — /articles/{article_id}/comments.
  4. Versioning in path — /api/v1/....
  5. Slug-case for URLs — /order-service/v1/orders.
  6. snake_case for request and response body — {"debit_account": "acc01"}.

Singular vs Plural

Use plural by default. Use singular only when the resource is inherently unique within its parent:

GET /api/users/{id}/profile          # one profile per user → singular
GET /api/users/{id}/profile/addresses/{address_id}  # multiple addresses → plural
GET /api/forms/login                 # one login form among many forms → singular

Custom Actions

When CRUD methods are insufficient (restore, publish, archive), use one of:

Colon method (Google API convention) — clearly separates action from sub-resource:

POST /files/{id}:restore
POST /v1/{resource}:setIamPolicy

Slash method — simpler but risks confusion with sub-resources:

POST /files/{id}/restore

Prefer the colon method when clarity matters. The slash method is acceptable if the team prefers familiar URL conventions and there is no ambiguity with actual sub-resources.

Examples

POST   /order-service/v1/orders              # create
GET    /order-service/v1/orders/145           # get by ID
POST   /order-service/v1/orders/batch         # batch get by IDs
PUT    /order-service/v1/orders/145           # update
DELETE /order-service/v1/orders/145           # delete

Pagination

Two common approaches — choose based on use case, stay consistent within a service.

Page + Size

GET /users?page=0&size=10
  • Best for: management portals, admin dashboards.
  • Must document: whether page starts at 0 or 1.

Offset + Limit

GET /users?offset=0&limit=10
  • Best for: infinite scroll, newsfeeds, log streams.

Known Problems

  1. Performance on large datasets — OFFSET N scans and discards N rows.
  2. Resource skipping — deleting records between paginated requests shifts items across page boundaries.

Solutions

Cursor-based pagination — use the last seen ID as a cursor:

SELECT * FROM users WHERE id > :last_id ORDER BY id LIMIT 10;

Deferred join — fetch IDs first, then join:

SELECT * FROM (
  SELECT id FROM users ORDER BY id LIMIT 100, 10
) a JOIN users b ON a.id = b.id;

See references/pagination-patterns.md for full comparison of all pagination strategies with decision guide.

Filtering

Use query parameters to narrow results. Multiple filters combine with AND logic:

GET /products?price=20&brand=Nike
GET /orders?status=pending&created_after=2024-01-01

For complex filtering (range, OR, nested), document the query language explicitly. Never pass filter values directly into SQL — always parameterize.

Sorting

Three common conventions — pick one per API, stay consistent:

# Format A: colon separates field:direction, comma separates fields
GET /products?sort=price:asc,name:desc

# Format B: prefix +/- for direction
GET /products?sort=+price,-name

# Format C: comma separates field,direction pairs, semicolon separates fields
GET /articles?sort=publish_date,asc;title,desc

Default sort direction should be documented (typically descending for dates, ascending for names). Always whitelist sortable fields — never pass user input directly to ORDER BY.

Relationship Endpoints

One-to-Many

GET /articles/{article_id}/comments

Many-to-Many

GET  /classes/{class_id}/students
POST /classes/{class_id}/students/{student_id}
POST /classes/{class_id}/students          # bulk add via body

Note: PUT /classes/{class_id}/students/{student_id} is acceptable because the operation is idempotent (adding an already-added student has no additional effect).

Async API Pattern

For long-running operations (file export, report generation, bulk processing) where synchronous response risks timeout, memory exhaustion, or client blocking.

Job-based Flow

# 1. Initiate the job
POST /products/jobs/export?name=pen
→ 202 Accepted
{
  "meta": { "code": "202000", "type": "ACCEPTED", "message": "Job created", "service_id": "product-service" },
  "data": { "job_id": "001", "status": "PROCESSING" }
}

# 2. Poll job status
GET /jobs/001
→ 200
{
  "meta": { "code": "200000", "type": "SUCCESS", "message": "Success", "service_id": "product-service" },
  "data": { "job_id": "001", "status": "COMPLETED" }
}

# 3. Retrieve result
GET /jobs/001/result
→ 200 (file download or data in standard envelope)

Polling vs Webhook

ApproachProsConsUse case
PollingSimple to implementWastes resourcesSmall load, import/export
Webhook / CallbackResource-efficientComplex on both sidesLarge load, payment

Versioning

See references/versioning.md for full comparison. Summary:

StrategyExampleProsCons
URL path/v1/ordersVisible, simpleNew URL per version
Channel/v1/beta/ordersStaged rolloutMore paths to manage
HeaderApi-Version: 2URL stays cleanHidden, easy to miss
Query param/orders?version=2FlexibleEasy to forget

Default recommendation: URL path versioning (/v1/). Consider channels (v1alpha, v1beta, v1) for APIs with staged release processes.

If the API is internal and all clients can be updated together, versioning may be unnecessary.

Rate Limiting

Control request volume to protect backend resources and ensure fair usage.

Response for exceeded limits: return 429 Too Many Requests.

Inform clients via headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 500
X-RateLimit-Reset: 1588377600
Retry-After: 120

Idempotency

Problem: A request may be sent twice due to network issues or replay attacks. Critical for payment, order, and financial operations.

Solution: Client generates an Idempotency-Key header (or a unique request/transaction ID). Server enforces uniqueness via a unique constraint in the database. On duplicate, server returns the original response — not an error.

POST /payment-service/v1/payments
Headers:
  Content-Type: application/json
  Idempotency-Key: oc8tKg1P2FV44hpj

Response Envelope

Standard envelope structure for all API responses:

{
  "meta": {
    "code": "200000",
    "type": "SUCCESS",
    "message": "Success",
    "service_id": "payment-service",
    "extra_meta": {}
  },
  "data": { ... }
}

Error responses use the same envelope with "data": null:

{
  "meta": {
    "code": "400001",
    "type": "INSUFFICIENT_DEBIT_AMOUNT",
    "message": "Debit account has an insufficient amount of balance",
    "service_id": "payment-service",
    "extra_meta": {}
  },
  "data": null
}

API Documentation

Every endpoint must be documented with: spec (method, URL, headers, body), request body field table, response body field table, error table, and cURL sample. See references/api-document-template.md for the full template.

Cross-References

  • For backend implementation of these patterns, start with jimmy-skills@backend-core.
  • For Go-specific HTTP handler details, use jimmy-skills@backend-go-code-style.
  • For MyVocab project-specific response envelope and handler patterns, use jimmy-skills@myvocap-backend.
  • For error handling conventions in Go, use jimmy-skills@backend-go-error-handling.
  • For database query patterns (pagination SQL), use jimmy-skills@backend-go-database.

External Sources

This skill synthesizes conventions from established API design references. Official documentation remains authoritative:

平台分布

Codex

36.39%
按下载量换算26

Claude

27.14%
按下载量换算19

Cursor

17.75%
按下载量换算13

Gemini CLI

8.96%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills