AD
add-api-endpoint
Add a new Next.js App Router API route with validation, safe errors, Supabase auth checks, docs and tests.
Install
mkdir -p .claude/skills/add-api-endpoint && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14639" && unzip -o skill.zip -d .claude/skills/add-api-endpoint && rm skill.zipInstalls to .claude/skills/add-api-endpoint
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Add a new Next.js App Router API route with validation, safe errors, Supabase auth checks, docs and tests.106 charsno explicit “when” trigger
About this skill
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 lintnpm run test