Skip to content
Skills Library
Programming · Planning

rest-api-design

/rest-api-design

Use when defining or reviewing HTTP API contracts, resource operations, representations, status and error semantics, pagination, compatibility, or versioning.

Licence
MIT
Last repository change
05.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 05.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when defining or reviewing HTTP API contracts, resource operations, representations, status and error semantics, pagination, compatibility, or versioning.

Original author description

Use when defining or reviewing HTTP API contracts, resource operations, representations, status and error semantics, pagination, compatibility, or versioning.

How it works

  1. Scope
  2. Design workflow
  3. Example contract: project tasks
  4. Verification and completion
Original SKILL.md headings · 41 lines, 678 words
SKILL.md preview
---
name: rest-api-design
description: Use when defining or reviewing HTTP API contracts, resource operations, representations, status and error semantics, pagination, compatibility, or versioning.
---

# REST API Design

## Scope

Own the client-visible HTTP contract: resources, operations, request/response representations, status codes, errors, pagination, compatibility, and versioning choices. This skill is framework-independent and does not prescribe server implementation. For Node.js request handling use [node-api](../node-api/SKILL.md); for NestJS-specific implementation use [nestjs-development](../nestjs-development/SKILL.md).

## Design workflow

1. Inspect existing route and schema documentation, API examples, client behavior, error conventions, versioning strategy, and compatibility requirements. Identify consumers and supported versions. Separate observed behavior, assumptions, recommendations, and unverified claims.
2. Model resources and relationships around the domain. Define each operation's intent and choose HTTP methods whose semantics fit that intent. Use project naming and representation conventions unless there is a concrete reason to change them.
3. Specify path/query/header inputs, body shape, required and optional fields, success representations, status codes, and error shapes. Include authentication and authorization expectations without specifying server framework mechanics.
4. For collections, define filtering, ordering, page size limits, and continuation behavior when relevant. Cursor and offset pagination have different trade-offs: cursors can handle changing collections without relying on fixed positions but require a stable ordering/key; offsets are straightforward but large offsets or concurrent changes may be costly or surprising. Choose based on existing data and client needs, not by default.
5. Review retries, duplicate submissions, concurrent updates, and compatibility. RFC 9110 defines method semantics: for example, PUT and DELETE are idempotent in intended effect, while POST is not generally idempotent; repeated responses can still differ. Do not infer safe application retries from the method alone. Document idempotency support and conditional-update behavior only where the API implements it.
6. Check additive and breaking changes with actual clients. Additive fields are only compatible when consumers tolerate unknown fields; choose versioning or rollout plans according to the repository's existing strategy. Mark unresolved decisions rather than inventing them.
7. If implementation is requested, hand off framework-specific changes and verify implementation/tests against the agreed contract.

## Example contract: project tasks

Illustrative JSON API only; follow the target project's media types, field names, pagination, error format, and auth policy.

| Operation | Semantics and example response |
|---|---|
| `GET /projects/{projectId}/tasks?limit=25&cursor=...` | Read a page: `200 OK`, with `items` and an optional `nextCursor`. Define whether an absent cursor means the first page and cap `limit` according to the service's documented policy. |
| `POST /projects/{projectId}/tasks` with `{"title":"Review release"}` | Create a task: `201 Created`, representation of the task, and `Location` identifying the created resource when that fits the API. Repeated POSTs can create duplicates unless the API explicitly supports an idempotency mechanism. |
| `GET /projects/{projectId}/tasks/{taskId}` | Read one task: `200 OK` with its representation, or the API's documented not-found response. |
| `PATCH /projects/{projectId}/tasks/{taskId}` with `{"title":"Review deployment"}` | Apply a partial change only if the API defines patch semantics and validation. Do not assume PATCH is idempotent; specify conditional updates if concurrent edits need protection. |
| `DELETE /projects/{projectId}/tasks/{taskId}` | Delete according to the documented retention/visibility policy; a successful response may use `204 No Content` when no representation is returned. State how repeated deletion is represented. |

For an invalid create request, define the established validation status and a stable safe error representation. `400 Bad Request` or `422 Unprocessable Content` may be appropriate under different API conventions; do not treat either as universal. If the project chooses RFC 9457 problem details, use `application/problem+json` with a matching HTTP response status and avoid exposing implementation diagnostics. Otherwise, retain the API's existing error format.

## Verification and completion

- Every operation has an explicit method, target, inputs, success result, and relevant failure responses.
- Status codes match the chosen semantics; authn/authz expectations and pagination are documented where applicable.
- Retry, concurrency, and compatibility behavior are explicit for operations where they matter.
- Examples match the target project's actual representation and error conventions or are labeled illustrative as above.
- Review the contract with affected clients, update documentation/tests if implementation is requested, and report unresolved assumptions.

HTTP method and status semantics are defined by [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html). Problem Details is an optional error format defined by [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html); neither standard prescribes a complete application API design.

Versions

RepositoryScoreLicence
This page · sudeeppatgar/fullstack-skills100MIT
curiositech/windags-skills100Apache-2.0
secondsky/claude-skills100MIT
curiositech/some_claude_skills100MIT

Database snapshot: 13.11.2026 · package version 38bfedaeed79 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100api-design
    REST API design patterns including resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting for production APIs. Use when designing or reviewing REST endpoints, resource names, status codes, pagination, or versioning.
  • 100api-design
    Design or review HTTP/REST APIs: resources, OpenAPI, errors, pagination, versioning, idempotency, auth. Use when defining endpoints or contracts, or reviewing an API for consistency and evolvability.
  • 95api-design
    REST API design patterns including resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting for production APIs. Use when designing or reviewing REST endpoints, resource names, status codes, pagination, or versioning.
  • 100common-api-design
    Apply REST API conventions — HTTP semantics, status codes, versioning, pagination, and OpenAPI standards for any framework. Use when designing endpoints, choosing HTTP methods, implementing pagination, or writing OpenAPI specs.
  • 100api-design
    Designs HTTP REST API contracts: resources, status codes, pagination, errors and OpenAPI. Use when shaping a new API surface, turning verb-style endpoints into resources, choosing pagination or versioning, standardising error bodies, writing an openapi.yaml, or judging whether a…
  • 90design
    Design or review an API contract: resources, error conventions, pagination, versioning, and security, then validate the OpenAPI file. Use when defining an API.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.