/kenji:design-apifrom kenji skills
Designs REST and GraphQL APIs with guidance on naming, versioning, error shapes, and auth. Includes pre-design checks against existing docs, schema, and endpoints.
Ships in kenji skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Degree of freedom: MIXED. Resource model, error shape, and REST vs
GraphQL [HIGH freedom]; pre-design docs/schema/grep
[LOW freedom — run exactly].
Design clean, consistent, and developer-friendly APIs.
Survey:
ordershasuser_id; noGET /users/:id/orders; clients useuseQuery. Model: order is a nested user resource, not a/getUserOrdersRPC. Contract:GET /users/:id/orders→{ data, meta }; shared{ error: { code, message, details } }. Check: plural kebab-case; list paginated; 401/404/422 only from the status table.
{ error: { code, message, details } }GET /resourcesdebug-fe-be-integration; product scope still fuzzy → design-prdBefore designing any API:
/api-docs, /docs, /swagger, /openapi.json)naming under docs/ and src/api/)Use Supabase MCP to understand existing data structure:
SELECT column_name, data_type, is_nullable
FROM information_schema.columns WHERE table_name = 'your_table';
Also check enum values (enum_range) and foreign keys (information_schema.table_constraints):
references/examples.md §Pre-design schema probes.
Use Grep to search for similar endpoints already implemented:
Grep: "router.get|router.post" to find existing route patterns
Grep: "useQuery|useMutation" to find existing frontend integrations
Before designing, state:
"Pre-design check:
- Existing API docs reviewed: [YES/NO]
- Database schema verified: [tables/enums checked]
- Similar endpoints found: [list or none]
- Naming conventions confirmed: [YES/NO]"
GET /resources # List
GET /resources/:id # Get one
POST /resources # Create
PUT /resources/:id # Replace
PATCH /resources/:id # Update
DELETE /resources/:id # Delete
| Do | Don't |
|---|---|
/users | /getUsers, /user-list |
/users/:id | /user/:id, /users/get/:id |
/users/:id/orders | /getUserOrders |
| Plural nouns | Verbs, singular |
| kebab-case | camelCase, snake_case |
GET /users # List users
GET /users/123 # Get user 123
GET /users/123/orders # User's orders
GET /users/123/orders/456 # Specific order
POST /users/123/orders # Create order for user
{ "data": { ... } } for one resource; { "data": [...], "meta": { total, page, perPage, totalPages } } for lists.{ "error": { "code", "message", "details" } }; code is machine-readable, details is a per-field list.{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": [
{ "field": "email", "message": "Invalid email format" }
]
}
}
Request, single, and list bodies in full: references/examples.md §Request body through §List response.
| Code | When to Use |
|---|---|
200 OK | GET, PUT, PATCH success |
201 Created | POST created new resource |
204 No Content | DELETE success, no body |
| Code | When to Use |
|---|---|
400 Bad Request | Invalid request body |
401 Unauthorized | Not authenticated |
403 Forbidden | Authenticated but not allowed |
404 Not Found | Resource doesn't exist |
409 Conflict | Resource conflict (duplicate) |
422 Unprocessable | Validation failed |
429 Too Many | Rate limited |
| Code | When to Use |
|---|---|
500 Internal Error | Unexpected server error |
502 Bad Gateway | Upstream service failed |
503 Unavailable | Service temporarily down |
?role=admin&status=active, date bounds as ?createdAfter=2024-01-01.?sort=name; - prefix for descending; comma-separated for multiple (?sort=role,-name).?page=2&perPage=20 by default; ?cursor=abc123 for large or live lists; never an unbounded list.?fields=id,name,email; relations via ?include=orders,profile.Example URLs for each: references/examples.md §Query parameters.
Default: URL path (GET /v1/users, GET /v2/users). Header versioning
(Accept: application/vnd.api+json;version=2) is the alternative:
references/examples.md §Versioning.
Default: Authorization: Bearer <token>. API key via X-API-Key header (or ?apiKey=) is the
alternative for server-to-server callers: references/examples.md §Authentication.
POST /users/bulk with { create: [...], update: [...], delete: [ids] }.POST /users/search with { query, filters, sort } when the criteria outgrow query strings.POST /orders/123/cancel, POST /users/123/verify-email, POST /payments/123/refund.Bodies for bulk and search: references/examples.md §Bulk operations, §Search.
Per endpoint: title, one-line purpose, **Endpoint:**, **Authentication:**, request-body
table (field, type, required, description), response status with a JSON example, and the error
list. Full template: references/examples.md §Documentation template.
What SKILL.md sets; muted values are Claude Code's defaults
highThree short reads, in order
api-design, rest-api, graphql, api-contract, naming-conventions
npx claudepluginhub kensaurus/skills --plugin kenji162 skills in this plugin
/audit-accessibilityWCAG 2.2 AA audit via playwright-cli: axe-core, keyboard, contrast, target size, focus, ARIA. Use when "audit accessibility", "check a11y", "WCAG audit", "check keyboard nav", or "test screen reader".
/audit-agent-speedMeasure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans. Use when "Claude is slow" or "CPU is pinned". App speed → audit-performance.
/audit-analyticsRead-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events. Use when "audit our analytics", "are we tracking the right events", or "funnel instrumentation".
Other plugins' skills for the same job