routing-middleware

Intercept and modify requests before cache using Vercel routing middleware.

2|1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/ByeongminLee/nextjs-claude-code --skill routing-middleware-byeongminlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/ByeongminLee/nextjs-claude-code/tree/main/template/skills-archive/routing-middleware
Command: npx skills add https://github.com/ByeongminLee/nextjs-claude-code --skill routing-middleware-byeongminlee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Routing Middleware runs at the platform level to intercept and modify requests before hit the cache, enabling global routing decisions across frameworks.

Core Features & Use Cases

  • Intercept requests before cache to apply routing logic.
  • Support for multiple runtimes: Edge, Node.js, Bun.
  • Migration guidance between middleware.ts and proxy.ts for Next.js 16.

Quick Start

Configure a root middleware.ts (or proxy.ts) file for your project to begin intercepting requests with a default runtime.

Frequently Asked Questions about routing-middleware

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

FAQPage Schema
How do I intercept requests before cache using Vercel middleware?

You can intercept requests before cache by configuring a root middleware.ts or proxy.ts file, which applies platform-level routing logic to inspect and modify requests globally across frameworks. It supports rewrites, redirects, and personalization.

Does routing middleware work with Edge, Node.js, and Bun runtimes?

Yes, routing middleware supports Edge, Node.js, and Bun runtimes. You must ensure correct runtime selection and careful matcher configuration to guarantee safe and predictable request handling across your chosen environment.

What is the difference between middleware.ts and proxy.ts for Next.js routing?

The middleware.ts and proxy.ts files serve as root configuration points for platform-level request interception. The Skill provides migration guidance between these files specifically for Next.js 16 to maintain predictable routing logic.

How do I configure rewrites and redirects at the platform level?

You configure rewrites and redirects at the platform level by defining routing logic within a root middleware.ts or proxy.ts file. This allows you to apply global routing decisions across frameworks before requests hit the cache.

When should I not use platform-level routing middleware for request handling?

You should avoid platform-level routing middleware without understanding correct file placement, runtime selection, and careful matcher configuration, as improper setup can lead to unpredictable request handling and bypassed cache layers.