Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

clerk-performance-tuning

Skill by jeremylongshore

Optimizes Clerk authentication performance in Next.js apps. Covers middleware matching, user data caching, token reuse, lazy loading and Edge runtime setup.

  • Score 79
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install clerk-performance-tuning

Built from the published package, never by AI.

git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/clerk-performance-tuning ~/.claude/skills/clerk-performance-tuning

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install clerk-performance-tuning in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The clerk-performance-tuning skill gives Claude Code guidance for making Clerk authentication faster in a Next.js app. It covers six areas: skipping auth on static assets in middleware, caching user data with React cache() and unstable_cache(), reusing tokens until they near expiry, lazy loading Clerk UI components, running dashboard data fetches in parallel with Suspense, and using Edge runtime middleware.

Each step includes TypeScript code examples and a table of common issues with fixes, such as slow page loads and stale cached user data. It also includes a helper that measures how long auth() takes. The skill is intended for developers who already have a working Clerk integration and some performance monitoring in place. It is licensed MIT and points to a follow-up skill, clerk-cost-tuning, for cost optimization.

Written from the project's SKILL.md and checked against it.

What it can do

  • Middleware optimizationRestricts the middleware matcher so static files and images skip auth checks.
  • React cache for user dataDeduplicates the current user fetch within a single request using cache().
  • Cross-request profile cachingCaches a user profile for 5 minutes using unstable_cache().
  • Token reuseReuses a cached token while it has more than 30 seconds left before expiry.
  • Lazy loading auth componentsLoads Clerk UserButton and SignInButton with dynamic imports to reduce bundle size.
  • Parallel dashboard loadingWraps server component data fetches in separate Suspense boundaries.
  • Edge runtime middlewareSets the middleware to run on the Edge runtime for faster cold starts on Vercel.
  • Auth timing helperProvides a function that logs how long auth() takes to run.

What you need

  • Clerk integration already working
  • Next.js with @clerk/nextjs
  • Performance monitoring such as Lighthouse or Web Vitals
  • Vercel for the Edge runtime notes

Try asking

  • Optimize my Clerk middleware so static assets skip auth checks
  • Add caching to my Clerk user profile lookups
  • Lazy load the Clerk UserButton in my Next.js app

Good to know

  • Edge runtime cold start figures are given for Vercel only.
  • Cached user data can go stale unless invalidated on the user.updated webhook.
  • The skill assumes an existing Clerk integration and does not set one up.

Security check

B
  • Allowed to use Write, Edit without limitsIn SKILL.md

Checked automatically: skills/.curated/clerk-performance-tuning/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadWriteEditGrep

  • SKILL.md7 KB
  • references/implementation-guide.md7 KB

Alternatives to clerk-performance-tuning

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

clerk-performance-tuning: common questions

What does clerk-performance-tuning optimize?

It targets Clerk auth response times, latency and SDK usage in Next.js, covering middleware, caching, token handling, lazy loading and the Edge runtime.

How does it reduce repeated user lookups?

It uses React cache() to deduplicate the user fetch within one request and unstable_cache() to keep user profiles for 5 minutes across requests.

Where should I go for cost tuning?

The skill says to proceed to clerk-cost-tuning for cost optimization strategies.

How do I install clerk-performance-tuning?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is clerk-performance-tuning free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is clerk-performance-tuning safe to use?

It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.

What are alternatives to clerk-performance-tuning?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

clerk-performance-tuning Install

Add to stack

Loading.