new-endpoint

Scaffold RESTful and Next.js API endpoints with handlers, schemas, queries, tests, and OpenAPI entries.

Updated Apr 17, 2025
One-click install
npx skills add https://github.com/YazanKittaneh/blog.yazan.io --skill new-endpoint-yazankittaneh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-endpoint
Source: https://github.com/YazanKittaneh/blog.yazan.io/tree/main/template/.claude/skills/new-endpoint
Command: npx skills add https://github.com/YazanKittaneh/blog.yazan.io --skill new-endpoint-yazankittaneh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffold and standardize creation of new API endpoints to accelerate development and enforce team conventions, reducing boilerplate and setup errors.

Core Features & Use Cases

  • Automates the creation of route handlers, schemas, queries, tests, and OpenAPI entries to ensure consistent structure across endpoints.
  • Applies to RESTful and Next.js API routes across backend services and monorepos, enabling rapid scaffolding for new resources.
  • Use case: When starting a new resource like "payments" or "users," generate a fully wired endpoint with validation, DB access, tests, and docs in one step.

Quick Start

Run the skill to scaffold a new API endpoint at src/app/api/<resource>/route.ts following team conventions.

Frequently Asked Questions about new-endpoint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new API endpoint in Next.js with validation and tests?

Scaffold a new API endpoint by generating a route handler with Zod schema validation, database queries, tests, and OpenAPI entries in one step. This ensures the endpoint follows project conventions and is wired end-to-end.

What is the best way to standardize RESTful API route creation across a monorepo?

Standardize RESTful API route creation by automating boilerplate generation for route handlers, schemas, queries, and tests. This enforces team conventions across backend services and monorepos, reducing setup errors.

Can I generate OpenAPI documentation automatically when creating a new Next.js API route?

Generate OpenAPI documentation automatically during API endpoint scaffolding. The skill creates the OpenAPI entry alongside the route handler and schema to ensure API docs follow project conventions.

Does this API scaffolding tool work with TypeScript and Zod for request validation?

This API scaffolding tool works with TypeScript and Zod to structure request validation. It generates schemas and route handlers that enforce validation conventions across newly created resources.

How do I set up a new resource endpoint with database queries and testing included?

Set up a new resource endpoint by running the skill to scaffold the route handler, database queries, and tests simultaneously. This generates a fully wired endpoint at src/app/api/<resource>/route.ts.