Agent skill

Clerk Nuxt Patterns

by geekskai in geekskai/blog

Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR.

MITAuto-check: notes

Install Clerk Nuxt Patterns

skills CLI
$ npx skills add geekskai/blog --skill clerk-nuxt-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install geekskai/blog clerk-nuxt-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clerk-nuxt-patterns .claude/skills/clerk-nuxt-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clerk-nuxt-patterns
GitHub stars
103
Token cost
~791 tokens
SKILL.md length
198 words
Files
9 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR.

  • UseAuth composable
  • SKILL.md covers What Do You Need?, References, Setup and Mental Model, plus 5 more sections
  • Runs TypeScript scripts from its folder; calls npm; needs NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY and NUXT_CLERK_SECRET_KEY
  • ClerkMiddleware Nuxt

What it does

Clerk Nuxt Patterns is an agent skill from geekskai/blog. Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR. Triggers on: Nuxt auth, useAuth composable, clerkMiddleware Nuxt, server API Clerk, Nuxt route protection.

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including reference files (for example `evals/evals.json`, `references/composables.md` and `references/nuxt-middleware.md`).

It works with Nuxt. The repository describes itself as: 🚀 2026 Most Popular FREE Blog Template! Next.js 14, Zero Code - Just Write & Deploy | 2026最火免费博客模板!支持Markdown,一键部署,极致性能!⚡️ ✨ Write in Markdown, get your professional blog in…. The licence is MIT.

When your agent uses it

  • UseAuth composable
  • ClerkMiddleware Nuxt
  • Server API Clerk
  • Nuxt route protection

Example prompts

  • “/clerk-nuxt-patterns”

Requirements

  • Node.js
  • A credential in NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • A credential in NUXT_CLERK_SECRET_KEY
  • Pre-approved tools (allowed-tools): WebFetch

What it can do on your machine

Read from SKILL.md and the folder at commit e5554c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • WebFetch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • clerk.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY
    • NUXT_CLERK_SECRET_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Clerk Nuxt Patterns loads about 791 tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 54 tokens; SKILL.md has 198 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~791
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:39
    `.env`:

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from geekskai/blog at commit e5554c5, republished under its MIT licence (© geekskai). 198 words, ~791 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-nuxt-patterns/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
clerk-nuxt-patterns
description
Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR. Triggers on: Nuxt auth, useAuth composable, clerkMiddleware Nuxt, server API Clerk, Nuxt route protection.
allowed-tools
WebFetch
license
MIT
metadata.author
clerk
metadata.version
1.0.0

Nuxt Patterns

What Do You Need?

TaskReference
Protect routes with middlewarereferences/nuxt-middleware.md
Auth in server API routes (Nitro)references/server-api-routes.md
useAuth / useUser in componentsreferences/composables.md
SSR-safe auth patternsreferences/ssr-auth.md

References

ReferenceDescription
references/nuxt-middleware.mdRoute protection, clerkMiddleware()
references/server-api-routes.mdNitro server route auth
references/composables.mduseAuth, useUser, useClerk
references/ssr-auth.mdSSR hydration, server vs client

Setup

npm install @clerk/nuxt

.env:

NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
NUXT_CLERK_SECRET_KEY=sk_...

nuxt.config.ts:

typescript
export default defineNuxtConfig({
  modules: ['@clerk/nuxt'],
})

This single line auto-configures middleware, plugins, and component auto-imports.

Mental Model

@clerk/nuxt auto-imports all Clerk components and composables — no explicit imports needed in <script setup>.

  • Composables (useAuth, useUser) — client-side reactive, inside <script setup>
  • Server routes (clerkClient) — Nitro server routes, event.context.auth
  • Middleware (clerkMiddleware) — auto-registered, use auth().protect() to lock routes

Minimal Pattern

vue
<!-- pages/dashboard.vue -->
<script setup lang="ts">
definePageMeta({ middleware: 'auth' })
const { userId } = useAuth()
</script>

<template>
  <Show when="signed-in">
    <p>Hello {{ userId }}</p>
  </Show>
</template>

definePageMeta({ middleware: 'auth' }) uses the built-in auth middleware from @clerk/nuxt.

Common Pitfalls

SymptomCauseFix
Composables return undefined on serveruseAuth is client-onlyUse event.context.auth in server routes
Route not protectedMissing middleware: 'auth' metaAdd definePageMeta({ middleware: 'auth' })
clerkClient not availableWrong import pathImport from @clerk/nuxt/server
Hydration mismatchRendering auth state before mountedWrap in <ClientOnly> or check isLoaded
Env vars not picked upWrong prefixNuxt requires NUXT_PUBLIC_ for public, NUXT_ for server

Org-Aware Pattern

vue
<script setup lang="ts">
const { orgId, orgRole } = useAuth()
</script>

<template>
  <div v-if="orgId">
    <p>Org: {{ orgId }}</p>
    <p v-if="orgRole === 'org:admin'">Admin panel</p>
  </div>
  <div v-else>
    <OrganizationSwitcher />
  </div>
</template>

See Also

  • clerk-setup - Initial Clerk install
  • clerk-custom-ui - Custom flows & appearance
  • clerk-orgs - B2B organizations

Docs

Nuxt SDK

© geekskai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in .agents/skills/clerk-nuxt-patterns of geekskai/blog.

  • SKILL.md
  • evals/evals.json
  • references/composables.md
  • references/nuxt-middleware.md
  • references/server-api-routes.md
  • references/ssr-auth.md
  • templates/nuxt-basic-auth/app.vue
  • templates/nuxt-basic-auth/nuxt.config.ts
  • templates/nuxt-basic-auth/package.json

Open the folder on GitHubat commit e5554c5

Compare with similar skills

Clerk Nuxt Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clerk Nuxt Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Nuxt Patterns this skillgeekskai/blog103—~791Automated safety check: NotesMIT
Vercel Optimize Auditvercel-labs/agent-skills32k9 repos~4.3kAutomated safety check: PassNone
GSAP in Vue, Nuxt and Sveltegreensock/gsap-skills16k4 repos~2.6kAutomated safety check: PassMIT
Create Docsvictorgarciaesgi/nuxt-typed-router4132 repos~2.8kAutomated safety check: PassMIT
Formkitformkit/formkit4.8k—~1.7kAutomated safety check: PassMIT
UithingBayBreezy/ui-thing729—~1.3kAutomated safety check: PassCustom licence

Similar skills

  • Vercel Optimize Audit

    vercel-labs/agent-skills

    Official

    Runs a metrics-first audit of a deployed Vercel project, gating investigations on real signals to produce ranked, citation-backed cost and performance recommendations.

    32k GitHub starsUsed in 9 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • GSAP in Vue, Nuxt and Svelte

    greensock/gsap-skills

    Shows how to use GSAP in Vue, Nuxt, Svelte and other lifecycle-based frameworks: create after mount, scope selectors to the component, and revert on unmount.

    16k GitHub starsUsed in 4 repos~2.6k tokens
    Frontend & DesignAuto-check passed
  • Create Docs

    victorgarciaesgi/nuxt-typed-router

    Create complete documentation sites for projects. An agent skill from victorgarciaesgi/nuxt-typed-router.

    413 GitHub starsUsed in 2 repos~2.8k tokens
    Frontend & DesignAuto-check passed
  • Formkit

    formkit/formkit

    A skill your agent uses when working with FormKit forms, validation, schema, or custom inputs in React, Vue, or Nuxt projects.

    4.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Uithing

    BayBreezy/ui-thing

    Manages UI Thing components, prose, blocks, themes, shortcuts, docs, and MCP-driven workflows in Nuxt projects and in the UI Thing source repo.

    729 GitHub stars~1.3k tokensUpdated 5 days ago
    Frontend & DesignAuto-check passed
  • Nuxt UI

    megaarmos/vue-spring-bottom-sheet

    Build UIs with @nuxt/ui v4 — 125+ accessible Vue components with Tailwind CSS theming.

    141 GitHub starsUsed in 1 repo~2.5k tokens
    Frontend & DesignAuto-check passed

More from geekskai/blog

All 20 skills in this repo
  • Clerk Android

    geekskai/blog

    Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns.

    103 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider setup, useAuth/useUser/useClerk hooks, React Router protected routes, custom sign-in flows.

    103 GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.

    103 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.

    103 GitHub starsUsed in 1 repo~875 tokens
    Auto-check: notes
  • Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering.

    103 GitHub stars~822 tokensUpdated yesterday
    Auto-check: notes
  • Clerk Billing

    geekskai/blog

    Clerk Billing for subscription management - render Clerk's PricingTable and in-app checkout drawer, configure subscription plans, seat-limit plans for B2B, feature entitlements with has(), and…

    103 GitHub stars~5.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Clerk Nuxt Patterns

What does Clerk Nuxt Patterns do?

Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR. Clerk Nuxt Patterns is an agent skill from geekskai/blog. Nuxt 3 auth patterns with @clerk/nuxt - middleware, composables, server API routes, SSR.

When should I use Clerk Nuxt Patterns?

Clerk Nuxt Patterns fits situations like: useAuth composable; clerkMiddleware Nuxt; server API Clerk; nuxt route protection.

How do I install Clerk Nuxt Patterns in Claude Code?

Run `npx skills add geekskai/blog --skill clerk-nuxt-patterns -a claude-code`. Or copy the skill folder (.agents/skills/clerk-nuxt-patterns in geekskai/blog) into .claude/skills/clerk-nuxt-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Nuxt Patterns in Codex?

Run `npx skills add geekskai/blog --skill clerk-nuxt-patterns -a codex`. Or copy the skill folder (.agents/skills/clerk-nuxt-patterns in geekskai/blog) into .agents/skills/clerk-nuxt-patterns in your project. Codex loads it when a task matches its description.

Can I use Clerk Nuxt Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add geekskai/blog --skill clerk-nuxt-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clerk-nuxt-patterns, .gemini/skills/clerk-nuxt-patterns, .github/skills/clerk-nuxt-patterns and .opencode/skills/clerk-nuxt-patterns in your project.

What does Clerk Nuxt Patterns need to run?

Going by SKILL.md and its folder, Clerk Nuxt Patterns needs TypeScript for the scripts in its folder, the command-line tools its instructions call (npm) and credentials named NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY and NUXT_CLERK_SECRET_KEY. Our summary lists: Node.js; A credential in NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY; A credential in NUXT_CLERK_SECRET_KEY. Its frontmatter pre-approves these tools: WebFetch.

Does Clerk Nuxt Patterns access the network?

SKILL.md names 1 domain. As links in the text: clerk.com. This is read from the text; nothing was executed.

Is Clerk Nuxt Patterns safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Clerk Nuxt Patterns use?

Clerk Nuxt Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clerk Nuxt Patterns use?

About 791 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Clerk Nuxt Patterns?

Skills that share tags, products or a category with Clerk Nuxt Patterns: Vercel Optimize Audit (vercel-labs/agent-skills, 32k stars), GSAP in Vue, Nuxt and Svelte (greensock/gsap-skills, 16k stars), Create Docs (victorgarciaesgi/nuxt-typed-router, 413 stars) and Formkit (formkit/formkit, 4.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Nuxt Patterns?

geekskai (a GitHub user) maintains it in geekskai/blog, which has 103 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.

Source: geekskai/blog on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.