add-api-route

Scaffold Next.js API routes with authentication and role-based access control.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/abdoulayesow/restaurant-hub-app-001-2026 --skill add-api-route-abdoulayesow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-api-route
Source: https://github.com/abdoulayesow/restaurant-hub-app-001-2026/tree/main/.claude/skills/add-api-route
Command: npx skills add https://github.com/abdoulayesow/restaurant-hub-app-001-2026 --skill add-api-route-abdoulayesow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffolds Next.js API routes with authentication, restaurant access control, validation, and standardized error handling to reduce boilerplate in multi-tenant apps.

Core Features & Use Cases

  • NextAuth session authentication and Prisma-based access verification
  • Role-based access control (Manager/Editor) for write operations
  • Standardized route templates (GET, POST, etc.) with robust error handling
  • TypeScript typings and structured request validation to ensure safety across routes

Quick Start

Invoke the /api-route [path] [methods] to scaffold a new API route following project conventions.

Frequently Asked Questions about add-api-route

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

FAQPage Schema
How do I scaffold Next.js API routes with authentication and role-based access control?

To scaffold Next.js API routes with authentication, you generate route templates using NextAuth sessions and Prisma to enforce role-based access control for Manager or Editor write operations. This enforces TypeScript usage and structured request validation to ensure multi-tenant data security.

How do I set up multi-tenant restaurant access control in Next.js API routes?

Multi-tenant restaurant access control in Next.js API routes is set up by integrating NextAuth for session authentication and Prisma for data access verification. This combination restricts route access based on user roles like Manager or Editor across different restaurant tenants.

What's the best way to standardize error handling across Next.js API routes?

The best way to standardize error handling across Next.js API routes is to use standardized route templates during scaffolding. These templates apply robust error handling patterns uniformly across GET, POST, and other methods to reduce boilerplate in multi-tenant applications.

Do I need TypeScript to generate Next.js API routes with Prisma and NextAuth?

Yes, TypeScript is required to generate these API routes. The scaffolding process enforces TypeScript typings and structured request validation to ensure type safety and secure data access rules across all generated multi-tenant API routes.

Can I use this scaffolding for multi-tenant apps without role-based access?

This scaffolding is specifically designed for multi-tenant restaurant apps requiring role-based access control. If your application does not need Manager or Editor role distinctions, the enforced access control layers and validation patterns may introduce unnecessary boilerplate.

How do I generate a Next.js API route template for specific HTTP methods?

You generate an API route template for specific HTTP methods by invoking the route scaffolding command with your desired path and methods. This creates standardized GET, POST, or other handlers with robust error handling and validation already configured.