routing-middleware

Intercept and modify HTTP requests with Vercel middleware before cache.

1|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/Moisesjr20/gueclaw --skill routing-middleware-moisesjr20
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/Moisesjr20/gueclaw/tree/main/.agents/skills/routing-middleware
Command: npx skills add https://github.com/Moisesjr20/gueclaw --skill routing-middleware-moisesjr20

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides authoritative guidance for intercepting and controlling incoming HTTP requests at the platform level so you can implement rewrites, redirects, header injection, geo-personalization and A/B routing before the CDN cache.

Core Features & Use Cases

  • Platform-level interception: Explains Vercel routing middleware semantics and how it runs before the cache for any framework.
  • Multi-runtime support: Covers Edge, Node.js, and Bun runtimes and when to prefer proxy.ts (Next.js 16) versus middleware.ts.
  • Routing controls & safety: Matcher configuration, request limits, project-level routes, migration tips, and patterns for safe auth delegation and background processing.
  • Use Cases: Geo-based rewrites, A/B testing with Edge Config, header injection for proxies, instant project-level route updates without redeploy.

Quick Start

Create a platform-level middleware that rewrites requests by geolocation and injects headers before the cache.

Frequently Asked Questions about routing-middleware

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

FAQPage Schema
How do I intercept and route HTTP requests before the CDN cache on Vercel?

Intercept and route HTTP requests before the CDN cache on Vercel by using platform-level middleware. This mechanism runs before cache generation, enabling you to apply rewrites, redirects, and header injection for incoming traffic across any supported framework.

When should I use proxy.ts instead of middleware.ts for Next.js routing?

Use proxy.ts instead of middleware.ts for Next.js routing when migrating to Next.js 16. The proxy.ts file handles platform-level request interception on Edge, Node.js, and Bun runtimes, serving as the modern standard for pre-cache routing controls.

Can I use Vercel middleware for geo-routing and A/B testing in SvelteKit or Astro?

Yes, you can use Vercel middleware for geo-routing and A/B testing in SvelteKit, Astro, or Nuxt. The middleware runs at the platform level before cache, allowing you to route requests dynamically based on geolocation or Edge Config data.

What are the limitations of using Edge middleware for request interception?

Limitations of using Edge middleware include strict request size and header limits. You should avoid heavy server-side logic, delegating authentication or background processing safely to proxy skills while configuring matchers to restrict execution scope.

How do I configure matchers for project-level route updates without redeploying?

Configure matchers in your middleware file to target specific path patterns for project-level route updates. This restricts the middleware execution scope, allowing instant route updates and header injection without triggering a full application redeployment.

Does Vercel routing middleware support header injection for proxies across different runtimes?

Yes, Vercel routing middleware supports header injection for proxies across Edge, Node.js, and Bun runtimes. You can safely chain the middleware to auth or proxy skills while satisfying runtime selection and request size constraints.