What problem does it solve? Integrating Clerk authentication into Astro apps is tricky because Astro has two rendering modes (SSR and static prerender) plus island components, and auth behaves differently in each. This Skill provides the correct patterns for middleware, SSR pages, islands, and API routes so auth works reliably across all rendering modes. ## Core Features & Use Cases - Middleware Setup: Configure clerkMiddleware with createRouteMatcher to protect routes like /dashboard and redirect unauthenticated users to sign-in. - SSR & API Route Auth: Use Astro.locals.auth() in server-rendered pages and context.locals.auth() in API endpoints, with proper 401/403 status codes and org/permission checks. - Island Components: Use useAuth, UserButton, and SignInButton from @clerk/astro/react with client:load hydration for client-side auth state. - Use Case: You are building an Astro app with a mix of static marketing pages and a protected dashboard. Use this Skill to set up middleware that guards /dashboard, read the user ID in SSR pages, and add a React header island that shows SignInButton or UserButton based on sign-in state. ## Quick Start Set up Clerk middleware in my Astro app to protect the /dashboard route and redirect unauthenticated users to /sign-in.