Api conventions
Skill manikumarkv/devrunway-claude-plugin/skills/api-conventions
Universal REST API design principles — response envelope, route naming, versioning, pagination, status codes. Applies to any backend language or framework. Load when designing or implementing any API endpoint.From its SKILL.md
npx -y skills add manikumarkv/devrunway-claude-plugin --skill api-conventionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.9 KB, as published. Nobody here has run it
Full standards in api-conventions.md. Always-on summary:
Response envelope — always consistent:
- Success:
{ "success": true, "data": <resource>, "meta": { "requestId": "...", "timestamp": "..." } } - Success + pagination: add
"pagination": { "nextCursor": "...", "total": N, "limit": 20, "hasMore": true } - Error:
{ "success": false, "error": { "code": "NOT_FOUND", "message": "...", "details": [...] }, "meta": { ... } }
JS implementation shape (always use this):
// Success
res.json({ success: true, data: result });
// Error
res.json({ success: false, error: { code: 'NOT_FOUND', message: '...' } });
Routes:
- Prefix and version from day one:
/api/v1/ - Plural nouns:
/ordersnot/orderor/getOrders - Nested for ownership:
/users/:userId/orders(max 2 levels deep) - kebab-case path segments:
/order-itemsnot/orderItems
HTTP status codes:
200success ·201created ·204deleted (no body)400invalid input ·401not authenticated ·403not authorised404not found ·409conflict ·422business rule violated ·500unexpected
Pagination: prefer cursor-based (?limit=20&cursor=<id>) over offset — offset is inconsistent under concurrent writes
Never: verb routes (/getOrders), unversioned paths (/api/orders), bare arrays at root, 200 for errors
For implementation helpers (response builder functions, validation middleware, framework-specific wiring), see your backend layer skill.