Agent skill

Clerk Upgrade Migration

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Manage Clerk SDK version upgrades and handle breaking changes.

MITAuto-check passedDevelopment

Install Clerk Upgrade Migration

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-upgrade-migration -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clerk-upgrade-migration --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/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clerk-upgrade-migration .claude/skills/clerk-upgrade-migration && 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-upgrade-migration
GitHub stars
2.8k
Token cost
~1.6k tokens
SKILL.md length
259 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Manage Clerk SDK version upgrades and handle breaking changes.

  • Works in 7 steps: Check Current Version and Available… → Review Breaking Changes → Upgrade Process → …
  • Upgrading Clerk packages
  • SKILL.md covers Current State, Overview, Prerequisites and Instructions, plus 5 more sections
  • Calls npm, git and npx; reaches clerk.com and github.com

What it does

Clerk Upgrade Migration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Manage Clerk SDK version upgrades and handle breaking changes. Use when upgrading Clerk packages, migrating to new SDK versions, or handling deprecation warnings. Trigger with phrases like "upgrade clerk", "clerk migration", "update clerk SDK", "clerk breaking changes".

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/implementation-guide.md`). Compatibility notes: Designed for Claude Code

It sits in Development, covering Code migrations. It works with Clerk. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Upgrading Clerk packages
  • Migrating to new SDK versions
  • Handling deprecation warnings
  • With phrases like upgrade clerk

Example prompts

  • “upgrade clerk”
  • “clerk migration”
  • “update clerk SDK”
  • “/clerk-upgrade-migration”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Check Current Version and Available Updates
  2. Review Breaking Changes
  3. Upgrade Process
  4. Handle Common Migration Patterns
  5. Update Type Definitions
  6. Test Upgrade
  7. Rollback Plan

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. 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:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Bash(pnpm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • git
    • npx

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • clerk.com
    • github.com

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clerk Upgrade Migration loads about 1.6k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 74 tokens; SKILL.md has 259 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 259 words, ~1,564 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-upgrade-migration/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
clerk-upgrade-migration
description
Manage Clerk SDK version upgrades and handle breaking changes. Use when upgrading Clerk packages, migrating to new SDK versions, or handling deprecation warnings. Trigger with phrases like "upgrade clerk", "clerk migration", "update clerk SDK", "clerk breaking changes".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep
compatibility
Designed for Claude Code
version
1.15.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, clerk, migration

Clerk Upgrade & Migration

Current State

!npm list @clerk/nextjs @clerk/clerk-react @clerk/express 2>/dev/null | grep clerk || echo 'No Clerk packages found'

Overview

Safely upgrade Clerk SDK versions and handle breaking changes. Covers version checking, upgrade procedures, common migration patterns, and rollback planning.

Prerequisites

  • Current Clerk integration working
  • Git repository with clean working state
  • Test environment available for validation

Instructions

Step 1: Check Current Version and Available Updates
bash
# Check installed version
npm list @clerk/nextjs

# Check latest available
npm view @clerk/nextjs version

# Check all Clerk packages and their versions
npm outdated | grep clerk
Step 2: Review Breaking Changes
bash
# View changelog for the target version
npx open-cli https://clerk.com/changelog

# Check GitHub releases for migration notes
npx open-cli https://github.com/clerk/javascript/releases

Key version milestones to watch for:

  • v5 to v6: auth() became async (must await auth())
  • v5 to v6: authMiddleware renamed to clerkMiddleware
  • v5 to v6: Import paths changed to @clerk/nextjs/server
Step 3: Upgrade Process
bash
# Create upgrade branch
git checkout -b chore/upgrade-clerk

# Upgrade all Clerk packages together (they must version-match)
npm install @clerk/nextjs@latest @clerk/themes@latest

# If using other Clerk packages:
# npm install @clerk/clerk-react@latest @clerk/express@latest @clerk/backend@latest

# Verify no version mismatches
npm list | grep clerk
Step 4: Handle Common Migration Patterns

v5 to v6: auth() is now async

typescript
// BEFORE (v5): auth() was synchronous
// const { userId } = auth()

// AFTER (v6): auth() returns a Promise
const { userId } = await auth()

Find all affected files:

bash
# Search for synchronous auth() calls that need await
grep -rn "const.*= auth()" --include="*.ts" --include="*.tsx" | grep -v "await"

v5 to v6: Middleware migration

typescript
// BEFORE (v5):
// import { authMiddleware } from '@clerk/nextjs'
// export default authMiddleware({ publicRoutes: ['/'] })

// AFTER (v6):
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'

const isPublicRoute = createRouteMatcher(['/'])

export default clerkMiddleware(async (auth, req) => {
  if (!isPublicRoute(req)) {
    await auth.protect()
  }
})

v5 to v6: Import path changes

typescript
// BEFORE:
// import { auth, currentUser } from '@clerk/nextjs'

// AFTER:
import { auth, currentUser } from '@clerk/nextjs/server'

Fix import paths across codebase:

bash
# Find files using old import path
grep -rn "from '@clerk/nextjs'" --include="*.ts" --include="*.tsx" | grep -v "node_modules" | grep -v "/server"
Step 5: Update Type Definitions
typescript
// If using custom type extensions, update them
// BEFORE:
// declare module '@clerk/nextjs' { ... }

// AFTER:
declare module '@clerk/nextjs/server' {
  interface AuthObject {
    // Custom session claims type
    sessionClaims?: {
      metadata?: {
        role?: string
      }
    }
  }
}
Step 6: Test Upgrade
bash
# Build to catch type errors
npm run build

# Run tests
npm test

# Start dev server and test manually
npm run dev

# Test critical flows:
# 1. Sign in with email/password
# 2. Sign in with OAuth
# 3. Protected route access
# 4. API route authentication
# 5. Webhook endpoint
# 6. Sign out
Step 7: Rollback Plan
bash
# If upgrade fails, rollback to previous version
git stash  # Save any manual changes

# Install previous version
npm install @clerk/nextjs@5.x.x  # Replace with your previous version

# Or restore from git
git checkout main -- package.json package-lock.json
npm install

# Verify rollback works
npm run build && npm test

Output

  • Clerk SDK upgraded to latest version
  • Breaking changes migrated (async auth, new middleware, import paths)
  • Type definitions updated
  • All tests passing
  • Rollback procedure documented

Error Handling

ErrorCauseSolution
Type errors after upgradeAPI signature changesAdd await to auth(), update imports
authMiddleware is not exportedRenamed in v6Use clerkMiddleware from @clerk/nextjs/server
auth() returns PromiseNow async in v6Add await to all auth() calls
Import not foundPath changedUse @clerk/nextjs/server for server-side imports
Version mismatchClerk packages on different versionsUpdate all @clerk/* packages together

Examples

Automated Migration Script
bash
#!/bin/bash
# scripts/migrate-clerk-v6.sh
set -euo pipefail

echo "=== Clerk v5 to v6 Migration ==="

# 1. Fix auth() calls (add await)
echo "Adding await to auth() calls..."
find . -name "*.ts" -o -name "*.tsx" | xargs grep -l "const.*= auth()" 2>/dev/null | while read file; do
  sed -i 's/const \(.*\) = auth()/const \1 = await auth()/g' "$file"
  echo "  Fixed: $file"
done

# 2. Fix import paths
echo "Updating import paths..."
find . -name "*.ts" -o -name "*.tsx" | xargs grep -l "from '@clerk/nextjs'" 2>/dev/null | while read file; do
  if grep -q "auth\|currentUser\|clerkClient" "$file"; then
    sed -i "s/from '@clerk\/nextjs'/from '@clerk\/nextjs\/server'/g" "$file"
    echo "  Fixed: $file"
  fi
done

echo "Done. Run 'npm run build' to check for remaining issues."

Resources

Next Steps

After upgrade, review clerk-ci-integration for CI/CD updates.

© jeremylongshore, 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 1 other file (references) in skills/.curated/clerk-upgrade-migration of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation-guide.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clerk Upgrade Migration 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 Upgrade Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Upgrade Migration this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.6kAutomated safety check: PassMIT
Major Release Removal WorkflowGoogleCloudPlatform/magic-modules974—~1.3kAutomated safety check: PassCustom licence
Frappe Ops UpgradesImpertio-Studio/Frappe_Claude_Skill_Package189—~3.3kAutomated safety check: NotesMIT
PR Bumpakitaonrails/my-skills216—~2.7kAutomated safety check: PassNone
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Migrate Internal Package into GhostTryGhost/Ghost56k—~3.8kAutomated safety check: PassMIT

Similar skills

  • Major Release Removal Workflow

    GoogleCloudPlatform/magic-modules

    Workflow for executing resource, data source, and field removals on a major release feature branch.

    974 GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Frappe Ops Upgrades

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when upgrading Frappe/ERPNext between major versions (v14 to v15, v15 to v16), troubleshooting failed migrations, or planning rollback.

    189 GitHub stars~3.3k tokensUpdated 24 days ago
    DevelopmentAuto-check: notes
  • PR Bump

    akitaonrails/my-skills

    Merge Dependabot / dependency-bot bump PRs quickly and safely.

    216 GitHub stars~2.7k tokensUpdated 17 days ago
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Clerk Upgrade Migration

What does Clerk Upgrade Migration do?

Manage Clerk SDK version upgrades and handle breaking changes. Clerk Upgrade Migration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Manage Clerk SDK version upgrades and handle breaking changes.

When should I use Clerk Upgrade Migration?

Clerk Upgrade Migration fits situations like: upgrading Clerk packages; migrating to new SDK versions; handling deprecation warnings; with phrases like upgrade clerk.

How do I install Clerk Upgrade Migration in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-upgrade-migration -a claude-code`. Or copy the skill folder (skills/.curated/clerk-upgrade-migration in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clerk-upgrade-migration in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Upgrade Migration in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-upgrade-migration -a codex`. Or copy the skill folder (skills/.curated/clerk-upgrade-migration in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clerk-upgrade-migration in your project. Codex loads it when a task matches its description.

Can I use Clerk Upgrade Migration 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 jeremylongshore/tons-of-skills-marketplace --skill clerk-upgrade-migration -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-upgrade-migration, .gemini/skills/clerk-upgrade-migration, .github/skills/clerk-upgrade-migration and .opencode/skills/clerk-upgrade-migration in your project.

What does Clerk Upgrade Migration need to run?

Going by SKILL.md and its folder, Clerk Upgrade Migration needs the command-line tools its instructions call (npm, git and npx). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clerk Upgrade Migration access the network?

SKILL.md names 2 domains. In commands or code: clerk.com and github.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Clerk Upgrade Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clerk Upgrade Migration use?

Clerk Upgrade Migration 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 Upgrade Migration use?

About 1.6k tokens (SKILL.md is roughly 6.3k 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.1k tokens, read only when the agent opens those files.

What are the alternatives to Clerk Upgrade Migration?

Skills that share tags, products or a category with Clerk Upgrade Migration: Major Release Removal Workflow (GoogleCloudPlatform/magic-modules, 974 stars), Frappe Ops Upgrades (Impertio-Studio/Frappe_Claude_Skill_Package, 189 stars), PR Bump (akitaonrails/my-skills, 216 stars) and Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Upgrade Migration?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.