Token导航 LogoToken导航

Agent Skill · 研究检索

api-design-ops(API 设计 OPS)

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

api-design-ops 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 65,745。

总安装 275周安装 11GitHub Stars 17下载 89核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/0xdarkmatter/claude-mods --skill api-design-ops

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

整合 REST、gRPC 和 GraphQL 的高级设计模式与生产级实践。包含版本控制、认证授权、限流熔断等企业级功能设计。通过决策树帮助用户根据业务需求选择合适的 API 风格。适用于中大型系统微服务化过程中的 API 治理与标准化。

api-design-ops 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

api-design-ops 怎么安装?

在终端执行 npx skills add https://github.com/0xdarkmatter/claude-mods --skill api-design-ops。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

api-design-ops 支持哪些 AI 工具?

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

api-design-ops 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

api-design-ops 是免费的吗?

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

api-design-ops 用的人多吗?

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

api-design-ops 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
api-design-ops

API 设计 OPS · 本页

27517接触敏感数据未明确通过

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

SKILL.md 原文

API Design Ops

Comprehensive API design patterns covering REST (advanced), gRPC, and GraphQL. This skill provides decision frameworks, design patterns, and implementation guidance for building production APIs.

API Style Decision Tree

What kind of API do you need?
|
+-- Internal microservice-to-microservice?
|   +-- High throughput, low latency needed? --> gRPC
|   +-- Streaming (real-time data, logs)? --> gRPC (bidirectional streaming)
|   +-- Simple request/response, team comfort? --> REST
|
+-- Public-facing API?
|   +-- Third-party developers consuming it? --> REST (widest compatibility)
|   +-- Mobile app with varied data needs? --> GraphQL
|   +-- Browser-only, simple CRUD? --> REST
|
+-- Frontend for your own app?
|   +-- Multiple clients with different data shapes? --> GraphQL
|   +-- Single client, straightforward data? --> REST
|   +-- Real-time updates needed? --> GraphQL subscriptions or SSE
|
+-- IoT / embedded / constrained devices?
|   +-- Binary efficiency matters? --> gRPC
|   +-- HTTP-only environments? --> REST

Quick Comparison

ConcernRESTgRPCGraphQL
TransportHTTP/1.1+HTTP/2HTTP (any)
SerializationJSON (text)Protobuf (binary)JSON (text)
SchemaOpenAPI (optional).proto (required)SDL (required)
Browser supportNativeVia gRPC-Web/ConnectNative
CachingHTTP caching built-inCustomCustom (normalized)
Learning curveLowMediumMedium-High
Code generationOptionalRequiredOptional but recommended
StreamingSSE, WebSocketNative (4 patterns)Subscriptions
Over-fetchingCommon problemNo (typed)Solved by design
File uploadsMultipart nativeChunked streamingMultipart spec (awkward)

REST Resource Design Quick Reference

Resource Naming

GET    /users                  # Collection
GET    /users/{id}             # Singleton
GET    /users/{id}/orders      # Sub-collection
POST   /users                  # Create
PUT    /users/{id}             # Full replace
PATCH  /users/{id}             # Partial update
DELETE /users/{id}             # Remove

# Naming rules:
# - Plural nouns for collections: /users NOT /user
# - Kebab-case for multi-word: /line-items NOT /lineItems
# - No verbs in URLs: POST /orders NOT POST /create-order
# - Max 3 levels deep: /users/{id}/orders (not /users/{id}/orders/{oid}/items/{iid}/details)

HTTP Methods and Status Codes

MethodSuccessEmptyInvalidNot FoundConflict
GET200200 (empty array)400404-
POST201 + Location-400/422-409
PUT200-400/422404409
PATCH200-400/422404409
DELETE204204 (already gone)400404409

HATEOAS (When Worth It)

Use when: public APIs where discoverability matters, long-lived APIs, APIs that evolve frequently. Skip when: internal microservices, mobile backends, tight coupling is acceptable.

{
  "id": "order-123",
  "status": "shipped",
  "_links": {
    "self": { "href": "/orders/order-123" },
    "track": { "href": "/orders/order-123/tracking" },
    "cancel": { "href": "/orders/order-123", "method": "DELETE" }
  }
}

Pagination Decision Tree

What's your data like?
|
+-- Stable data, UI needs "jump to page 5"?
|   --> Offset pagination: ?page=5&per_page=20
|   Tradeoff: Slow on large offsets (OFFSET 10000), inconsistent with inserts
|
+-- Large dataset, forward-only traversal?
|   --> Cursor pagination: ?after=eyJpZCI6MTIzfQ&limit=20
|   Tradeoff: No random page access, but consistent and fast
|
+-- Real-time feed, ordered by timestamp or ID?
|   --> Keyset pagination: ?created_after=2024-01-01T00:00:00Z&limit=20
|   Tradeoff: Requires a unique, sequential column; no page jumping

Response Envelope

{
  "data": [...],
  "pagination": {
    "total": 1432,
    "limit": 20,
    "has_more": true,
    "next_cursor": "eyJpZCI6MTQzMn0="
  }
}

Error Response Format (RFC 7807)

All APIs should use Problem Details (RFC 7807 / RFC 9457):

{
  "type": "https://api.example.com/errors/insufficient-funds",
  "title": "Insufficient Funds",
  "status": 422,
  "detail": "Account xxxx-1234 has a balance of $10.00, but the transfer requires $25.00.",
  "instance": "/transfers/txn-abc-123",
  "balance": 1000,
  "required": 2500
}

Field Reference

