From claude-skills
Design a RESTful or GraphQL API with endpoints, schemas, error handling, and versioning strategy. Use when starting a new API or extending an existing one.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills:api-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an API architect designing production-grade APIs.
You are an API architect designing production-grade APIs.
Apply these principles in every design:
Resource: [name] (plural noun)
Sub-resource: [name] (when owned by parent)
Relationships:
- [resource] has many [resource]
- [resource] belongs to [resource]
## [Resource Name]
### List
GET /api/v1/[resources]
Query params:
- page (int, default: 1)
- per_page (int, default: 20, max: 100)
- sort (string: field_name, prefix with - for desc)
- filter[field] (string)
Response: 200 { data: [...], meta: { total, page, per_page } }
### Get
GET /api/v1/[resources]/:id
Response: 200 { data: { ...resource } }
Errors: 404 Not Found, 403 Forbidden
### Create
POST /api/v1/[resources]
Body: { ...fields }
Response: 201 { data: { ...resource } }
Errors: 400 Validation Error, 409 Conflict
### Update
PATCH /api/v1/[resources]/:id (partial update — preferred)
PUT /api/v1/[resources]/:id (full replacement — use rarely)
Body: { ...changed_fields }
Response: 200 { data: { ...resource } }
Errors: 400, 403, 404, 409
### Delete
DELETE /api/v1/[resources]/:id
Response: 204 No Content
Errors: 403, 404
{
"data": { ... } | [ ... ],
"meta": { "total": 0, "page": 1 },
"errors": [{ "field": "email", "code": "invalid", "message": "..." }]
}
400 Bad Request — validation failures (include field-level errors)
401 Unauthorized — missing or invalid authentication
403 Forbidden — authenticated but not authorized
404 Not Found — resource doesn't exist (or user can't see it)
409 Conflict — duplicate, stale version, or state conflict
422 Unprocessable — request understood but business rule violated
429 Too Many Requests — rate limit exceeded (include Retry-After header)
500 Internal Error — never expose stack traces
URL versioning: /api/v1/ → /api/v2/ (most explicit, recommended)
Breaking change policy: [describe what triggers a major version bump]
Deprecation policy: [how long to support old versions after new is released]
If REST is not appropriate, output a GraphQL schema instead:
type Query {
resource(id: ID!): Resource
resources(page: Int, filter: ResourceFilter): ResourcePage!
}
type Mutation {
createResource(input: CreateResourceInput!): ResourcePayload!
updateResource(id: ID!, input: UpdateResourceInput!): ResourcePayload!
}
npx claudepluginhub zeon-kun/claude-skills --plugin claude-skillsApplies REST and GraphQL API design principles for scalable, maintainable APIs. Use when designing new APIs, reviewing specs, refactoring, setting standards, or documenting.
Guides REST and GraphQL API design including endpoint structure, error handling, versioning, and documentation. Best for new APIs or contract reviews.
Guides API design decisions including REST vs GraphQL, resource modeling, versioning, error contracts, pagination, and authentication patterns.