Communitygithub.com

WST2002/claude-code-skills

Use when designing a new REST API, reviewing endpoints, routes, controllers or an OpenAPI/Swagger spec, choosing status codes, pagination, versioning or error formats, or checking an API change for breaking changes.

What is claude-code-skills?

claude-code-skills is a Claude Code agent skill that use when designing a new REST API, reviewing endpoints, routes, controllers or an OpenAPI/Swagger spec, choosing status codes, pagination, versioning or error formats, or checking an API change for breaking changes.

Works with✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/WST2002/claude-code-skills/tree/HEAD/skills/api-design-review

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

API Design Review

Overview

Judge an API from the client's side: predictable names, honest status codes, one error shape, safe retries, and no surprise breaking changes. Every finding points at a concrete route and shows the corrected design.

Method

  1. Inventory. List every endpoint as METHOD /path → status codes → request/response shape. Read routes, controllers, OpenAPI files and DTOs.
  2. Check each endpoint against the rules below.
  3. Check the API as a whole: consistency across endpoints matters more than any single choice.
  4. Changes: if reviewing a diff, compare old and new contracts and flag anything that breaks existing clients.
  5. Report using the contract below.

Rules

AreaRule
ResourcesPlural nouns, no verbs: POST /orders, not /createOrder. Nest only for true ownership: /users/{id}/orders.
MethodsGET reads and is safe. POST creates. PUT replaces. PATCH partially updates. DELETE removes. Never change state on GET.
Status codes200 OK, 201 Created (+ Location), 204 No Content, 400 invalid input, 401 not authenticated, 403 not allowed, 404 missing, 409 conflict, 422 validation, 429 rate limited, 5xx only for server faults. Never 200 with {"error": ...}.
ErrorsOne shape everywhere, e.g. RFC 9457: { "type", "title", "status", "detail", "errors": [{ "field", "message" }] }. No stack traces or SQL in responses.
NamingOne casing for JSON fields (camelCase or snake_case), consistent IDs, ISO 8601 UTC timestamps, money as integer minor units or decimal string plus currency.
CollectionsPaginate every list (cursor preferred for large or changing data), cap page size, return next cursor or links. Filtering and sorting via query params.
IdempotencyRetried POSTs that create payments, orders or emails accept an Idempotency-Key. PUT and DELETE are idempotent by design.
VersioningA clear strategy (/v1 path or header). Breaking changes go to a new version.
Breaking changesRemoving or renaming fields, changing types, making optional input required, changing status codes or error shape, tightening validation.
SecurityAuth on every non-public route, object-level ownership checks, rate limits on auth and expensive routes, no sensitive data in URLs.
PerformanceNo unbounded responses, support fields or sparse responses for heavy objects, ETag or Cache-Control for cacheable GETs.

Output contract

Start with: N endpoints reviewed, M findings (X breaking). Then, highest impact first:

### [Breaking | High | Medium | Low] Title
- Endpoint: METHOD /path (file:line)
- Problem: what a client experiences
- Fix: the corrected route, status code or JSON shape

Finish with a short Consistency summary (casing, error shape, pagination, versioning: consistent or not) and, when designing from scratch, the proposed endpoint table.

Common mistakes

  • Reviewing endpoints one by one and missing that two of them disagree on casing or error shape.
  • Recommending a redesign when a backward-compatible addition would do.
  • Calling a change safe because the server code still works: check what existing clients send and expect.
  • Using 500 for validation errors or 404 for permission failures without deciding deliberately.

Made by Wageesha Tripathi · LinkedIn · Email · More skills

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Related Skills