FieldRequiredDescription
typeYesURI identifying the error type (stable, documentable)
titleYesHuman-readable summary (same for all instances of this type)
statusYesHTTP status code
detailYesHuman-readable explanation specific to this occurrence
instanceNoURI identifying the specific occurrence
(extensions)NoAdditional machine-readable fields

Validation Errors

{
  "type": "https://api.example.com/errors/validation",
  "title": "Validation Failed",
  "status": 422,
  "detail": "The request body contains 2 validation errors.",
  "errors": [
    { "field": "email", "message": "Must be a valid email address", "code": "invalid_format" },
    { "field": "age", "message": "Must be at least 18", "code": "out_of_range", "min": 18 }
  ]
}

Versioning Strategies

StrategyExampleProsCons
URL path/v2/usersObvious, cacheable, easy routingURL pollution, hard to sunset
Accept headerAccept: application/vnd.api.v2+jsonClean URLs, content negotiationHidden, harder to test
Query param/users?version=2Easy to addPollutes query string, caching issues
Date-basedAPI-Version: 2024-01-15Granular evolution (Stripe style)Complex implementation

Recommendation

  • Public APIs: URL path versioning (/v1/) - simplicity wins
  • Internal APIs: Header or no versioning (deploy in lockstep)
  • Evolving APIs: Date-based (Stripe model) if you have the engineering investment

Breaking Change Rules

A breaking change is anything that can cause existing clients to fail:

  • Removing a field from a response
  • Renaming a field
  • Changing a field's type
  • Adding a required field to a request
  • Changing URL structure
  • Changing error formats
  • Removing an endpoint

Non-breaking (safe):

  • Adding optional fields to requests
  • Adding fields to responses
  • Adding new endpoints
  • Adding new enum values (if client handles unknown values)

Rate Limiting Design

Algorithms

AlgorithmBehaviorUse When
Token bucketAllows bursts, refills at steady rateGeneral API rate limiting
Sliding windowSmooth distribution, no burstStrict fairness needed
Fixed windowSimple, potential burst at boundaryLow-stakes limiting
Leaky bucketConstant output rateQueue processing

Response Headers

X-RateLimit-Limit: 1000          # Max requests per window
X-RateLimit-Remaining: 743       # Requests left in current window
X-RateLimit-Reset: 1672531200    # Unix timestamp when window resets
Retry-After: 30                  # Seconds to wait (on 429)

429 Response Body

{
  "type": "https://api.example.com/errors/rate-limit-exceeded",
  "title": "Rate Limit Exceeded",
  "status": 429,
  "detail": "You have exceeded 1000 requests per hour. Try again in 30 seconds.",
  "retry_after": 30
}

Idempotency

Which Methods Need Idempotency Keys?

MethodIdempotent by spec?Needs key?
GETYesNo
PUTYesNo (full replacement is naturally idempotent)
DELETEYesNo
PATCHNoRecommended for critical operations
POSTNoYes (always for payments, orders, transfers)

Implementation

POST /payments
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

{ "amount": 2500, "currency": "usd", "customer": "cust_123" }

Server-side:

  1. Receive request with Idempotency-Key header
  2. Check if key exists in store (Redis, DB)
  3. If exists: return stored response (same status code + body)
  4. If not: process request, store response keyed by idempotency key
  5. Keys expire after 24-48 hours

Authentication Overview

MethodUse WhenSecurity Level
API KeyServer-to-server, internal, simpleLow-Medium
JWT (Bearer)Stateless auth, microservicesMedium-High
OAuth2 + PKCEThird-party access, user delegationHigh
mTLSService mesh, zero-trust infraVery High

Decision Guide

Who is authenticating?
|
+-- Your own frontend? --> JWT (short-lived access + refresh token)
+-- Third-party developer? --> OAuth2 (client credentials for server, PKCE for SPA)
+-- Another internal service? --> mTLS or JWT with service accounts
+-- Quick prototype? --> API key (but plan migration)

Gotchas Table

GotchaProblemPrevention
Breaking changes in "non-breaking" releaseClient crashesAdditive-only policy, contract tests
N+1 in REST APIs100 users = 101 queriesCompound documents, ?include=, or GraphQL
Over-fetchingMobile gets 50 fields, needs 3Sparse fieldsets ?fields=id,name or GraphQL
Under-fetching3 requests to build one viewComposite endpoints or BFF pattern
CORS misconfigurationFrontend can't reach APIExplicit allowed origins, never * with credentials
Missing Content-Type415 or silent parsing failureValidate Content-Type on every mutation endpoint
Large payloads without paginationOOM, timeoutsAlways paginate collections, set max page size
Inconsistent date formatsParsing hellISO 8601 everywhere: 2024-01-15T10:30:00Z
No request IDsImpossible to debugGenerate X-Request-ID, propagate through services
Enum evolutionNew value breaks old clientDocument that enums may grow, clients must handle unknown
Missing idempotencyDuplicate charges, ordersIdempotency keys on all POST endpoints with side effects
Unbounded query complexityGraphQL DoSDepth limiting, cost analysis, persisted queries

Reference Files

FileContents
references/rest-advanced.mdResource modeling, PATCH strategies, caching, webhooks, bulk ops
references/grpc.mdProtobuf, service definitions, Go/Rust, streaming, error handling
references/graphql.mdSchema design, resolvers, DataLoader, federation, performance
references/api-security.mdJWT, OAuth2, CORS, rate limiting, OWASP API Top 10

平台分布

Codex

37.78%
按下载量换算34

Claude

31.05%
按下载量换算28

Cursor

18.21%
按下载量换算16

Gemini CLI

9.4%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills