From kernel
Enforces REST API design patterns: resource naming, status codes, pagination, error responses, versioning. Triggers: api, rest, endpoint, route, http, status-code, pagination.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kernel:apiThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<skill id="api">
RESOURCE NAMING
/api/v1/users, /api/v1/team-members/api/v1/users/:id/ordersPOST /api/v1/orders/:id/cancelSTATUS CODES — use semantically, never 200 for errors
200 OK · 201 Created (+ Location header) · 204 No Content
400 Bad Request · 401 Unauthorized · 403 Forbidden · 404 Not Found
409 Conflict · 422 Unprocessable Entity · 429 Too Many Requests
500 Internal Server Error · 502 Bad Gateway · 503 Service Unavailable (+ Retry-After)
(gate: POST returns 201, DELETE returns 204, errors never return 200)
VALIDATE ALL INPUT before any processing
RESPONSE SHAPE — consistent envelope
{ "data": { ... } }{ "data": [...], "meta": { total, page, per_page }, "links": { self, next, last } }{ "error": { "code": "snake_case_code", "message": "...", "details": [...] } }PAGINATION — mandatory for all list endpoints
?cursor=...&limit=20): use for feeds, infinite scroll, >10K rows?page=N&per_page=20): use for admin dashboards, search with page jumpsnext_cursor as opaque string — agents must not compute it from mathVERSIONING
/api/v1/, /api/v2/ (recommended)Sunset header before removalRATE LIMITING — expose via headers on every response
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: <unix-timestamp>
Retry-After: 60 # on 429 only
(gate: 429 response always includes Retry-After)
IDEMPOTENCY — mandatory for state-changing ops in distributed/agentic contexts
Idempotency-Key header on POST/PATCHidem:<key> with 24h TTL; return cached on repeatHEALTH ENDPOINTS
GET /health # Liveness: 200 if process alive
GET /health/ready # Readiness: 200 if all dependencies up
GET /health/startup # Startup: 200 once init complete
{ "status": "ok|degraded", "version": "...", "dependencies": { "db": "ok" } }AGENTIC CLIENT DESIGN — when API is called by AI agents
Idempotency-Key (document which)GET /api/v1/users/batch?ids=a,b,cnext_cursor as direct string, never derivable by offset math<anti_patterns> /getUsers, /createOrder. Use HTTP methods for actions. { "status": 200, "success": false }. Use HTTP status codes. Trusting user input. Validate everything with schemas. Stack traces in error responses. Generic messages for users. Returning all records. Pagination is mandatory for lists. </anti_patterns>
<on_complete> agentdb write-end '{"skill":"api","endpoints_created":,"validation":"zod|pydantic|none","pagination":"cursor|offset|none","versioning":"v1|none"}'
Record endpoints added and patterns used. </on_complete>
npx claudepluginhub ariaxhan/kernel-claude --plugin kernelREST API design patterns covering resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting for production APIs.
Establishes REST API design patterns for resource naming, HTTP methods and status codes, pagination, filtering, error responses, versioning, and rate limiting for production APIs.
Provides RESTful API design standards covering resource naming, HTTP methods, status codes, pagination, versioning, and error response formats.