api

Scaffold authenticated Next.js API routes with standardized templates and error handling.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/mgoodman60/foremanos --skill api-mgoodman60
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api
Source: https://github.com/mgoodman60/foremanos/tree/main/.claude/skills/api
Command: npx skills add https://github.com/mgoodman60/foremanos --skill api-mgoodman60

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a quick, standardized way to scaffold Next.js API routes with authentication and data access patterns, reducing boilerplate and ensuring consistency.

Core Features & Use Cases

  • Authenticated GET routes: Quickly build serverless endpoints secured by NextAuth.
  • Standard route structure: Generate route.ts files at app/api/$ARGUMENTS/route.ts with typical imports and error handling.
  • Reusable patterns: Includes route templates for common patterns like data fetching, error handling, and permission checks.
  • Use Case: When starting a new project, you can generate a ready-to-extend API endpoint for budgets, projects, or users, saving setup time.

Quick Start

Use the api skill to scaffold a new GET route at app/api/projects/budget/route.ts with a ready-to-run handler.

Frequently Asked Questions about api

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 error handling?▼

To scaffold Next.js API routes with authentication, you can generate a standardized route.ts file that includes built-in NextAuth checks, proper imports, and error handling boilerplate at app/api/$ARGUMENTS/route.ts to reduce manual setup.

What is the standard structure for a Next.js route.ts file?▼

The standard structure for a Next.js route.ts file includes predictable file locations under app/api, proper serverless endpoint imports, NextAuth permission checks, and standardized error handling blocks to ensure consistency across projects, budgets, or users endpoints.

Can I use this scaffolding to generate a GET route for budgets or projects?▼

Yes, you can use this scaffolding to generate an authenticated GET route for budgets or projects by creating a ready-to-extend serverless endpoint at app/api/projects/budget/route.ts with standard data fetching and permission check patterns.

Does the generated Next.js API route template include NextAuth security checks?▼

Yes, the generated Next.js API route template includes NextAuth security checks to ensure your serverless endpoints are secured, applying standardized authentication and permission verification before executing data fetching logic.

How do I reduce boilerplate when creating multiple Next.js app router endpoints?▼

You reduce boilerplate when creating multiple Next.js app router endpoints by applying a reusable route.ts template that pre-configures typical imports, error handling, and data access patterns, ensuring predictable file locations across your API structure.

When should I avoid using a standardized API route template in Next.js?▼

You should avoid using a standardized API route template in Next.js if your endpoint requires highly custom data access logic, non-standard authentication flows, or unique error handling that cannot adapt to the predefined NextAuth and route.ts boilerplate structure.