api-design-review
Skill9 starsChanged 5 months agoApache-2.0View on GitHub
Designs and reviews HTTP/REST and RPC API surfaces — resource naming, verbs, status codes, pagination, versioning, idempotency, error envelopes, and backward compatibility. Use when creating a new endpoint or changing an existing API contract.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- chrislacey89/skillstheir own version, first seen Sep 18, 2026
- jedarden/jeds-curated-skillstheir own version, first seen Aug 15, 2026
- Noorkhalel/saas-ai-skillstheir own version, first seen Jul 12, 2026
- KhaledSaeed18/dotclaudetheir own version, first seen Jul 4, 2026
- tekumara/skillstheir own version, first seen Apr 26, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- KhaledSaeed18/dotclaude★ 5same name
- chrislacey89/skills★ 3same name
- Noorkhalel/saas-ai-skills★ 2same name
- jedarden/jeds-curated-skills★ 1same name
- tekumara/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository147 other files it gives its agents.
- second-brain/AGENTS.mdAGENTS.md
- second-brain/CLAUDE.mdCLAUDE.md
- agent-tool-mcp-builderSkill
- async-concurrency-correctnessSkill
- audit-accessibility-wcagSkill
- audit-license-complianceSkill
- audit-technical-seoSkill
- auth-jwt-sessionSkill
- author-codemodSkill
- brainstorm-designSkill
- build-audit-loggingSkill
- build-cdc-streaming-pipelineSkill
- build-cli-toolSkill
- build-data-tableSkill
- build-etl-pipelineSkill
- build-form-validationSkill
- build-native-mobile-uiSkill
- build-office-docsSkill
- build-offline-first-syncSkill
- build-react-componentSkill
- build-realtime-channelSkill
- build-spreadsheetSkill
- build-vector-searchSkill
- caching-strategySkill
- cicd-pipeline-authorSkill
- cloud-cost-optimizeSkill
- code-commentsSkill
- code-reviewSkill
- compose-local-dev-stackSkill
- configure-bundler-buildSkill
- configure-dns-tlsSkill
- configure-reverse-proxy-lbSkill
- configure-security-headers-cspSkill
- contract-testingSkill
- datetime-timezone-correctnessSkill
- db-migration-safetySkill
- debug-ci-pipeline-failureSkill
- debug-flaky-testsSkill
- debug-frontend-browserSkill
- debug-root-causeSkill
- defend-llm-prompt-injectionSkill
- deliver-webhooksSkill
- dependency-upgradeSkill
- deploy-releaseSkill
- design-api-paginationSkill
- design-authorization-modelSkill
- design-backup-dr-recoverySkill
- design-event-sourcing-cqrsSkill
- design-multi-tenancySkill
- design-protobuf-grpc-serviceSkill
- design-relational-schemaSkill
- design-search-index-infraSkill
- design-state-machineSkill
- design-token-systemSkill
- diff-table-paritySkill
- distributed-locks-leasesSkill
- dockerfile-optimizeSkill
- encrypt-sensitive-dataSkill
- error-messageSkill
- estimate-workSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
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
- Distinctive: line 16
Do NOT use for: pure internal refactors with no wire-format change, or UI-only work.
- Very specific: line 52
200for async work: If processing is deferred, return 202 Accepted with a status/polling URL — not 200 implying it's done. - Distinctive: line 70
If a contract test / schema snapshot exists, run it and confirm the diff matches the intended (and documented) changes only.
“Common” is measured: kept by at least 6 in 10 of the 5 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.
Files
When to Use
Invoke before writing or merging any change that alters an API contract:
- Adding a new endpoint or RPC method.
- Changing a request or response body (add/remove/rename field, change type, change nullability).
- Changing path, query params, HTTP verb, or status codes of an existing route.
- Designing pagination, filtering, sorting, or a versioning strategy.
Do NOT use for: pure internal refactors with no wire-format change, or UI-only work.
Steps
- Pin the contract surface. List every consumer-visible element you touch:
METHOD /path, query params, request body fields, response body fields, status codes, headers. If you can't enumerate it, you can't review it. - Model resources as nouns, actions as verbs. Path = pluralized noun collection (
/orders,/orders/{id}/items). Never put the action in the path (/getOrder,/createOrderare wrong). Map intent to verb:GETread, no side effects, safe + idempotent.POSTcreate / non-idempotent action → returns201+Locationheader (or202for async).PUTfull replace, idempotent.PATCHpartial update.DELETEremove, idempotent →204(or200with body).- Genuinely non-CRUD action → POST a sub-resource (
POST /orders/{id}/cancel), not a verb path.
- Pick the correct status code — not a blanket 200.
201created (withLocation),202accepted-async,204success-no-body.400malformed syntax,401unauthenticated,403authenticated-but-forbidden,404not found,409conflict (e.g. duplicate, state clash),422well-formed but semantically invalid (validation),429rate-limited.5xxonly for server faults — never for client validation failures.
- Standardize pagination/filter/sort across the surface. Pick ONE pagination style and apply it everywhere: cursor-based (
?cursor=&limit=, opaque cursor, stable for live data — preferred) or offset (?page=&per_page=, simpler but drifts on inserts). Return pagination metadata consistently (e.g.{ "data": [...], "next_cursor": "...", "has_more": true }). Filtering/sorting via explicit allow-listed params (?status=open&sort=-created_at); reject unknown params instead of silently ignoring. - Use a single error envelope for every error response. Same shape on every 4xx/5xx so clients parse once:
{ "error": { "code": "VALIDATION_FAILED", "message": "human readable", "details": [ { "field": "email", "issue": "invalid format" } ] } }code= stable machine string (clients branch on this, never onmessage). Don't leak stack traces / internal SQL. - Require idempotency for unsafe writes. Non-idempotent
POSTthat creates resources or moves money/state must accept anIdempotency-Keyheader; server stores key→result and replays the same response on retry.PUT/DELETEmust be naturally idempotent (calling twice = same end state, no error on secondDELETEof already-gone resource →204or404, pick one and document it). - Version + run a breaking-change diff. Diff the new contract against the existing one. Backward-compatible (safe, no version bump): adding an optional field, adding a new endpoint, adding an enum value clients must tolerate, loosening validation. Breaking (needs new version or is forbidden): removing/renaming a field, changing a type, making an optional field required, tightening validation, changing status-code semantics, changing default behavior. Version via URL (
/v2/...) or header — pick the project's existing convention. If a change is breaking, either make it additive instead, or ship under a new version and keep the old one working. - Validate input at the edge. Reject unknown/extra fields or define the policy explicitly. Enforce types, ranges, lengths, and required-ness before any business logic runs. Document every field: type, required?, default, constraints, example.
Common Errors
- Silent breaking change. Renaming a response field or tightening validation looks harmless in a diff but breaks every existing client. Always diff against the deployed contract, not just the previous commit.
- Status code 200 for everything (including errors, with
{"success": false}in the body). Clients then can't rely on HTTP semantics, retries/caching/monitoring all misbehave. Use real status codes. 200for async work. If processing is deferred, return202 Acceptedwith a status/polling URL — not200implying it's done.- 404 vs 403 leak. Returning
404to hide existence is sometimes intentional; returning403reveals the resource exists. Decide deliberately and be consistent. - POST retried twice creates duplicates because there's no idempotency key — classic double-charge / double-order bug on flaky networks.
- Offset pagination on live data skips or repeats rows when records are inserted/deleted between pages. Prefer cursor for anything mutating.
- Inconsistent error shapes across endpoints force clients to write per-endpoint parsing. One envelope, always.
422vs400confusion.400= can't even parse the request;422= parsed fine but the values are invalid. Mixing them makes client retry logic wrong.
Verify
- Every path is a noun; no verbs in paths.
- Each operation uses the semantically correct verb and a specific status code (not blanket
200). - Error responses across the whole surface share one envelope with a stable
codefield. - All create/state-changing
POSTs accept an idempotency key;PUT/DELETEare idempotent. - Pagination/filter/sort follow one consistent pattern; unknown params are rejected, not ignored.
- Ran a contract diff vs the deployed version → any breaking change is either reworked to be additive or shipped under a new version with the old one intact.
- Every request/response field is documented (type, required, default, example) and validated at the edge.
- No internal details (stack traces, SQL, secrets) leak in any response.
If a contract test / schema snapshot exists, run it and confirm the diff matches the intended (and documented) changes only.
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
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.

