Agent skill · software engineering · jeremylongshore
clerk-multi-env-setup
Configure Clerk for multiple environments (dev, staging, production).
Why this skill is useful
Provides specific environment configuration patterns and validation scripts for Clerk that the AI wouldn't reliably generate on its own.
What it needs
Requires npm installed locally. Requires clerk account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Clerk Multi-Environment Setup Overview Configure Clerk across development, staging, and production environments with separate instances, environment-aware configuration, and safe promotion workflows. Prerequisites Clerk account (one instance per environment recommended) CI/CD pipeline (GitHub Actions, Vercel, etc.) Environment variable management in place Instructions Step 1: Create Clerk Instances Create separate Clerk instances in the Dashboard for each environment: Environment Instance Key Prefix Domain ------------- ---------- ------------ -------- Development my-app-dev pktest / sktest localhost:3000 Staging my-app-staging pktest / sktest staging.myapp.com Production my-app-prod pklive / sklive myapp.com Step 2: Environment Configuration Files Step 3: Environment-Aware Configuration Step 4: Startup Validation Call at app startup: Step 5: Webhook Configuration Per Environment Step 6: CI/CD Environment Promotion Output Separate Clerk instances per environment (dev, staging, production) Environment-aware configuration with key validation Startup checks preventing key mismatches Per-environment webhook secrets CI/CD pipeline deploying correct keys per branch Error Handling Error Cause Solution ------- ------- ---------- Key mismatch error pktest with sklive Ensure both keys from same Clerk instance Webhook signature fails Wrong secret for environment Verify CLERKWEBHOOKSECRET matches instance User not found Querying wrong environment Check you are hitting correct Clerk instance OAuth redirect fails Domain not configured Add environment domain in Clerk Dashboard Examples Vercel Preview Environment Setup Resources Clerk Deployment Environments Preview Environment Setup Vercel Environment Variables Next Steps Proceed to clerk-observability for monitoring and logging.
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/clerk-multi-env-setup