Token导航 LogoToken导航

Agent Skill · 前端设计

api-design(API 设计)

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

api-design 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,297。

总安装 220周安装 9GitHub Stars 2下载 71核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akillness/oh-my-gods --skill api-design

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助 API 设计、接口文档和请求响应结构梳理,适合生成 OpenAPI 草稿或检查字段命名。适用于需要明确 endpoint、错误码和分页规则的场景,如前后端联调或服务集成。使用时需确认业务语义、鉴权方式和真实数据样例,避免凭空补字段或改坏现有逻辑。

安装命令:npx skills add https://github.com/akillness/oh-my-gods --skill api-design。建议从现有代码或 schema 中提取事实,确保接口定义与实际实现一致。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

api-design 怎么安装?

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

api-design 支持哪些 AI 工具?

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

api-design 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

api-design 是免费的吗?

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

api-design 用的人多吗?

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

api-design 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

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

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
api-design

API 设计 · 本页

2202需要联网未明确通过

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

SKILL.md 原文

API Design

Use this skill to turn a vague integration idea, backend feature, or service boundary into a stable API contract that other skills can build on.

The job is not to generate pretty docs. The job is to:

  • choose the right API style for the problem
  • define resources, operations, inputs, outputs, and failure semantics
  • make compatibility and versioning decisions explicit
  • produce a contract artifact that implementation, testing, and documentation can share
  • surface tradeoffs before the team hardens the wrong interface

Read references/contract-review-checklist.md and references/boundary-guide.md before handling unusual or high-risk API work.

If the user mainly needs:

  • reference docs, tutorials, example-heavy guides, or docs portal setup, use api-documentation
  • auth implementation or token and session configuration, use authentication-setup
  • contract or integration test strategy, use backend-testing
  • schema, index, or storage design, use database-schema-design

When to use this skill

  • Design a new REST API, GraphQL schema, or internal service contract
  • Refactor an existing API without breaking clients unnecessarily
  • Review naming, resource boundaries, status codes, pagination, filtering, idempotency, or error models
  • Produce an OpenAPI or GraphQL SDL contract before implementation starts
  • Evaluate versioning and backward-compatibility decisions
  • Decide whether an API should stay REST, move to GraphQL, or expose both layers deliberately
  • Prepare an implementation-ready contract packet for backend, frontend, QA, or partner teams

When not to use this skill

  • The main task is building interactive docs, SDK docs, onboarding guides, or example portals: use api-documentation
  • The main task is writing server code, auth middleware, resolvers, or persistence logic
  • The main task is database normalization, indexing, or storage-model optimization: use database-schema-design
  • The request is mainly test planning or contract-test coverage: use backend-testing
  • There is not enough clarity yet to define the API shape honestly; in that case define the open questions and a design spike instead of faking certainty

Instructions

Step 1: Frame the contract problem

Capture the design inputs before inventing endpoints.

Record:

  • users or systems calling the API
  • business action or job to be done
  • domain entities and ownership boundaries
  • existing clients or migrations that constrain compatibility
  • sensitivity and security requirements
  • expected scale patterns: reads, writes, fan-out, pagination, burstiness
  • artifact format requested: OpenAPI, GraphQL SDL, endpoint table, or design memo

If the request is underspecified, state the missing assumptions explicitly inside the design packet.

Step 2: Choose the interface style deliberately

Do not default to a style out of habit.

Prefer REST when
  • the workflow is resource-centric
  • caching, predictable URLs, or simple CRUD-like operations matter
  • external clients need stable, conventional HTTP semantics
  • you want OpenAPI tooling, mocks, and broad ecosystem compatibility
Prefer GraphQL when
  • clients need flexible field selection or combined graph traversal
  • frontend teams need to reduce over-fetching or under-fetching across many screens
  • the schema is a better shared contract than a fixed endpoint list
  • you already have or expect schema-registry or breaking-change checks
Prefer a mixed approach only when
  • the responsibilities are clearly different
  • the team can explain who consumes which surface and why
  • you can avoid duplicated ownership and drift

State the reason for the chosen style. "Because everyone uses it" is not enough.

Step 3: Model resources, operations, and boundaries

For REST:

  • define the top-level resources and their ownership boundaries
  • choose nouns, not verb endpoints, unless an action endpoint is genuinely clearer
  • keep URL structure shallow unless nested resources carry clear parent-child meaning
  • list standard operations plus domain-specific actions separately

For GraphQL:

  • define the core types, relationships, queries, and mutations
  • avoid one giant catch-all mutation surface
  • note where pagination, filtering, and field-level authorization apply
  • identify schema areas likely to change frequently

For either style:

  • mark synchronous versus asynchronous behavior
  • identify idempotent versus non-idempotent writes
  • call out eventual consistency or long-running-job behavior if relevant

Step 4: Define the request and response contract

Design the contract, not just the happy path.

Include:

  • request shape and required fields
  • response shape for success
  • pagination or cursor rules
  • filtering and sorting semantics
  • nullability and defaults
  • field naming conventions
  • timestamps, IDs, and enum behavior
  • partial update behavior

If the API supports both machine-to-machine and frontend clients, note where response shapes or expansion patterns differ.

Step 5: Design auth, errors, and compatibility rules

Capture the operational semantics clients depend on.

Define:

  • auth model expectations at the contract level
  • common status codes or error categories
  • machine-readable error codes
  • retry or idempotency expectations
  • deprecation and sunset behavior
  • compatibility promises: additive-safe, breaking, version-gated, or migration-required

Do not fully implement auth here. Define the contract and hand off detailed setup to authentication-setup when needed.

Step 6: Produce the contract artifact

Pick the lightest artifact that still enables downstream work.

Recommended formats:

  • OpenAPI outline for REST contracts and review-heavy environments
  • GraphQL SDL sketch for schema-first GraphQL work
  • endpoint or operation table for early architecture discussion
  • design memo plus risk list when the right shape is still being debated

Minimum contract packet:

  • chosen style and why
  • audience or consumers
  • entity or type map
  • operations and request or response summary
  • auth, error, and versioning notes
  • open questions or risks
  • downstream handoffs

Step 7: Review for breakage and handoff quality

Before finalizing, check:

  • would an existing client break?
  • are naming and semantics consistent?
  • are pagination and filtering rules actually implementable?
  • are error states and auth failures explicit enough for frontend, QA, or docs work?
  • did you accidentally mix contract design with tutorial-writing or server implementation?

Route next steps clearly:

  • api-documentation for published docs, tutorials, examples, and docs portal setup
  • backend-testing for contract-test and integration-test planning
  • authentication-setup for concrete auth implementation
  • database-schema-design when the storage model needs its own pass

Output format

Expected response shape:

  • API design packet: name, style choice, consumers, and primary job
  • Resource or type model: the core entities and ownership boundaries
  • Operations: request and response summaries for key endpoints, queries, or mutations
  • Contract rules: auth, error, pagination, and compatibility decisions
  • Risks or open questions: unresolved assumptions or migration concerns
  • Handoffs: which sibling skills should own docs, testing, auth, or storage follow-up

Examples

Example 1: Public REST contract for partner integrations

Input:

Design a partner-facing order status API for ecommerce vendors. We need stable
polling, webhook fallback later, and careful versioning.

Expected shape:

  • chooses REST because external partners need predictable HTTP semantics
  • defines orders and order-events clearly
  • specifies status transitions, filtering by update time, and versioning rules
  • includes machine-readable errors and idempotent webhook-registration notes
  • hands off to api-documentation for partner docs and examples

Example 2: GraphQL schema for a dashboard client

Input:

We need a dashboard API for projects, deployments, incidents, and alerts. The
UI has many views and keeps over-fetching in REST.

Expected shape:

  • justifies GraphQL for flexible client reads
  • defines core types and query or mutation boundaries
  • notes pagination and authorization at field or query level
  • flags schema hot spots and breaking-change review needs
  • hands off to backend-testing for contract checks and api-documentation for example queries

Example 3: Route away when the task is really docs publishing

Input:

Document our auth API with Swagger UI and write frontend integration examples.

Expected shape:

  • recognizes that published docs belong to api-documentation
  • keeps this skill focused on the underlying contract questions only
  • does not pretend docs publishing is the same job as API design

Best practices

  1. Treat the API contract as a product boundary, not just a code convenience.
  2. Separate design decisions from documentation publishing.
  3. Record assumptions and open questions instead of pretending certainty.
  4. Prefer additive evolution and explicit deprecation over surprise breaking changes.
  5. Keep rationale visible when choosing REST versus GraphQL.
  6. Use the smallest artifact that lets downstream teams act.
  7. Hand off intentionally to adjacent skills instead of bloating this one.

References

平台分布

Codex

34.5%
按下载量换算24

Claude

28.28%
按下载量换算20

Cursor

17.19%
按下载量换算12

Gemini CLI

10.18%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills