---
name: api-and-interface-design-abb436116cfa
description: "Design API and module boundaries with clear contracts, error semantics, pagination, and additive compatibility. Use before implementing REST/GraphQL endpoints, SDKs, or public module APIs."
allowed-tools: Read, Glob, Grep
---

# API and Interface Design

Contract-first design for HTTP APIs, GraphQL, CLI surfaces, and library module boundaries. Complements `secure-api-design` (security) and `agent-tool-contracts` (LLM tools) with general interface ergonomics and evolution rules.

## When to use

- New public or cross-team API
- Breaking-change review
- Designing pagination, filtering, idempotency, or error shapes

## When not to use

- Internal refactor with no boundary change
- Security-only audit (use `secure-api-design`)
- Agent tool schema only (use `agent-tool-contracts`)

## Design checklist

### Contract

- Resource naming consistent (nouns, plural collections)
- Versioning strategy documented (URL prefix, header, or additive-only)
- Request/response schemas with examples for happy path + common errors
- Idempotency keys for mutating operations where retries matter

### Errors

- Stable machine-readable codes separate from human messages
- HTTP/status mapping documented; no stack traces in client responses
- Validation errors: field-level detail when safe (no PII leakage)

### Pagination and lists

- Cursor-based preferred for large/live datasets; offset only when bounded
- Default and max page size documented
- Sort/filter params explicit; reject unknown params predictably

### Compatibility

- Additive changes only in minor versions
- Deprecation headers or sunset dates for removals
- Consumer migration notes in changelog

### Observability

- Correlation/request IDs in responses or logs
- Rate-limit headers where applicable

## Workflow

1. Draft resource model and primary use cases
2. Write example requests/responses (including errors)
3. Run `doubt-driven-review` or `secure-api-design` for high-risk surfaces
4. Implement with tests locked to contract examples

## Output

- Short design note or OpenAPI/GraphQL schema sketch
- Compatibility and deprecation table if evolving an existing API


---
Source attribution: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.claude/skills/api-and-interface-design/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 charlieviettq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.claude/skills/api-and-interface-design/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Product Manager, Technical Product Manager, Growth Product Manager, Data Engineer
Specialties: API
Tools: Read, Glob, Grep
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 30b14b499a02c91aeb45e3eeef6e1ec269a0273888fcf303a6acc33158299c11
