| name | api-docs |
| description | Workflow for creating comprehensive API documentation. Use when the user needs to document API endpoints. |
Skill: Create API Documentation
Trigger
When the user needs to document API endpoints.
Prerequisites
Steps
Step 1: Inventory Endpoints
Step 2: Document Each Endpoint
For each endpoint:
Step 3: Create OpenAPI Spec
Step 4: Generate Documentation
Step 5: Review
Completion Checklist
If Step Fails
- Step 1 (inventory): Search for route definitions:
**/*.route*.ts, **/routes/**, app.get|post|put|delete
- Step 3 (OpenAPI): Use minimal spec first; add complexity incrementally. Validate with
swagger-cli validate
- Step 4 (generate): Swagger UI needs valid spec; Redoc is more forgiving. Check CORS if hosted separately
Example
Step 2 for POST /api/v1/orders: Method POST, URL /api/v1/orders, Body { customerId, items: [{ productId, quantity }] }, Response 201 { data: { id, status } }, Errors 400 validation, 404 customer not found.