Skip to main content
skill CX Codex

clerk-nextjs-skills — Claude Code skill for Clerk in Next.js 16

Walks your agent through Clerk auth in Next.js 16 App Router: proxy.ts, env vars, route protection and an MCP server.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gocallum/nextjs16-agent-skills --skill clerk-nextjs-skills -a claude-code
Open on GitHub

What clerk-nextjs-skills does

The skill lays out the install path for Clerk in a Next.js 16 project. It covers adding @clerk/nextjs with pnpm, creating proxy.ts at the root or in /src, filling .env.local with the Clerk keys, and wrapping the app in ClerkProvider inside app/layout.tsx.

A separate section handles the move from Next.js 15. You rename middleware.ts to proxy.ts, keep the code as is, since clerkMiddleware() behaves the same either way. If routes stop being protected, the skill points at the file location and suggests clearing the cache with rm -rf .next && pnpm dev.

There is also a walkthrough for an MCP server built on @vercel/mcp-adapter and @clerk/mcp-tools, with a route at app/[transport]/route.ts. One thing to watch: clerkMiddleware() leaves every route public by default, so you add auth.protect() yourself. You will need a publishable key and a secret key from the Clerk dashboard.

What it helps with

  • set up Clerk auth in a fresh Next.js 16 project
  • rename middleware.ts to proxy.ts without touching the code
  • lock down routes with auth.protect()
  • catch missing Clerk env vars before runtime
  • build an MCP server that verifies Clerk tokens

Example prompts for the agent

  • Set up Clerk auth in my Next.js 16 App Router project
  • Help me migrate middleware.ts to proxy.ts
  • Protect this route with auth.protect() and show the signed-in user

How to install clerk-nextjs-skills

1Skills CLI (Vercel)

npx skills add gocallum/nextjs16-agent-skills --skill clerk-nextjs-skills -a claude-code

2Manually: put the files in place

~/.claude/skills/clerk-nextjs-skills/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/clerk-nextjs-skills/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about clerk-nextjs-skills

How do I install clerk-nextjs-skills in Claude?

Run npx skills add gocallum/nextjs16-agent-skills --skill clerk-nextjs-skills -a claude-code. The skill lands at ~/.claude/skills/clerk-nextjs-skills/SKILL.md.

What does clerk-nextjs-skills do?

It guides your agent through Clerk setup for Next.js 16: dependencies, proxy.ts, environment variables, ClerkProvider in the layout, route protection and an MCP server.

Why are my routes still public after adding Clerk?

clerkMiddleware() does not protect routes by default. You call auth.protect() explicitly, either in a page or in proxy.ts to cover everything.

Similar skills

Everything for Frontend and UI →

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor