Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Api Design?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/int2t05-api-design)
---
name: api-design
description: Define a consumer-facing API contract with consistent behavior. Triggers on "design API", "接口设计".
---
# API and Interface Design
## When to use
- Define a consumer-facing API contract with consistent behavior.
**Not for:** api-testing for contract verification.
## Steps
1. Identify consumers, protocol, operations and trust boundaries; follow project contract tooling.
2. Specify requests, responses, authentication, authorization, validation and errors. For HTTP, verify method and status semantics against [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html). Use the project’s supported [OpenAPI](https://spec.openapis.org/oas/latest.html) version and error format, including [Problem Details](https://www.rfc-editor.org/rfc/rfc9457.html) where adopted.
3. Define pagination, concurrency, idempotency and evolution only where needed; include normal and failure examples.
4. Update the authoritative schema or approved contract document; validate schemas and consumer examples before human review.
**Output:** Suggested paths, subject to [human audit](../../../references/human-audit.md): `docs/API/*.md` or the authoritative machine-readable contract.
## Verify
- Examples match the schema; authorization, errors and repeat-request behavior are testable.
## References
- [engineering-principles.md](../../../references/engineering-principles.md) — shared decision boundaries, scope and verification.
- [human-audit.md](../../../references/human-audit.md) — document consent, readability and human review.
- [references/versioning-strategy.md](references/versioning-strategy.md) — when breaking change is unavoidable: URI/header versioning, Deprecation and Sunset response headers, dual-version coexistence, sunset timeline
- [references/openapi-lifecycle.md](references/openapi-lifecycle.md) — design-first vs code-first, Spectral/Redocly linting, openapi-generator SDK generation, spec versioning, CI pipeline