middleware-protection

Installation
SKILL.md

Middleware Protection

Comprehensive route protection and authorization patterns for Clerk middleware in Next.js applications. Provides middleware configuration, route matchers, role-based access control, and authentication boundaries.

Core Concepts

Middleware Architecture

  • Edge Runtime: Clerk middleware runs on Cloudflare Workers/Vercel Edge
  • Request Interception: Middleware executes before route handlers
  • Auth State: Access to authentication state via auth() helper
  • Matcher Patterns: Configure which routes middleware applies to

Route Protection Levels

  1. Public Routes: Accessible without authentication (sign-in, sign-up, landing pages)
  2. Protected Routes: Require authentication (dashboards, user profiles)
  3. Organization Routes: Require organization membership
  4. Role-Based Routes: Require specific roles or permissions
Related skills

More from vanman2024/ai-dev-marketplace

Installs
7
GitHub Stars
10
First Seen
Jan 28, 2026