api-design
Use when designing, reviewing, or versioning an HTTP API contract, choosing resource naming, or mapping OpenAPI structures to implementation boundaries.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- api-design
- license
- MIT
- metadata
- { "owner": "Harley Bartles", "status": "active", "use_when": [ "designing a new API contract.", "reviewing an existing API contract for consistency and spec compliance.", "versioning paths, schemas, or security schemes.", "choosing resource and operation naming conventions." ], "source-id": "api-design", "source-path": "skills/api-design/SKILL.md", "related_skills": [ "secure-development" ], "do_not_use_when": [ "the work is implementation framework-specific.", "the work is code-generation only." ], "provenance-name": "Api Design first-party skill", "source-category": "first_party" }
- description
- Use when designing, reviewing, or versioning an HTTP API contract, choosing resource naming, or mapping OpenAPI structures to implementation boundaries.
02 资源文件 6
- 参考文档agents/openai.yaml335 B
- 资产文件assets/authority/authority.yaml948 B
- 资产文件assets/authority/CITATIONS.md1.4 KB
- 资产文件assets/authority/reference-source/openapi-specification/OpenAPI-Specification-3.1.0.md127.2 KB
- 资产文件assets/authority/source-map.yaml348 B
- 参考文档references/operational-guidance.md2.4 KB
03 SKILL.md 正文
API Design
Overview
Produce and evaluate HTTP API contracts that are clear, stable, and aligned with the OpenAPI Specification. This skill covers contract structure, reusable components, versioning, and design conventions.
When to Use
- Designing a new API contract from requirements.
- Reviewing a contract for spec compliance and consistency.
- Deciding how to version paths, schemas, or security schemes.
- Choosing resource naming, operation semantics, or error response shapes.
Do not use when another more specific skill owns the task.
Core Pattern
- Start with the OpenAPI Object, then fill
info,servers, andpaths. - Define reusable schemas, parameters, responses, and security schemes under
components. - Prefer explicit version declarations; keep breaking changes out of patch releases.
- Use consistent resource naming and HTTP methods; return structured problem details for errors.
- Reference reusable components with
$refto keep the contract DRY.
Common Mistakes
- Mixing transport, framework, or generator concerns with the contract itself. → Keep the contract independent of implementation.
- Hard-coding repeated schemas instead of using
components/schemas. → Extract and reference reusable components. - Changing path semantics without a version bump. → Treat breaking changes as major-version events.
- Treating optional fields as required or missing security scope definitions. → Declare
requiredandsecurityexplicitly.
For detailed guidance, see references/operational-guidance.md.
04 同仓库更多 Skills
writing
Use when drafting, revising, or reviewing prose for human readers and clarity, an authorised voice, or reader-fatigue concerns may interact.
writing-with-clarity
Use when drafting, revising, or reviewing prose intended for human readers, including documentation, README files, reports, explanations, UI copy, errors, comments, commit messages, and pull request text.
writing-style
Use when revising or reviewing human-facing prose against an authorised voice card or a contextual reader-fatigue profile.
skill
暂无简介
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment.
writing-roadmaps
Use when a goal is too large for one writing-plans plan and requires a sequenced roadmap of consecutive plans.