nextjs-api-route

Installation
SKILL.md

Next.js API Route Skill

Generates route.ts files that follow the project's established pattern: validate → call service → return response → handle error.

Pattern

import { someService, someSchema } from '@/modules/some';
import { handleError } from '@/lib/errors';
import { getUserFromRequest } from '@/lib/auth'; // only if protected

export async function POST(req: Request) {
  try {
    // 1. Auth (if protected)
    const { id: userId } = getUserFromRequest(req);
Installs
1
GitHub Stars
2
First Seen
Sep 28, 2026