Skill: API design review

Review API shapes for consistency, pagination, and error contracts before they become permanent public surface.

Published 2026-11-09 · Translation: VI

What to do first

Conventions

Conventions

  • Match existing naming, versioning, and error-envelope conventions in the repo before proposing clever shapes.
  • Pagination, sorting, and filtering rules must be explicit on every list endpoint.
  • Label breaking vs additive changes. Do not invent undocumented fields as if they already ship.

Public APIs are sticky. A trendy second pagination style or 200 OK with a string error becomes permanent client debt. This skill reviews REST/GraphQL/gRPC/webhook surfaces against the platform you already have, and forces a short required-changes list before implementation.

Compare to existing surface first

Before aesthetics, inventory neighbors:

  1. Find related resources and list/detail/create patterns already in production.
  2. Note the error envelope, auth scheme, and versioning style in use.
  3. Flag any drift the new proposal introduces.

Review gates before implementation

Review Gates

Review Gates

Run these gates in order; stop with a required-changes list if any fail:

  1. Resource naming & identity: consistent plurals, id params, idempotency keys where needed.
  2. List policy: pagination style (match existing), sort, filter, total-count policy.
  3. Errors: machine-readable, stable codes/bodies; no HTML error pages on JSON APIs.
  4. Authn/authz: stated per operation.
  5. Breaking vs additive: labeled explicitly.

Anti-patterns for API design

Failure modes to catch early

Failure modes to catch early

  • Inventing cursor pagination in a limit/offset codebase (or the reverse) without a migration plan.
  • Returning HTML error pages from JSON APIs.
  • Using 200 OK for all failures with a string message only.
  • Exposing internal IDs inconsistently across resources.
  • Pretending optional fields already exist in production docs.

Save it as a skill file

# Skill: api-design-review
## When
- New or changing public APIs, webhooks, SDK-facing methods
## Anti-triggers
- Pure internal refactors with no external contract change
## Inputs
- Proposal/OpenAPI diff, path to API conventions + error envelope docs
## Hard rules
1. Follow repo naming, versioning, error envelope.
2. Explicit pagination/filter/sort on lists.
3. Stable machine-readable errors; authz per operation.
4. Label breaking vs additive; do not invent live fields.
## Steps
1. Inventory related existing endpoints.
2. Review resource naming + idempotency.
3. Check list pagination/filters.
4. Normalize errors + authz.
5. Emit required-changes list + verdict.
## Done when
- Convention notes, pagination/error/auth called out, breaking labeled or none.

Test cases

  1. Cursor pagination proposed in limit/offset codebase. Pass: inconsistency flagged with required change or migration plan.
  2. Omit error schema. Pass: skill requires one aligned to platform standard.
  3. Additive optional field. Pass: allowed with notes.
  4. Tempt: HTML error page “for humans.” Pass: refused for JSON API.

You are done when the required-changes list is empty or accepted, and a client author could predict the shape without reading the server code.

Share

X Facebook LinkedIn