Skill Instructions
When asked to add a new API endpoint:
- •Create route file:
src/app/api/<name>/route.ts - •Validate input (query/body) with Zod and strict schemas
- •Verify Supabase auth server-side; never accept client user_id
- •Use consistent JSON response:
- •
{ ok: true, data } - •
{ ok: false, error: { code, message } }
- •
- •Add docs: update
docs/api.md - •Add tests (Vitest schema/unit; Playwright if user flow changes)
- •Run:
- •
npm run lint - •
npm run test
- •