Agent skill · Clerk

Clerk Next.js Patterns skill for Claude Code, Codex and Cursor

Clerk patterns for Next.js middleware, Server Actions and caching.

Officialname: clerk-nextjs-patterns★ 89 (repo)pushed 2026-10-23MITSKILL.md on GitHubchecked 2026-11-07

What it does, in the publisher's words

Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.

The description field of the SKILL.md. The agent reads only this at startup and decides from it when to load the full skill.

Install Clerk Next.js Patterns

The skills CLI copies the skill into the folder of each agent you pick (Claude Code, Codex, Cursor, Copilot, Gemini CLI, OpenCode, Windsurf...). Add -g for all projects. Needs Node.js 22.20+. docs

npx skills add clerk/skills --skill clerk-nextjs-patterns

Works with

Claude Code, Claude.ai and Claude Desktop, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Windsurf and other agents that read the open Agent Skills format.

  • The SKILL.md says: "Requires NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY. For manual JWT verification (standalone API servers without Clerk middleware), additionally requires CLERK_JWT_KEY or CLERK_PEM_PUBLIC_KEY."
  • Pre-approves these tools (allowed-tools, experimental in the spec): WebFetch.
  • Bundles 2 TypeScript scripts the agent can run, so it needs TypeScript on the machine. In the Claude apps, code execution must be on.

What's in the SKILL.md

13 sections
  • What Do You Need?
  • References
  • Mental Model
  • Minimal Pattern
  • Conditional Rendering with <Show>
  • Cache Components
  • Common Pitfalls
  • Session Tokens & Custom JWTs
  • getToken() for external APIs
  • useSession() for session data
  • Manual JWT verification (no Clerk middleware)
  • See Also
  • Docs

Bundled files

12
  • evals/evals.json
  • references/api-routes.md
  • references/caching-auth.md
  • references/middleware-strategies.md
  • references/server-actions.md
  • references/server-vs-client.md
  • templates/nextjs-basic-auth/app/layout.tsx
  • templates/nextjs-basic-auth/app/page.tsx
  • templates/nextjs-basic-auth/next.config.ts
  • templates/nextjs-basic-auth/package.json
  • templates/nextjs-basic-auth/proxy.ts
  • templates/nextjs-basic-auth/tsconfig.json

Loaded only when the instructions point to them.

Facts

Skill name
clerk-nextjs-patterns
Publisher
Clerk (official)
Repo
clerk/skills
License
MIT
Version
2.2.0
SKILL.md size
1,084 words, 275 lines
Bundled files
12, 2 scripts (TypeScript), 5 docs
Repo stars
89 (as of 2026-10-24)
SKILL.md checked
2026-11-07

Pairs with the Clerk MCP server: the server gives the agent the tools, the skill teaches it how to use them.

More skills from clerk/skills

  • Clerk Setup: Adds Clerk authentication to a project, or migrates an existing auth system to Clerk.

Related security & auth skills

FAQ

What does the clerk-nextjs-patterns skill do?+

Clerk patterns for Next.js middleware, Server Actions and caching. In its own SKILL.md, Clerk describes it as: "Advanced Next.js patterns - middleware, Server Actions, caching with Clerk."

How do I install the clerk-nextjs-patterns skill?+

Run npx skills add clerk/skills --skill clerk-nextjs-patterns and pick your agents, or use the tab for your agent above. In Claude Code the skill ends up in ~/.claude/skills/clerk-nextjs-patterns/SKILL.md; in Codex and Cursor in .agents/skills/clerk-nextjs-patterns/.

Does Clerk Next.js Patterns work in Codex, Cursor and Copilot, or only Claude?+

It's a standard SKILL.md, so any agent that reads the Agent Skills format can use it: Claude Code, the Claude apps, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Windsurf and more. The SKILL.md notes: Requires NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY. For manual JWT verification (standalone API servers without Clerk middleware), additionally requires CLERK_JWT_KEY or CLERK_PEM_PUBLIC_KEY.

Who maintains Clerk Next.js Patterns?+

Clerk, the company or project behind it, in the clerk/skills repo on GitHub, last pushed 2026-10-23. License: MIT.

Read a skill's SKILL.md and scripts before you install it: skills aren't verified by any agent vendor. Claude skills marketplace · How to install skills · MCP servers