agentleFS
WST2002WST2002/claude-code-skills/skills/api-design-review/SKILL.md

api-design-review

Skill4 starsChanged 27 days agoMITView on GitHub

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.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Changes: if reviewing a diff, compare old and new contracts and flag anything that breaks existing clients.

    line 17
  2. Very specific:

    Start with: N endpoints reviewed, M findings (X breaking).

    line 38

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.