Token导航 LogoToken导航

Agent Skill · 研究检索

api-design(API 设计)

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

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

总安装 494周安装 21GitHub Stars 23下载 173核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akaszubski/autonomous-dev --skill api-design

这个 Skill 是做什么的

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

用于辅助 API 设计、接口文档和请求响应结构梳理,适合生成 OpenAPI 草稿或检查字段命名。适用于梳理 endpoint、整理错误码、辅助前后端联调等场景。使用时需确认业务语义、鉴权方式、分页规则;生成文档时应从现有代码或样例中提取事实。

安装命令:npx skills add https://github.com/akaszubski/autonomous-dev --skill api-design 建议核对权限范围和维护状态,避免凭空补字段或误改生产数据。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

api-design 怎么安装?

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

api-design 支持哪些 AI 工具?

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

api-design 需要什么权限?

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

api-design 是免费的吗?

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

api-design 用的人多吗?

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

api-design 安全吗?

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

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

值得选的地方

  • 同时适配 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

API 设计 · 本页

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

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

SKILL.md 原文

API Design Skill

REST API design best practices, HTTP conventions, versioning, error handling, and documentation standards.

When This Skill Activates

  • Designing REST APIs
  • Creating HTTP endpoints
  • Writing API documentation
  • Handling API errors
  • Implementing pagination
  • API versioning strategies
  • Keywords: "api", "rest", "endpoint", "http", "json", "openapi"

Core Concepts

1. REST Principles

RESTful resource design using nouns (not verbs), proper HTTP methods, and hierarchical URL structure.

Key Principles:

  • Resources are nouns: /users, /posts (not /getUsers, /createPost)
  • Use HTTP methods correctly: GET (read), POST (create), PUT (replace), PATCH (update), DELETE (remove)
  • Hierarchical relationships: /users/123/posts for related resources
  • Keep URLs shallow (max 3 levels)

See: docs/rest-principles.md for detailed examples and patterns


2. HTTP Status Codes

Proper status code usage for success (2xx), client errors (4xx), and server errors (5xx).

Common Codes:

  • 200 OK: Successful GET/PUT/PATCH
  • 201 Created: Successful POST (includes Location header)
  • 204 No Content: Successful DELETE
  • 400 Bad Request: Invalid input
  • 401 Unauthorized: Authentication required
  • 403 Forbidden: Authenticated but not allowed
  • 404 Not Found: Resource doesn't exist
  • 422 Unprocessable: Validation error
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server failure

See: docs/http-status-codes.md for complete reference and examples


3. Error Handling

RFC 7807 Problem Details format for consistent, structured error responses.

Standard Format:

{
  "type": "https://example.com/errors/validation-error",
  "title": "Validation Error",
  "status": 422,
  "detail": "Email address is invalid",
  "instance": "/users",
  "errors": {
    "email": ["Must be a valid email address"]
  }
}

See: docs/error-handling.md for implementation patterns and best practices


4. Request/Response Format

JSON structure conventions for request bodies and response payloads.

Best Practices:

  • Use snake_case for JSON keys
  • Include metadata in responses (timestamps, IDs)
  • Consistent field naming across endpoints
  • Clear data types and structures

See: docs/request-response-format.md for detailed examples


5. Pagination

Offset-based and cursor-based pagination strategies for large datasets.

Offset-Based (simple, good for small datasets):

GET /users?page=2&limit=20

Cursor-Based (scalable, handles real-time updates):

GET /users?cursor=abc123&limit=20

See: docs/pagination.md for implementation details and trade-offs


6. API Versioning

URL path versioning (recommended) and header-based versioning strategies.

URL Path Versioning:

/v1/users
/v2/users

When to Version:

  • Breaking changes (removing fields, changing behavior)
  • New required fields
  • Changed data types

See: docs/versioning.md for migration strategies and deprecation policies


7. Authentication & Authorization

API key and JWT authentication patterns for securing endpoints.

API Key (simple, good for service-to-service):

Authorization: Bearer sk_live_abc123...

JWT (stateless, good for user authentication):

Authorization: Bearer eyJhbGc...

See: docs/authentication.md for implementation patterns


8. Rate Limiting

Rate limit headers and strategies to prevent abuse.

Standard Headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

See: docs/rate-limiting.md for implementation strategies


9. Advanced Features

CORS configuration, filtering, sorting, and search patterns.

Topics:

  • CORS headers for browser-based clients
  • Query parameter filtering
  • Multi-field sorting
  • Full-text search

