skills/api-design/SKILL.md
Design clean, consistent, and well-documented APIs using contract-first principles. Use for REST API design, endpoint naming, request/response modeling, error handling patterns, versioning strategies, OpenAPI specification writing, and API documentation.
npx skillsauth add simplerick0/com.ackhax.configs api-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design APIs that are intuitive, consistent, and maintainable.
# Use nouns, not verbs
GET /users ✓
GET /getUsers ✗
# Plural for collections
GET /users ✓
GET /user ✗
# Nested for relationships
GET /users/123/orders
POST /users/123/orders
# Use kebab-case for multi-word
GET /user-profiles ✓
GET /userProfiles ✗
| Method | Purpose | Idempotent | Request Body | |--------|---------|------------|--------------| | GET | Read resource(s) | Yes | No | | POST | Create resource | No | Yes | | PUT | Replace resource | Yes | Yes | | PATCH | Partial update | Yes | Yes | | DELETE | Remove resource | Yes | No |
2xx Success
200 OK - General success
201 Created - Resource created (return Location header)
204 No Content - Success, no body (DELETE)
4xx Client Error
400 Bad Request - Malformed request, validation error
401 Unauthorized - No/invalid authentication
403 Forbidden - Authenticated but not authorized
404 Not Found - Resource doesn't exist
409 Conflict - State conflict (duplicate, version mismatch)
422 Unprocessable - Valid syntax, invalid semantics
5xx Server Error
500 Internal Error - Unexpected server failure
503 Unavailable - Temporary overload/maintenance
// Success
{
"data": { ... },
"meta": {
"page": 1,
"total": 100
}
}
// Error
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid email format",
"details": [
{ "field": "email", "issue": "must be valid email" }
]
}
}
# Offset-based (simple, has issues at scale)
GET /users?page=2&limit=20
# Cursor-based (preferred for large datasets)
GET /users?cursor=abc123&limit=20
Response includes:
{
"data": [...],
"meta": {
"next_cursor": "def456",
"has_more": true
}
}
# Filtering
GET /users?status=active&role=admin
# Sorting
GET /users?sort=created_at:desc,name:asc
# Field selection (sparse fieldsets)
GET /users?fields=id,name,email
{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "User with ID 123 not found",
"request_id": "req_abc123",
"documentation_url": "https://api.example.com/docs/errors#RESOURCE_NOT_FOUND"
}
}
Use consistent, machine-readable codes:
VALIDATION_ERROR - Request validation failed
AUTHENTICATION_ERROR - Auth token missing/invalid
AUTHORIZATION_ERROR - Insufficient permissions
RESOURCE_NOT_FOUND - Entity doesn't exist
CONFLICT - State conflict
RATE_LIMITED - Too many requests
INTERNAL_ERROR - Server-side failure
Return specific field-level details:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{ "field": "email", "code": "INVALID_FORMAT", "message": "Must be valid email" },
{ "field": "age", "code": "OUT_OF_RANGE", "message": "Must be 18 or older" }
]
}
}
# URL path (most common, explicit)
/v1/users
/v2/users
# Header (cleaner URLs, less discoverable)
Accept: application/vnd.api+json; version=1
# Query param (easy to test, pollutes caching)
/users?version=1
openapi: 3.0.3
info:
title: My API
version: 1.0.0
description: API for managing users
servers:
- url: https://api.example.com/v1
paths:
/users:
get:
summary: List users
operationId: listUsers
parameters:
- name: limit
in: query
schema:
type: integer
default: 20
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/UserList'
components:
schemas:
User:
type: object
required:
- id
- email
properties:
id:
type: string
format: uuid
email:
type: string
format: email
name:
type: string
operationId for code generationBefore finalizing an API:
development
Manage VSCode/Cursor configuration in this dotfiles repository. Use when working with settings.json, keybindings.json, or tasks.json files, or when asked about VSCode/Cursor configuration structure.
tools
Design user interfaces and experiences for web applications without requiring design tools. Use for wireframing in text/ASCII, defining user flows, creating component hierarchies, establishing design systems, planning responsive layouts, and making accessibility decisions.
development
Testing specialist focused on comprehensive test coverage for Python applications. Use for pytest patterns, unit/integration/E2E testing, fixtures, mocking, property-based testing with Hypothesis, and factory patterns.
development
Project management adapted for solo developers working without a team. Use for personal project planning, time-boxing work sessions, managing scope creep alone, maintaining momentum on side projects, tracking progress without overhead, making decisions without external input, and staying accountable to yourself.