AD

add-api-endpoint

Guides the addition of secure, validated API endpoints in a Next.js App Router project.

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
Intermediate

Key capabilities

  • Create a route file for a new API endpoint
  • Validate input using Zod and strict schemas
  • Verify Supabase authentication server-side
  • Use consistent JSON response formats
  • Update API documentation in `docs/api.md`
  • Add tests for the new endpoint

How it works

The skill creates a new route file, implements input validation with Zod, adds server-side Supabase authentication, and ensures consistent JSON responses. It also updates documentation and adds tests.

Inputs & outputs

You give it
Request to add a new API endpoint with specified name and functionality
You get back
A new Next.js API route file, updated documentation, and new test files

When to use add-api-endpoint

  • Adding new backend API routes
  • Securing API endpoints
  • Updating API documentation

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

When not to use it

  • When not adding a Next.js App Router API route
  • When not needing input validation
  • When not requiring Supabase auth checks

Limitations

  • The skill is specific to Next.js App Router API routes
  • It requires Zod for input validation
  • It requires Supabase for authentication

How it compares

This skill enforces a standardized, secure, and well-documented API route creation process, unlike ad-hoc manual development.

Compared to similar skills

add-api-endpoint side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
add-api-endpoint (this skill)06moNo flagsIntermediate
backend-dev-guidelines101moReviewAdvanced
route-handlers17moReviewIntermediate
backend-dev-guidelines06moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

backend-dev-guidelines

langfuse

Comprehensive backend development guide for Langfuse's Next.js 14/tRPC/Express/TypeScript monorepo. Use when creating tRPC routers, public API endpoints, BullMQ queue processors, services, or working with tRPC procedures, Next.js API routes, Prisma database access, ClickHouse analytics queries, Redis queues, OpenTelemetry instrumentation, Zod v4 validation, env.mjs configuration, tenant isolation patterns, or async patterns. Covers layered architecture (tRPC procedures → services, queue processors → services), dual database system (PostgreSQL + ClickHouse), projectId filtering for multi-tenant isolation, traceException error handling, observability patterns, and testing strategies (Jest for web, vitest for worker).

10100

route-handlers

davepoon

This skill should be used when the user asks to "create an API route", "add an endpoint", "build a REST API", "handle POST requests", "create route handlers", "stream responses", or needs guidance on Next.js API development in the App Router.

14

backend-dev-guidelines

yashvinthan

Comprehensive backend development guide for Langfuse's Next.js 14/tRPC/Express/TypeScript monorepo. Use when creating tRPC routers, public API endpoints, BullMQ queue processors, services, or working with tRPC procedures, Next.js API routes, Prisma database access, ClickHouse analytics queries, Redi

00

hr-portal-skill

hariventures2000-ship-it

Use this skill when developing, testing, debugging, or modifying code inside the HR Portal frontend (apps/hr-portal). It applies to handling HR administration tasks such as employee roster management, contract seeding, leave request approvals, attendance monitoring, payroll calculation, and recruitm

00

payload

payloadcms

Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.

73206

add-setting-env

lobehub

Guide for adding environment variables to configure user settings. Use when implementing server-side environment variables that control default values for user settings. Triggers on env var configuration or setting default value tasks.

469

Search skills

Search the agent skills registry