agentskills.codes
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.zip

Installs 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:

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

Search skills

Search the agent skills registry