jeremylongshore/claude-code-plugins-plus-skills
clerk-pack
plugins/saas-packs/clerk-pack/skills/clerk-debug-bundle/SKILL.md
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/clerk-pack/skills/clerk-debug-bundle/SKILL.md -a claude-code --skill clerk-debug-bundleInstallation paths:
.claude/skills/clerk-debug-bundle/# Clerk Debug Bundle
## Overview
Collect all necessary debug information for Clerk troubleshooting and support.
## Prerequisites
- Clerk SDK installed
- Access to application logs
- Browser with developer tools
## Instructions
### Step 1: Environment Debug Script
```typescript
// scripts/clerk-debug.ts
import { clerkClient } from '@clerk/nextjs/server'
async function collectDebugInfo() {
const debug = {
timestamp: new Date().toISOString(),
environment: {
nodeVersion: process.version,
platform: process.platform,
env: process.env.NODE_ENV
},
clerk: {
publishableKey: process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY?.substring(0, 20) + '...',
hasSecretKey: !!process.env.CLERK_SECRET_KEY,
signInUrl: process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,
signUpUrl: process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL
},
packages: {}
}
// Get package versions
try {
const pkg = require('../package.json')
debug.packages = {
'@clerk/nextjs': pkg.dependencies?.['@clerk/nextjs'],
'@clerk/clerk-react': pkg.dependencies?.['@clerk/clerk-react'],
'next': pkg.dependencies?.['next']
}
} catch {}
console.log('=== CLERK DEBUG INFO ===')
console.log(JSON.stringify(debug, null, 2))
return debug
}
collectDebugInfo()
```
### Step 2: Runtime Health Check
```typescript
// app/api/clerk-health/route.ts
import { auth, currentUser, clerkClient } from '@clerk/nextjs/server'
export async function GET() {
const health = {
timestamp: new Date().toISOString(),
status: 'checking',
checks: {} as Record<string, any>
}
// Check 1: Auth function
try {
const authResult = await auth()
health.checks.auth = {
status: 'ok',
hasUserId: !!authResult.userId,
hasSessionId: !!authResult.sessionId
}
} catch (err: any) {
health.checks.auth = { status: 'error', message: err.message }
}
// Check 2: Current user (if authenticated)
try {
const user = await c