API generator
Use this when a task asks for a new endpoint under /v1.
Steps
- Read references/route-checklist.md and confirm every box applies.
- Run
scripts/scaffold.tswith the resource name in kebab-case. - Register the router in src/server/routes.ts.
- Write the failing test first, then implement the handler.
Conventions
- Request and response bodies are validated by zod on both ends.
- Errors return
{ error: { code, message } }; never leak a stack trace. - Pagination is cursor based (
?cursor=,?limit=), never offset based.