Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计提醒

api-designAPI 设计

Agent Skill

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

总安装

2,980

周安装

128

GitHub Stars

161

下载量

1,044
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill api-design

简介

用于辅助 API 设计、接口文档和请求响应结构梳理,适合前后端联调场景。

  • 可生成 OpenAPI 草稿、检查字段命名、整理错误码,支持服务集成说明。
  • 需结合现有代码、schema 或接口样例提取事实,避免凭空补字段。
  • 涉及鉴权方式、分页和错误处理时,应确认真实业务语义和操作边界。
  • api-design 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

API Design

Comprehensive API design patterns covering REST/GraphQL framework design, versioning strategies, and RFC 9457 error handling. Each category has individual rule files in rules/ loaded on-demand.

Quick Reference

CategoryRulesImpactWhen to Use
API Framework3HIGHREST conventions, resource modeling, OpenAPI specifications
Versioning3HIGHURL path versioning, header versioning, deprecation/sunset policies
Error Handling4HIGHRFC 9457 Problem Details, agent-facing errors, validation errors, error type registries
GraphQL2HIGHStrawberry code-first, DataLoader, permissions, subscriptions
gRPC2HIGHProtobuf services, streaming, interceptors, retry
Streaming2HIGHSSE endpoints, WebSocket bidirectional, async generators

| Integrations | 2 | HIGH | Messaging platforms (WhatsApp, Telegram), Payload CMS patterns |

Total: 18 rules across 7 categories

API Framework

REST and GraphQL API design conventions for consistent, developer-friendly APIs.

RuleFileKey Pattern
REST Conventionsrules/framework-rest-conventions.mdPlural nouns, HTTP methods, status codes, pagination
Resource Modelingrules/framework-resource-modeling.mdHierarchical URLs, filtering, sorting, field selection
OpenAPIrules/framework-openapi.mdOpenAPI 3.1 specs, documentation, schema definitions

Versioning

Strategies for API evolution without breaking clients.

RuleFileKey Pattern
URL Pathrules/versioning-url-path.md/api/v1/ prefix routing, version-specific schemas
Headerrules/versioning-header.mdX-API-Version header, content negotiation
Deprecationrules/versioning-deprecation.mdSunset headers, lifecycle management, breaking change policy

Error Handling

RFC 9457 Problem Details for machine-readable, standardized error responses.

RuleFileKey Pattern
Problem Detailsrules/errors-problem-details.mdRFC 9457 schema, application/problem+json, exception classes
Agent-Facing Errorsrules/errors-agent-facing.mdAgent extensions: retryable, error_category, content negotiation, token efficiency
Validationrules/errors-validation.mdField-level errors, Pydantic integration, 422 responses
Error Catalogrules/errors-error-catalog.mdProblem type registry, error type URIs, client handling

GraphQL

Strawberry GraphQL code-first schema with type-safe resolvers and FastAPI integration.

RuleFileKey Pattern
Schema Designrules/graphql-strawberry.mdType-safe schema, DataLoader, union errors, Private fields
Patterns & Authrules/graphql-schema.mdPermission classes, FastAPI integration, subscriptions

gRPC

High-performance gRPC for internal microservice communication.

RuleFileKey Pattern
Service Definitionrules/grpc-service.mdProtobuf, async server, client timeout, code generation
Streaming & Interceptorsrules/grpc-streaming.mdServer/bidirectional streaming, auth, retry backoff

Streaming

Real-time data streaming with SSE, WebSockets, and proper cleanup.

RuleFileKey Pattern
SSErules/streaming-sse.mdSSE endpoints, LLM streaming, reconnection, keepalive
WebSocketrules/streaming-websocket.mdBidirectional, heartbeat, aclosing(), backpressure

Integrations

Messaging platform integrations and headless CMS patterns.

RuleFileKey Pattern
Messaging Platformsrules/messaging-integrations.mdWhatsApp WAHA, Telegram Bot API, webhook security
Payload CMSrules/payload-cms.mdPayload 3.0 collections, access control, CMS selection

Quick Start Example

# REST endpoint with versioning and RFC 9457 errors
from fastapi import APIRouter, Depends, Request
from fastapi.responses import JSONResponse

router = APIRouter()

@router.get("/api/v1/users/{user_id}")
async def get_user(user_id: str, service: UserService = Depends()):
    user = await service.get_user(user_id)
    if not user:
        raise NotFoundProblem(
            resource="User",
            resource_id=user_id,
        )
    return UserResponseV1(id=user.id, name=user.full_name)

Key Decisions

DecisionRecommendation
Versioning strategyURL path (/api/v1/) for public APIs
Resource namingPlural nouns, kebab-case
PaginationCursor-based for large datasets
Error formatRFC 9457 Problem Details with application/problem+json
Error type URIYour API domain + /problems/ prefix
Support windowCurrent + 1 previous version
Deprecation notice3 months minimum before sunset
Sunset period6 months after deprecation
GraphQL schemaCode-first with Strawberry types
N+1 preventionDataLoader for all nested resolvers
GraphQL authPermission classes (context-based)
gRPC protoOne service per file, shared common.proto
gRPC streamingServer stream for lists, bidirectional for real-time
SSE keepaliveEvery 30 seconds
WebSocket heartbeatping-pong every 30 seconds
Async generator cleanupaclosing() for all external resources

Common Mistakes

  1. Verbs in URLs (POST /createUser instead of POST /users)
  2. Inconsistent error formats across endpoints
  3. Breaking contracts without version bump
  4. Plain text error responses instead of Problem Details
  5. Sunsetting versions without deprecation headers
  6. Exposing internal details (stack traces, DB errors) in errors
  7. Missing Content-Type: application/problem+json on error responses
  8. Supporting too many concurrent API versions (max 2-3)
  9. Caching without considering version isolation

Evaluations

See test-cases.json for 9 test cases across all categories.

Related Skills

  • fastapi-advanced - FastAPI-specific implementation patterns
  • rate-limiting - Advanced rate limiting implementations and algorithms
  • observability-monitoring - Version usage metrics and error tracking
  • input-validation - Validation patterns beyond API error handling
  • streaming-api-patterns - SSE and WebSocket patterns for real-time APIs

Capability Details

rest-design

Keywords: rest, restful, http, endpoint, route, path, resource, CRUD Solves:

  • How do I design RESTful APIs?
  • REST endpoint patterns and conventions
  • HTTP methods and status codes

graphql-design

Keywords: graphql, schema, query, mutation, connection, relay Solves:

  • How do I design GraphQL APIs?
  • Schema design best practices
  • Connection pattern for pagination

endpoint-design

Keywords: endpoint, route, path, resource, CRUD, openapi Solves:

  • How do I structure API endpoints?
  • What's the best URL pattern for this resource?
  • RESTful endpoint naming conventions

url-versioning

Keywords: url version, path version, /v1/, /v2/ Solves:

  • How to version REST APIs?
  • URL-based API versioning

header-versioning

Keywords: header version, X-API-Version, content negotiation Solves:

  • Clean URL versioning
  • Header-based API version

deprecation

Keywords: deprecation, sunset, version lifecycle, backward compatible Solves:

  • How to deprecate API versions?
  • Version sunset policy
  • Breaking vs non-breaking changes

problem-details

Keywords: problem details, RFC 9457, RFC 7807, structured error, application/problem+json Solves:

  • How to standardize API error responses?
  • What format for API errors?

agent-facing-errors

Keywords: agent error, AI agent, retryable, retry_after, error_category, content negotiation, accept header, token efficient, machine readable Solves:

  • How to design error responses for AI agent consumers?
  • How to reduce token cost of error responses?
  • How to enable deterministic agent error handling?
  • Content negotiation for agents vs browsers vs LLMs

validation-errors

Keywords: validation, field error, 422, unprocessable, pydantic Solves:

  • How to handle validation errors in APIs?
  • Field-level error responses

error-registry

Keywords: error registry, problem types, error catalog, error codes Solves:

  • How to document all API errors?
  • Error type management

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.27%
按下载量换算368

Claude

32.04%
按下载量换算334

Cursor

18.76%
按下载量换算196

Gemini CLI

8.61%
按下载量换算90

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills