Token导航 LogoToken导航

Agent Skill · 研究检索

designing-apis(设计 API)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

designing-apis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 51,787。

总安装 574周安装 23GitHub Stars 350下载 186核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill designing-apis

这个 Skill 是做什么的

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

设计 REST、GraphQL 或事件驱动 API,关注资源结构与安全规范。涵盖版本控制、错误处理、分页与 OAuth2 流程设计。适用于团队 API 标准制定与多模型部署策略。安装来自 GitHub,需结合具体技术栈实现细节。designing-apis 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/designing-apis

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

designing-apis 怎么安装?

在终端执行 npx skills add https://github.com/ancoleman/ai-design-components --skill designing-apis。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

designing-apis 支持哪些 AI 工具?

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

designing-apis 需要什么权限?

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

designing-apis 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

designing-apis 用的人多吗?

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

designing-apis 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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调用外部服务未明确有提醒
designing-apis

设计 API · 本页

574350接触敏感数据MIT通过

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

SKILL.md 原文

Designing APIs

Design well-structured, scalable APIs using REST, GraphQL, or event-driven patterns. Focus on resource design, versioning, error handling, pagination, rate limiting, and security.

When to Use This Skill

Use when:

  • Designing a new REST, GraphQL, or event-driven API
  • Establishing API design standards for a team or organization
  • Choosing between REST, GraphQL, WebSockets, or message queues
  • Planning API versioning and breaking change management
  • Defining error response formats and HTTP status code usage
  • Implementing pagination, filtering, and rate limiting patterns
  • Designing OAuth2 flows or API key authentication
  • Creating OpenAPI or AsyncAPI specifications

Do NOT use for:

  • Implementation code (use api-patterns skill for Express, FastAPI code)
  • Authentication implementation (use auth-security skill for JWT, sessions)
  • API testing strategies (use testing-strategies skill)
  • API deployment and infrastructure (use deploying-applications skill)

Core Design Principles

Resource-Oriented Design (REST)

Use nouns for resources, not verbs in URLs:

✓ GET    /users              List users
✓ GET    /users/123          Get user 123
✓ POST   /users              Create user
✓ PATCH  /users/123          Update user 123
✓ DELETE /users/123          Delete user 123

✗ GET    /getUsers
✗ POST   /createUser

Nest resources for relationships (limit depth to 2-3 levels):

✓ GET /users/123/posts
✓ GET /users/123/posts/456/comments
✗ GET /users/123/posts/456/comments/789/replies  (too deep)

For complete REST patterns, see references/rest-design.md

HTTP Method Semantics

MethodIdempotentSafeUse ForSuccess Status
GETYesYesRead resource200 OK
POSTNoNoCreate resource201 Created
PUTYesNoReplace entire resource200 OK, 204 No Content
PATCHNoNoUpdate specific fields200 OK, 204 No Content
DELETEYesNoRemove resource204 No Content, 200 OK

Idempotent means multiple identical requests have the same effect as one request.

HTTP Status Codes

Success (2xx):

  • 200 OK, 201 Created, 204 No Content

Client Errors (4xx):

  • 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
  • 409 Conflict, 422 Unprocessable Entity, 429 Too Many Requests

Server Errors (5xx):

  • 500 Internal Server Error, 503 Service Unavailable

For complete status code guide, see references/rest-design.md

API Style Selection

Decision Matrix

FactorRESTGraphQLWebSocketMessage Queue
Public API⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Complex Data⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Caching⭐⭐⭐⭐⭐⭐⭐⭐⭐
Real-time⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Simplicity⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

Quick Selection

  • Public API, CRUD operations → REST
  • Complex data, flexible queries → GraphQL
  • Real-time, bidirectional → WebSockets
  • Event-driven, microservices → Message Queue

For detailed protocol selection, see references/protocol-selection.md

API Versioning

URL Path Versioning (Recommended)

https://api.example.com/v1/users
https://api.example.com/v2/users

Pros: Explicit, easy to implement and test Cons: Maintenance overhead

Alternative Strategies

  • Header-Based: Accept-Version: v1
  • Media Type: Accept: application/vnd.example.v1+json
  • Query Parameter: ?version=1 (not recommended)

Breaking Change Management

Timeline:

  1. Month 0: Announce deprecation
  2. Months 1-3: Migration period
  3. Months 4-6: Deprecation warnings
  4. Month 6: Sunset (return 410 Gone)

Include deprecation headers:

Deprecation: true
Sunset: Sat, 31 Dec 2025 23:59:59 GMT
Link: </api/v2/users>; rel="successor-version"

For complete versioning guide, see references/versioning-strategies.md

Error Response Standards

RFC 7807 Problem Details (Recommended)

{
  "type": "https://api.example.com/errors/validation",
  "title": "Validation Error",
  "status": 400,
  "detail": "One or more fields failed validation",
  "errors": [
    {
      "field": "email",
      "message": "Must be a valid email address",
      "code": "INVALID_EMAIL"
    }
  ]
}

Content-Type: application/problem+json

For complete error patterns, see references/error-handling.md

Pagination Patterns

Strategy Selection

