$npx -y skills add omnigentx/jarvis --skill api-designDesign API contracts and schemas. Use when a BA needs to define interfaces between frontend and backend, or between services.
| 1 | # API DESIGN |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | 1. **Identify use cases** from the BRD. |
| 6 | 2. **Pick a pattern**: REST / WebSocket / gRPC. |
| 7 | 3. **Define endpoints**. |
| 8 | 4. **Write schemas** (request/response types). |
| 9 | 5. **Document** error codes and edge cases. |
| 10 | |
| 11 | ## REST API template |
| 12 | |
| 13 | ```markdown |
| 14 | ### [METHOD] /api/v1/resource |
| 15 | |
| 16 | **Description**: what it does |
| 17 | |
| 18 | **Request**: |
| 19 | - Headers: `Authorization: Bearer <token>` |
| 20 | - Body: |
| 21 | ```json |
| 22 | { "field": "type", "description": "..." } |
| 23 | ``` |
| 24 | |
| 25 | **Response 200**: |
| 26 | ```json |
| 27 | { "data": {...}, "message": "success" } |
| 28 | ``` |
| 29 | |
| 30 | **Error codes**: |
| 31 | | Code | Meaning | |
| 32 | |------|---------| |
| 33 | | 400 | Invalid request | |
| 34 | | 401 | Unauthorized | |
| 35 | | 404 | Not found | |
| 36 | ``` |
| 37 | |
| 38 | ## Rules |
| 39 | - Endpoint paths use plural nouns (`/users`, not `/user`). |
| 40 | - Versioning lives in the URL (`/api/v1/`). |
| 41 | - Always use a single, consistent error-response shape. |
| 42 | - Paginate list endpoints (`?page=1&limit=20`). |