clerk-auth
Implement secure authentication with Clerk using expert patterns.
Install
mkdir -p .claude/skills/clerk-auth && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4500" && unzip -o skill.zip -d .claude/skills/clerk-auth && rm skill.zipInstalls to .claude/skills/clerk-auth
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Expert patterns for Clerk auth implementation, middleware, organizations, webhooks, and user sync Use when: adding authentication, clerk auth, user authentication, sign in, sign up.Key capabilities
- →Implement ClerkProvider for auth context
- →Protect routes with middleware
- →Manage user sessions and organizations
- →Access auth state in server components
- →Integrate pre-built sign-in and sign-up forms
How it works
It wraps the application in a provider and uses middleware to intercept requests, validating session tokens against Clerk's backend.
Inputs & outputs
When to use clerk-auth
- →Adding authentication
- →Setting up middleware
- →Managing organizations
- →Syncing user sessions
About this skill
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
- <SignIn />, <SignUp />: Pre-built auth forms
- <UserButton />: 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
| Issue | Severity | Solution |
|---|---|---|
| Issue | critical | See docs |
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
When not to use it
- →For non-Next.js applications not supported by Clerk SDK
- →When custom identity provider logic is strictly required
Prerequisites
Limitations
- →Requires Clerk-specific middleware configuration
- →Dependent on Clerk's external identity service
How it compares
It provides standardized patterns for route protection and session management instead of manual JWT verification.
Compared to similar skills
clerk-auth side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| clerk-auth (this skill) | 2 | 6mo | No flags | Intermediate |
| clerk-sdk-patterns | 2 | 27d | Caution | Intermediate |
| clerk-install-auth | 1 | 27d | Review | Beginner |
| clerk-custom-ui | 0 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by davila7
View all by davila7 →You might also like
clerk-sdk-patterns
jeremylongshore
Common Clerk SDK patterns and best practices. Use when implementing authentication flows, accessing user data, or integrating Clerk SDK methods in your application. Trigger with phrases like "clerk SDK", "clerk patterns", "clerk best practices", "clerk API usage".
clerk-install-auth
jeremylongshore
Install and configure Clerk SDK/CLI authentication. Use when setting up a new Clerk integration, configuring API keys, or initializing Clerk in your project. Trigger with phrases like "install clerk", "setup clerk", "clerk auth", "configure clerk API key", "add clerk to project".
clerk-custom-ui
clerk
Custom authentication flows and component appearance - hooks (useSignIn,
web-to-miniapp
worldcoin
Use this skill when you are asked to adapt an existing web app to work as a World App mini app, or to share code between a web app and a mini app. This skill covers the technical steps of migration, common issues, and debugging tips. There will be some changes required to contracts and frontend code
nextjs-developer
zenobi-us
Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.
landing-page-guide-v2
bear2u
Create distinctive, high-converting landing pages that combine proven conversion elements with exceptional design quality. Build beautiful, memorable landing pages using Next.js 14+ and ShadCN UI that avoid generic AI aesthetics while following the 11 essential elements framework.