Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Designs clean, consistent REST and GraphQL APIs covering resource modeling, URL structure, versioning, pagination, filtering, error formats (RFC 9457 Problem Details), idempotency, authentication, rate limiting, and machine-readable contracts (OpenAPI 3.1 / GraphQL SDL). Use this skill when designing a new API or endpoint, reviewing an API design, choosing REST vs GraphQL, deciding on versioning or pagination strategy, defining error responses, adding idempotency keys, writing or critiquing an O
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-12 | ✓→✓ | = Same ✓ | 69% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 48% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 90% | 0% |
This skill helps you design HTTP/REST and GraphQL APIs that are predictable, evolvable, and pleasant to consume. It covers resource modeling, URI design, HTTP semantics, versioning, pagination, filtering/sorting, error contracts, idempotency, concurrency control, auth, rate limiting, and writing machine-readable contracts.
Keywords: REST, GraphQL, OpenAPI, Swagger, API design, endpoint, resource, versioning, pagination, cursor, idempotency, ETag, RFC 9457, Problem Details, rate limit, contract, HATEOAS, webhook.
Apply this skill whenever the user is creating, extending, or reviewing an API surface — not when they are merely calling an existing third-party API.
Pick the style before designing details.
When unsure, default to REST and expose a small GraphQL layer later if client flexibility becomes a real pain point. See references/rest-checklist.md and references/graphql-checklist.md.
Follow these steps in order. Do not jump to URLs or schemas before modeling resources.
references/http-semantics.md. Avoid verbs in REST paths; model actions as sub-resources or status transitions.references/error-design.md.templates/openapi-3.1-template.yaml or templates/graphql-schema-template.graphql.scripts/lint_openapi.py on the OpenAPI file to catch common design smells before review./invoices, /users/{userId}/orders./invoices/{invoiceId}./getInvoice, /createUser. Good: GET /invoices/{id}, POST /users.POST /orders/{id}/cancel, POST /messages/{id}/send. Prefer modeling state: PATCH /orders/{id} with { "status": "cancelled" } when it's a true state field./comments?postId=42 over /users/1/posts/2/comments/3./billing-accounts), and be consistent with field casing (camelCase or snake_case) — pick one and never mix.{ "data": [...], "page": { "nextCursor": "...", "hasMore": true } }. Request: ?limit=50&cursor=abc.?limit=50&offset=100. Beware drift and deep-offset cost.200 OK (GET, PATCH/PUT returning body) · 201 Created (POST; include Location) · 202 Accepted (async) · 204 No Content (DELETE, empty PUT).400 malformed · 401 unauthenticated · 403 authenticated-but-forbidden · 404 not found · 409 conflict (e.g., version mismatch, duplicate) · 410 gone (sunset resource) · 412 precondition failed (If-Match) · 422 semantically invalid body · 429 rate limited (add Retry-After).500 unexpected · 503 unavailable (add Retry-After). Never return 200 with an error body. Full matrix in references/http-semantics.md.GET, PUT, DELETE are idempotent by HTTP definition; POST is not. For retry-safe creation/payment POSTs, accept an Idempotency-Key header and return the original result on replay. See references/idempotency.md.ETag + If-Match for optimistic concurrency on updates → 412 on mismatch. Use If-None-Match for cache validation → 304./v1/.... Simple, visible, cache-friendly.Deprecation and Sunset response headers + changelog. Details in references/versioning.md.type/code.createdAt, not sometimes created).2026-06-08T10:00:00Z), and explicit currency + minor units for money.X-RateLimit-* / RateLimit headers./api/doAction).200 OK for errors, or inconsistent error bodies per endpoint./a/{}/b/{}/c/{}) instead of filters and links.references/rest-checklist.md — full REST design review checklist.references/graphql-checklist.md — GraphQL schema and operational checklist.references/http-semantics.md — methods, status codes, headers, caching, conditional requests.references/error-design.md — RFC 9457 Problem Details patterns and examples.references/idempotency.md — idempotency keys, concurrency, exactly-once patterns.references/versioning.md — versioning strategies, breaking-change rules, deprecation.templates/openapi-3.1-template.yaml — starter OpenAPI 3.1 spec with errors + pagination.templates/graphql-schema-template.graphql — starter GraphQL SDL with Relay pagination.examples/orders-api.md — worked REST example for an Orders domain.scripts/lint_openapi.py — stdlib linter for common OpenAPI design smells.Other measured skills in the registry, with their headline benchmark lift.