ScenarioStrategyWhy
Small datasets (<1000)Offset-basedSimple, page numbers
Large datasets (>10K)Cursor-basedEfficient, handles writes
Sorted dataKeysetConsistent results
Real-time feedsCursor-basedHandles new items

Offset-Based (Simple)

GET /users?limit=20&offset=40

Response includes: limit, offset, total, currentPage

Cursor-Based (Scalable)

GET /users?limit=20&cursor=eyJpZCI6MTIzfQ==

Cursor is base64-encoded JSON with position information. Response includes: nextCursor, hasNext

For implementation details, see references/pagination-patterns.md

Rate Limiting

Token Bucket Algorithm

  • Each user has bucket with tokens
  • Each request consumes 1 token
  • Tokens refill at constant rate
  • Empty bucket rejects request

Rate Limit Headers

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 73
X-RateLimit-Reset: 1672531200

When exceeded (429):

Retry-After: 3600

Strategies

  • Per User: 100 requests/hour
  • Per API Key: 1000 requests/hour
  • Per IP: 50 requests/hour (unauthenticated)
  • Tiered: Free (100/hr), Pro (1000/hr), Enterprise (10000/hr)

For implementation patterns, see references/rate-limiting.md

API Security Design

OAuth 2.0 Flows

Authorization Code Flow (Web Apps):

  1. Redirect user to authorization server
  2. User grants permission
  3. Exchange code for access token
  4. Use token for API requests

Client Credentials Flow (Service-to-Service):

  1. Authenticate with client ID and secret
  2. Receive access token
  3. Use token for API requests

Scope-Based Authorization

Define granular permissions:

read:users    - Read user data
write:users   - Create/update users
delete:users  - Delete users
admin:*       - Full admin access

API Key Management

Use header-based keys:

X-API-Key: sk_live_abc123xyz456

Best practices:

  • Prefix with environment: sk_live_*, sk_test_*
  • Store hashed keys only
  • Support key rotation
  • Track last-used timestamp

For complete security patterns, see references/authentication.md

OpenAPI Specification

Basic Structure

openapi: 3.1.0
info:
  title: User Management API
  version: 2.0.0

paths:
  /users:
    get:
      summary: List users
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'

OpenAPI enables:

  • Code generation (server stubs, client SDKs)
  • Validation (request/response checking)
  • Mock servers (testing against spec)
  • Documentation (interactive docs)

For complete OpenAPI examples, see examples/openapi/

AsyncAPI Specification

Event-Driven APIs

AsyncAPI defines message-based APIs (WebSockets, Kafka, MQTT):

asyncapi: 3.0.0
info:
  title: Order Events API

channels:
  orders/created:
    address: orders.created
    messages:
      orderCreated:
        payload:
          type: object
          properties:
            orderId:
              type: string

For AsyncAPI examples, see examples/asyncapi/

GraphQL Design

Schema Structure

type User {
  id: ID!
  username: String!
  posts(limit: Int): [Post!]!
}

type Query {
  user(id: ID!): User
  users(limit: Int): [User!]!
}

type Mutation {
  createUser(input: CreateUserInput!): User!
}

N+1 Problem Solution

Use DataLoader to batch requests:

const userLoader = new DataLoader(async (userIds) => {
  // Single query for all users
  const users = await db.users.findByIds(userIds);
  return userIds.map(id => users.find(u => u.id === id));
});

For GraphQL patterns, see references/graphql-design.md

Quick Reference Tables

Pagination Strategy Selection

ScenarioStrategy
Small datasetsOffset-based
Large datasetsCursor-based
Sorted dataKeyset
Real-time feedsCursor-based

Versioning Strategy Selection

FactorURL PathHeaderMedia Type
Visibility⭐⭐⭐⭐⭐⭐⭐⭐⭐
Simplicity⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Best ForMost APIsInternal APIsContent negotiation

Integration with Other Skills

  • api-patterns: Implement API designs in Express, FastAPI, Go
  • auth-security: Implement OAuth2, JWT, session management
  • database-design: Design database schemas for API resources
  • testing-strategies: API testing (integration, contract, load)
  • deploying-applications: Deploy and scale APIs
  • observability: Monitor API performance and errors

Additional Resources

Detailed guidance:

  • references/rest-design.md - RESTful patterns and best practices
  • references/graphql-design.md - GraphQL schema and resolver patterns
  • references/versioning-strategies.md - Comprehensive versioning guide
  • references/error-handling.md - RFC 7807 implementation details
  • references/pagination-patterns.md - Pagination implementation patterns
  • references/rate-limiting.md - Rate limiting algorithms and strategies
  • references/authentication.md - OAuth2, API keys, scopes
  • references/protocol-selection.md - Choosing the right API style

Working examples:

  • examples/openapi/ - Complete OpenAPI 3.1 specifications
  • examples/asyncapi/ - Event-driven API specifications
  • examples/graphql/ - GraphQL schemas and patterns

Validation and tooling:

  • scripts/validate-openapi.sh - Validate OpenAPI specifications

平台分布

Claude Code

26.4%
按下载量换算49

OpenCode

21.62%
按下载量换算40

Gemini CLI

17.51%
按下载量换算33

Antigravity

12.05%
按下载量换算22

Cursor

7.94%
按下载量换算15

mux

3.28%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills