CL

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.zip

Installs 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.
181 chars✓ has a “when” trigger
Intermediate

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

You give it
Authentication request or route access
You get back
Authenticated user session or protected route access

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

IssueSeveritySolution
IssuecriticalSee docs
IssuehighSee docs
IssuehighSee docs
IssuehighSee docs
IssuemediumSee docs
IssuemediumSee docs
IssuemediumSee docs
IssuemediumSee 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

Clerk accountClerk SDK installed

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.

SkillInstallsUpdatedSafetyDifficulty
clerk-auth (this skill)26moNo flagsIntermediate
clerk-sdk-patterns227dCautionIntermediate
clerk-install-auth127dReviewBeginner
clerk-custom-ui04moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

software-architecture

davila7

Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.

333868

planning-with-files

davila7

Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls.

233106

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

scroll-experience

davila7

Expert in building immersive scroll-driven experiences - parallax storytelling, scroll animations, interactive narratives, and cinematic web experiences. Like NY Times interactives, Apple product pages, and award-winning web experiences. Makes websites feel like experiences, not just pages. Use when: scroll animation, parallax, scroll storytelling, interactive story, cinematic website.

101142

humanizer

davila7

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases. Credits: Original skill by @blader - https://github.com/blader/humanizer

90175

game-development

davila7

Game development orchestrator. Routes to platform-specific skills based on project needs.

70195

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".

22

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".

12

clerk-custom-ui

clerk

Custom authentication flows and component appearance - hooks (useSignIn,

00

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

00

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.

328531

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.

48105

Search skills

Search the agent skills registry