design-api
Installation
SKILL.md
Design API
Write consistent API endpoints for a model using existing codebase patterns.
Workflow
- Read the DB model, an existing handler, router pattern, shared middleware.
- Reuse first: response helpers, pagination, validation schemas, auth guards, error classes.
- Define the contract (confirm omitted verbs / nested routes with the user):
GET /resources → list (paginated)
GET /resources/:id → single resource or 404
POST /resources → create, return 201 + created resource
PUT /resources/:id → full replace or 404
PATCH /resources/:id → partial update or 404
DELETE /resources/:id → 204 No Content or 404