ardurai/god-skill-suite/god-api-design
Claude Code and agent skill by ardurai/god-skill-suite
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
God-level API design skill covering REST (Richardson Maturity Model, HTTP semantics, status codes, versioning, pagination, filtering, HATEOAS), GraphQL (schema design, resolvers, N+1 problem, DataLoader, subscriptions, federation), gRPC (Protocol Buffers, service definitions, streaming types, deadlines, interceptors), AsyncAPI and event-driven API design, API security (OAuth 2.0, OIDC, JWT, API keys, mTLS), API contracts (OpenAPI 3.1, Protobuf), API testing (contract testing with Pact, integration testing, fuzz testing), API gateway patterns, rate limiting, idempotency, and API versioning strategies. A bad API is a permanent scar on an organization — it cannot be unshipped.
Install
npx vskill@latest install ardurai/god-skill-suite/god-api-designSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as ardurai/god-skill-suite/god-api-design.
God-Level API Design
A bad API is a permanent scar on an organization. It cannot be unshipped. Every decision you make at design time will be paid for in maintenance costs, client rewrites, and support tickets for years. Design like it matters — because it does.
Researcher-Warrior Mindset
You are not here to make something that "works." You are here to make something that is correct, durable, and comprehensible to every engineer who will ever interact with it. Before you write a single endpoint, you read the spec. You read the RFC. You look at what Stripe, Twilio, and GitHub did and why. Then you make deliberate decisions, not cargo-culted ones.
Anti-hallucination rules for this domain:
- Never invent HTTP status codes. Only use codes defined in RFC 7231, RFC 6585, RFC 4918, and RFC 8470.
- Never invent OAuth 2.0 flows. The four canonical flows are defined in RFC 6749. PKCE is in RFC 7636.
- Never describe JWT validation without listing ALL required checks (algorithm, expiry, issuer, audience, signature).
- When citing a spec (OpenAPI, JSON:API, RFC 7807), cite the actual spec version number.
- If you are unsure whether a behavior is defined or implementation-specific, say so explicitly.
1. Richardson Maturity Model
The Richardson Maturity Model (RMM) describes four levels of REST API maturity. Most APIs call themselves REST but live at Level 1 or Level 2. True REST (Level 3 with HATEOAS) is rarely implemented but worth understanding.
Level 0 — The Swamp of POX (Plain Old XML / JSON)
One URI, one HTTP method (always POST), all operations encoded in the body. This is SOAP. This is XML-RPC. This is wrong.
Problem: no HTTP semantics, no caching, no idempotency, no discoverability.
Level 1 — Resources
Multiple URIs, but still only POST. Resources exist as concepts but HTTP verbs carry no meaning.
Better: resources are named. Worse: still ignoring the entire HTTP protocol.
Level 2 — HTTP Verbs + Status Codes (Where most "REST" APIs live)
Correct use of GET/POST/PUT/PATCH/DELETE. Correct status codes. This is the minimum acceptable level for production APIs.
Level 3 — HATEOAS (Hypermedia As The Engine Of Application State)
Responses include links to valid next actions. Clients navigate the API by following links, not by hardcoding URLs. Used by GitHub's v3 API (Link headers for pagination), HAL, and JSON:API.
Real-world verdict: Level 3 is theoretically correct but operationally rare. Most mature APIs (Stripe, Twilio) live at Level 2 with excellent documentation. Don't let perfect be the enemy of good — but understand what you are trading away.
2. HTTP Semantics — Correct Method Use
| Method | Safe | Idempotent | Body Allowed | Common Use | |
|---|---|---|---|---|---|
| GET | Yes | Yes | No (technically allowed, discouraged) | Retrieve resource | |
| HEAD | Yes | Yes | No | Check existence/metadata without body | |
| OPTIONS | Yes | Yes | No | CORS preflight, capability discovery | |
| POST | No | No | Yes | Create resource, trigger action | |
| PUT | No | Yes | Yes | Replace resource entirely | |
| PATCH | No | No* | Yes | Partial update | |
| DELETE | No | Yes | No (allowed, discouraged) | Delete resource |
*PATCH idempotency depends on the patch document format. JSON Patch (RFC 6902) operations like add may not be idempotent. JSON Merge Patch (RFC 7396) typically is.
Safe means the request has no intended side effects. Clients and intermediaries (proxies, CDNs) can cache and prefetch safe requests.
Idempotent means calling it N times produces the same result as calling it once. Critical for retry logic. PUT /users/123 with the same body is safe to retry. POST /orders creates a new order each time — use idempotency keys.
Misuse patterns to eliminate:
GET /users/delete/123— never encode actions in GET URLsPOST /users/123/update— PATCH exists for a reasonPOST /getUser— you have GET, use it- Using PUT when you mean PATCH (PUT replaces the entire resource; PATCH modifies fields)
3. HTTP Status Codes — Full Production Reference
2xx Success
| Code | Name | When to Use | |
|---|---|---|---|
| 200 | OK | Successful GET, PATCH, PUT with response body | |
| 201 | Created | Successful POST that created a resource. Include Location header pointing to the new resource. | |
| 202 | Accepted | Request received and will be processed asynchronously. Return a job/task resource URL. | |
| 204 | No Content | Successful DELETE or action with no response body. Do NOT return 200 with empty body. | |
| 206 | Partial Content | Range request fulfilled (file downloads, chunked responses) | |
| 207 | Multi-Status | Batch operation where individual items have different statuses. Body contains per-item status. |
202 pattern (async operations):
207 pattern (batch imports):
3xx Redirection
| Code | Name | When to Use | |
|---|---|---|---|
| 301 | Moved Permanently | Resource has moved. Clients SHOULD update bookmarks. Method MAY change to GET. | |
| 302 | Found | Temporary redirect. Method MAY change to GET. Prefer 307 or 308 for APIs. | |
| 304 | Not Modified | Conditional GET — resource unchanged since If-Modified-Since / If-None-Match. | |
| 307 | Temporary Redirect | Redirect preserving the original HTTP method. Use for API temporary redirects. | |
| 308 | Permanent Redirect | Redirect preserving method, permanently. Use for API moves that preserve POST/PUT semantics. |
4xx Client Errors
| Code | Name | When to Use | |
|---|---|---|---|
| 400 | Bad Request | Malformed request syntax, invalid JSON. Generic catch-all for bad input. | |
| 401 | Unauthorized | Missing or invalid authentication credentials. Include WWW-Authenticate header. | |
| 403 | Forbidden | Authenticated but not authorized. Don't return 404 to hide resource existence unless privacy requires it. | |
| 404 | Not Found | Resource does not exist. Also used to hide forbidden resources when privacy is required. | |
| 405 | Method Not Allowed | HTTP method not supported on this endpoint. Include Allow header with supported methods. | |
| 409 | Conflict | State conflict — optimistic locking failure, duplicate resource creation, constraint violation. | |
| 410 | Gone | Resource existed but is permanently deleted. Use over 404 when the deletion is intentional and permanent. | |
| 415 | Unsupported Media Type | Client sent Content-Type the server can't process. | |
| 422 | Unprocessable Entity | Request is well-formed but semantically invalid (validation errors, business rule violations). | |
| 429 | Too Many Requests | Rate limit exceeded. MUST include Retry-After header. |
409 vs 422:
- 409: The request is valid but conflicts with current state ("user with this email already exists")
- 422: The request itself has semantic errors ("email field is not a valid email format")
5xx Server Errors
| Code | Name | When to Use | |
|---|---|---|---|
| 500 | Internal Server Error | Unhandled exception. Never leak stack traces in production. | |
| 502 | Bad Gateway | Upstream service returned invalid response. | |
| 503 | Service Unavailable | Server is overloaded or down for maintenance. Include Retry-After. | |
| 504 | Gateway Timeout | Upstream service timed out. |
503 pattern (maintenance/overload):
4. Error Response Format — RFC 7807 Problem Details
Never invent your own error format. RFC 7807 (Problem Details for HTTP APIs) is the standard. Use it.
Required fields: type (URI identifying the error type), title (human-readable), status (HTTP status code as integer).
Optional but recommended: detail (specific instance detail), instance (URI of the specific occurrence), domain-specific extension members.
The type URI SHOULD be a real URL that resolves to documentation about the error. This forces you to document your errors.
5. REST Resource Design
Naming Rules
- Nouns, not verbs:
/users, not/getUsers - Plural:
/users, not/user - Lowercase with hyphens:
/user-profiles, not/userProfiles - Hierarchy for containment:
/users/123/orders/456 - Avoid deep nesting beyond 2 levels:
/users/123/ordersis fine./users/123/orders/456/items/789/detailsis a design smell — create a flat resource with filtering instead.
Filtering, Sorting, Pagination
Filtering:
Pick a consistent convention and document it. JSON:API's filter[field] is self-documenting.
Sorting:
Pagination — Cursor vs Offset:
Offset pagination (?page=3&per_page=20):
- Simple to implement
- Breaks when records are inserted/deleted during pagination (items skip or duplicate)
- O(N) database query cost as page number increases (OFFSET 10000 scans 10000 rows)
- Never use for large, frequently-changing datasets
Cursor pagination (?after=eyJpZCI6MTIzfQ==):
- Cursor is an opaque encoded pointer to the last item seen (typically base64-encoded JSON)
- Stable — insertions/deletions don't corrupt the page
- O(1) with proper index — WHERE id > cursor_id LIMIT 20
- No random access (can't jump to page 50) — acceptable for most use cases
- Use cursor pagination for any dataset over ~10,000 rows or any real-time feed
Cursor response pattern:
Partial Response (Field Selection):
Reduces payload size. Important for mobile clients. GraphQL solves this more elegantly — one reason to reach for GraphQL when field-selection is a first-class requirement.
6. API Versioning Strategies
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/god-api-design/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ardurai/god-skill-suite/god-api-design)