nextjs-middleware-generator

Installation
SKILL.md

Next.js Middleware Generator

Before generating any output, read config/defaults.md and adapt all patterns, imports, and code examples to the user's configured stack.

Generation Process

  1. Determine middleware requirements (auth, CORS, rate limiting, i18n, redirects)
  2. Generate middleware.ts at the project root
  3. Configure route matchers
  4. Add helper functions as needed

Base Middleware Structure

Create middleware.ts at the project root. Next.js only supports a single middleware file:

import { NextRequest, NextResponse } from 'next/server';
Related skills
Installs
2
GitHub Stars
3
First Seen
Feb 25, 2026