Clerk Auth
Clerk authentication patterns for Next.js App Router, middleware route protection, and server-side user access.
- CCM score
- 53 of 100
- skills.sh installs
- 220
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Next.js 14 and 15 App Router setup with ClerkProvider and environment variable configuration
- Includes pre-built
<SignIn />,<SignUp />, and<UserButton />components for sign-in, sign-up, and session menus - Enforces single-file route protection in
middleware.tsusingcreateRouteMatcherandauth.protect() - Provides
auth()andcurrentUser()for reading session and user data in Server Components
Install
$ npx -y skills add davila7/claude-code-templates --skill clerk-auth -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Clerk Authentication
Patterns
Next.js App Router Setup
Complete Clerk setup for Next.js 14/15 App Router.
Includes ClerkProvider, environment variables, and basic sign-in/sign-up components.
Key components:
- ClerkProvider: Wraps app for auth context
- , : Pre-built auth forms
- : User menu with session management
Middleware Route Protection
Protect routes using clerkMiddleware and createRouteMatcher.
Best practices:
- Single middleware.ts file at project root
- Use createRouteMatcher for route groups
- auth.protect() for explicit protection
- Centralize all auth logic in middleware
Server Component Authentication
Access auth state in Server Components using auth() and currentUser().
Key functions:
- auth(): Returns userId, sessionId, orgId, claims
- currentUser(): Returns full User object
- Both require clerkMiddleware to be configured
⚠️ Sharp Edges
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Backend & APIs, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the clerk-auth skill do?
The clerk-auth skill gives Claude Code expert patterns for Clerk authentication, covering Next.js App Router setup with ClerkProvider and sign-in or sign-up components. It also covers middleware route protection with clerkMiddleware and createRouteMatcher, plus organizations, webhooks, and user sync.
How do I install clerk-auth?
Run npx -y skills add davila7/claude-code-templates --skill clerk-auth -y in your project. Once installed, the agent gets Clerk auth patterns for adding authentication, sign in, and sign up.
Where does clerk-auth stand in the Backend & APIs category?
clerk-auth is listed in the Backend & APIs category on Claude Marketplaces, alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics, and workers-best-practices. It focuses specifically on Clerk, covering server component auth using auth() and currentUser() as well as middleware.
More from davila7/claude-code-templates
All 398- Kaizen220
- Lamindb219
- Nosql Expert219
- Pyopenms219
- Capa Officer218
- Ena Database218
- Cosmic Database217
- Histolab217
- Hypogenic217
- Neuropixels Analysis217
- Pydeseq2217
- Benchling Integration216
- Notion Template Business216
- Pennylane215
- Zinc Database215
- Cirq214
- Esm214
- Geniml214
- Matchms214
- Broken Authentication Testing213
- Linux Privilege Escalation213
- Metasploit Framework213
- SSH Penetration Testing213
- Twilio Communications213
Similar to Clerk Auth
More Backend & APIsnextjs-supabase-authdavila7/claude-code-templates411 installsExpert guidance for Supabase Auth in Next.js App Router, covering server, client, and middleware sessions.
clerk-nextjs-patternsclerk/skills57.4K installsAdvanced Next.js patterns for Clerk auth covering middleware, Server Actions, and user-scoped caching.
nextjs-authenticationgiuseppe-trisciuoglio/developer-kit4.1K installsComplete Auth.js 5 setup for Next.js App Router, covering OAuth, route protection, and role-based access.
auth-patternsdavepoon/buildwithclaude184 installsReference guide for authentication in Next.js covering NextAuth.js (Auth.js) setup, middleware-based route protection, and session handling.
clerk-tanstack-patternsclerk/skills16.8K installsTanStack React Start auth patterns for server functions, route guards, and loaders using Clerk.