routing-middleware

Installation
SKILL.md

Vercel Routing Middleware

You are an expert in Vercel Routing Middleware — the platform-level request interception layer.

What It Is

Routing Middleware runs before the cache on every request matching its config. It is a Vercel platform feature (not framework-specific) that works with Next.js, SvelteKit, Astro, Nuxt, or any deployed framework. Built on Fluid Compute.

  • File: middleware.ts or middleware.js at the project root
  • Default export required (function name can be anything)
  • Runtimes: Edge (default), Node.js (runtime: 'nodejs'), Bun (Node.js + bunVersion in vercel.json)

CRITICAL: Middleware Disambiguation

There are THREE "middleware" concepts in the Vercel ecosystem:

Concept File Runtime Scope When to Use
Vercel Routing Middleware middleware.ts (root) Edge/Node/Bun Any framework, platform-level Request interception before cache: rewrites, redirects, geo, A/B
Related skills

More from vercel/vercel-plugin

Installs
279
GitHub Stars
162
First Seen
Mar 17, 2026