See: docs/advanced-features.md for detailed patterns


10. Documentation

OpenAPI/Swagger documentation for API discoverability.

Auto-Generated (FastAPI):

@app.get("/users/{user_id}", response_model=User)
def get_user(user_id: int):
    """Get user by ID"""
    return db.get_user(user_id)

See: docs/documentation.md for OpenAPI specifications


11. Design Patterns

Idempotency, content negotiation, HATEOAS, bulk operations, and webhooks.

Topics:

  • Idempotency keys for safe retries
  • Content negotiation (JSON, XML, etc.)
  • HATEOAS for discoverable APIs
  • Bulk operations for batch processing
  • Webhooks for event notifications

See: docs/idempotency-content-negotiation.md and docs/patterns-checklist.md


Quick Reference

PatternUse CaseDetails
REST PrinciplesResource-based URLsdocs/rest-principles.md
Status CodesHTTP response codesdocs/http-status-codes.md
Error HandlingRFC 7807 errorsdocs/error-handling.md
PaginationLarge datasetsdocs/pagination.md
VersioningBreaking changesdocs/versioning.md
AuthenticationAPI securitydocs/authentication.md
Rate LimitingAbuse preventiondocs/rate-limiting.md
DocumentationOpenAPI/Swaggerdocs/documentation.md

API Design Checklist

Before Launch:

  • Use RESTful resource naming (nouns, not verbs)
  • Implement proper HTTP status codes
  • Add RFC 7807 error responses
  • Include pagination for collections
  • Add API versioning strategy
  • Implement authentication
  • Add rate limiting
  • Configure CORS (if browser clients)
  • Generate OpenAPI documentation
  • Test idempotency for POST/PUT/DELETE

See: docs/patterns-checklist.md for complete checklist


Progressive Disclosure

This skill uses progressive disclosure to prevent context bloat:

  • Index (this file): High-level concepts and quick reference (<500 lines)
  • Detailed docs: docs/*.md files with implementation details (loaded on-demand)

Available Documentation:

  • docs/rest-principles.md - RESTful design patterns
  • docs/http-status-codes.md - Complete status code reference
  • docs/error-handling.md - Error response patterns
  • docs/request-response-format.md - JSON structure conventions
  • docs/pagination.md - Pagination strategies
  • docs/versioning.md - API versioning patterns
  • docs/authentication.md - Authentication methods
  • docs/rate-limiting.md - Rate limiting implementation
  • docs/advanced-features.md - CORS, filtering, sorting
  • docs/documentation.md - OpenAPI/Swagger
  • docs/idempotency-content-negotiation.md - Advanced patterns
  • docs/patterns-checklist.md - Design checklist and common patterns

Cross-References

Related Skills:

  • error-handling-patterns - Error handling best practices
  • security-patterns - API security hardening
  • python-standards - Python API implementation and documentation standards

Related Libraries:

  • FastAPI - Python API framework with auto-documentation
  • Pydantic - Data validation and serialization
  • JWT libraries - Token-based authentication

Key Takeaways

  1. Resources are nouns: /users, not /getUsers
  2. Use HTTP methods correctly: GET (read), POST (create), PUT (replace), DELETE (remove)
  3. Return proper status codes: 200 (success), 201 (created), 404 (not found), 422 (validation error)
  4. Structured errors: Use RFC 7807 format
  5. Paginate collections: Offset or cursor-based
  6. Version your API: URL path versioning (e.g., /v1/users)
  7. Secure endpoints: API keys or JWT
  8. Rate limit: Prevent abuse
  9. Document thoroughly: OpenAPI/Swagger
  10. Test idempotency: Safe retries for POST/PUT/DELETE

Hard Rules

FORBIDDEN:

  • Exposing internal IDs or database schema in API responses
  • Returning 200 for error conditions (use proper HTTP status codes)
  • APIs without versioning (MUST use URL path versioning like /v1/)
  • Endpoints that accept unbounded input without pagination or limits

REQUIRED:

  • All endpoints MUST have consistent error response format ({error, message, code})
  • All collection endpoints MUST support pagination
  • All mutations MUST be idempotent or explicitly documented as non-idempotent
  • Rate limiting MUST be documented in API specification

平台分布

Codex

37.67%
按下载量换算65

Claude

28.53%
按下载量换算49

Cursor

21.59%
按下载量换算37

Gemini CLI

8.85%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills