Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

api-design-frameworkAPI 设计 framework

Agent Skill

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

总安装

445

周安装

18

GitHub Stars

公开资料未说明

下载量

140
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

AgentSkills.tonpx skills
npx skills add yonatangross/skillforge-claude-plugin --skill "api-design-framework"

简介

api-design-framework 用于辅助 API 设计和接口文档整理。

  • 它适合梳理 endpoint、生成 OpenAPI 草稿或检查字段命名。
  • 通过 npx skills add yonatangross/skillforge-claude-plugin --skill "api-design-framework" 安装使用。
  • 使用时需确认真实业务语义和鉴权方式,避免凭空补字段。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

API Design Framework

This skill provides comprehensive guidance for designing robust, scalable, and developer-friendly APIs. Whether building REST, GraphQL, or gRPC services, this framework ensures consistency, usability, and maintainability.

Overview

  • Designing new API endpoints or services
  • Establishing API conventions for a team or organization
  • Reviewing API designs for consistency and best practices
  • Migrating or versioning existing APIs
  • Creating API documentation (OpenAPI, AsyncAPI)
  • Choosing between REST, GraphQL, or gRPC

API Design Principles

1. Developer Experience First

APIs should be intuitive and self-documenting:

  • Clear, consistent naming conventions
  • Predictable behavior and responses
  • Comprehensive documentation
  • Helpful error messages

2. Consistency Over Cleverness

Follow established patterns rather than inventing new ones:

  • Standard HTTP methods and status codes (REST)
  • Conventional query structures (GraphQL)
  • Idiomatic proto definitions (gRPC)

3. Evolution Without Breaking Changes

Design for change from day one:

  • API versioning strategy
  • Backward compatibility considerations
  • Deprecation policies
  • Migration paths

4. Performance by Design

Consider performance implications:

  • Pagination for large datasets
  • Filtering and partial responses
  • Caching strategies
  • Rate limiting

Bundled Resources

  • assets/openapi-template.yaml - OpenAPI 3.1 specification template
  • assets/asyncapi-template.yaml - AsyncAPI specification template
  • references/rest-api.md - REST API design patterns
  • references/graphql-api.md - GraphQL API design patterns
  • references/grpc-api.md - gRPC API design patterns
  • references/frontend-integration.md - Frontend API integration patterns

Protocol References

REST API Design

See: references/rest-api.md

Key topics covered:

  • Resource naming conventions (plural nouns, hierarchical relationships)
  • HTTP methods (GET, POST, PUT, PATCH, DELETE)
  • Status codes (2xx, 4xx, 5xx)
  • Request/response formats
  • Pagination (cursor-based vs offset-based)
  • Filtering, sorting, field selection
  • API versioning strategies
  • Rate limiting headers
  • Authentication patterns (Bearer, API Key)

GraphQL API Design

See: references/graphql-api.md

Key topics covered:

  • Schema design principles (nullable by default)
  • Connection pattern for lists (edges, nodes, pageInfo)
  • Input types for mutations
  • Query design patterns
  • Field-level error handling

gRPC API Design

See: references/grpc-api.md

Key topics covered:

  • Proto file structure
  • Service and message definitions
  • gRPC status codes mapping to HTTP equivalents

Frontend API Integration

See: references/frontend-integration.md

Key topics covered:

  • Runtime validation with Zod
  • Request interceptors with ky
  • Error enrichment pattern
  • TanStack Query integration

Quick Reference: HTTP Status Codes

CodeNameUse Case
200OKSuccessful GET, PUT, PATCH
201CreatedSuccessful POST
204No ContentSuccessful DELETE
400Bad RequestInvalid request
401UnauthorizedMissing auth
403ForbiddenNo permission
404Not FoundResource missing
409ConflictDuplicate
422UnprocessableValidation failed
429Too Many RequestsRate limited
500Internal ErrorServer error

Quick Reference: Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      { "field": "email", "message": "Email is already registered" }
    ],
    "request_id": "req_abc123"
  }
}

Common Pitfalls

PitfallBadGood
Verbs in URLsPOST /createUserPOST /users
Inconsistent naming/users, /userOrders/users, /orders
Ignoring HTTP methodsPOST /users/123/deleteDELETE /users/123
Exposing internals/users-table/users
Generic errors"Something went wrong""Email already exists"

Best Practices Summary

  1. Use plural nouns for resources: /users, /orders
  2. Use kebab-case for multi-word: /user-preferences
  3. Use hierarchical URLs: /users/123/orders
  4. Cursor pagination for large datasets
  5. URI versioning for public APIs: /api/v1/users
  6. Include rate limit headers in responses
  7. Validate with Zod on frontend boundary
  8. Include request_id in error responses

Integration with Agents

AgentUsage
backend-system-architectDesigns new APIs using this framework
frontend-ui-developerReviews contracts, integrates with APIs
code-quality-reviewerValidates API designs against standards

Related Skills

  • fastapi-advanced - FastAPI-specific implementation patterns for the API designs in this skill
  • error-handling-rfc9457 - RFC 9457 Problem Details standard for structured error responses
  • api-versioning - Detailed versioning strategies beyond the basics covered here
  • rate-limiting - Advanced rate limiting implementations and algorithms

Key Decisions

DecisionChoiceRationale
Pagination defaultCursor-basedMore efficient for large datasets, stable under inserts/deletes
Error formatStructured JSON with request_idEnables debugging, correlation, and consistent client handling
Versioning strategyURI path (/api/v1/)Most explicit, works with all clients, easy to document
Resource namingPlural nouns, kebab-caseIndustry standard, consistent, avoids verb confusion

Skill Version: 1.2.0 Last Updated: 2026-01-14

Changelog

v1.2.0 (2026-01-14)

  • Split into reference files for progressive loading
  • Added references/rest-api.md
  • Added references/graphql-api.md
  • Added references/grpc-api.md
  • Added references/frontend-integration.md
  • Fixed malformed YAML frontmatter

v1.1.0 (2025-12-29)

  • Added Frontend API Integration section
  • Added Zod runtime validation patterns
  • Added request interceptors with ky
  • Added TanStack Query integration examples

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
  • API versioning and pagination

graphql-design

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

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

grpc-design

Keywords: grpc, protobuf, proto, rpc, streaming Solves:

  • How do I design gRPC services?
  • Proto file structure
  • gRPC status codes

endpoint-design

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

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

pagination

Keywords: pagination, paginate, paging, offset, cursor, limit Solves:

  • How do I add pagination to an endpoint?
  • Cursor vs offset pagination
  • Pagination best practices

versioning

Keywords: version, v1, v2, api version, breaking change Solves:

  • How do I version my API?
  • When to create a new API version
  • URL vs header versioning

error-handling

Keywords: error, exception, status code, error response, validation error Solves:

  • How do I structure error responses?
  • Which HTTP status codes to use
  • Error message best practices

rate-limiting

Keywords: rate limit, throttle, quota, requests per second, 429 Solves:

  • How do I implement rate limiting?
  • Rate limit headers and responses
  • Tiered rate limiting strategies

authentication

Keywords: auth, authentication, bearer, jwt, oauth, api key Solves:

  • How do I secure API endpoints?
  • JWT vs API key authentication
  • OAuth2 flow for APIs

frontend-integration

Keywords: zod, validation, fetch, ky, tanstack, react-query Solves:

  • How do I consume APIs with type safety?
  • Runtime validation of API responses
  • Request interceptors and error handling

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

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

平台分布

Claude Code

30.33%
按下载量换算42

OpenCode

22.47%
按下载量换算31

Antigravity

21.18%
按下载量换算30

Gemini CLI

12.43%
按下载量换算17

windsurf

7.89%
按下载量换算11

trae

3.32%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills