[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A513WV3FZQ6KXVB81BNN2T":3,"skill-same:01M7A513WV3FZQ6KXVB81BNN2T":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7A513WV3FZQ6KXVB81BNN2T","clerk-setup",null,"Add Clerk authentication to any project by following the official quickstart guides.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"MIT","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-setup\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Add Clerk authentication to any project by following the official quickstart guides.\"\nlicense: \"MIT\"\nmetadata: {\"author\":\"clerk\",\"version\":\"2.5.1\"}\n---\n# Adding Clerk\n\n> **Version**: Check `package.json` for the SDK version — see `clerk` skill for the version table. Core 2 differences are noted inline with `> **Core 2 ONLY (skip if current SDK):**` callouts.\n\nThis skill sets up Clerk for authentication by following the official quickstart documentation. For agents, the `clerk` CLI handles most of this end to end — see the next section.\n\n## Agent-first: Provision via CLI\n\nThe `clerk` CLI replaces most Dashboard clicks. Three scenarios cover almost everything:\n\n### Scenario A — New project, new Clerk app\n\n```bash\nclerk init --framework \u003Cnext|react|vue|nuxt|astro|react-router|tanstack-react-start|expressjs|fastify|expo> -y\n```\n\n`clerk init` installs the SDK, wires the project up, and writes the framework-specific publishable + secret keys to the right env file (e.g. `.env.local` for Next.js, `.env` for Vite-based projects).\n\n**No login required.** On a supported framework, unauthenticated `clerk init` provisions a claimable accountless app and writes temporary development keys to the project's env file — no account, no browser, no flag. Don't run `clerk auth login` first. Authenticated (or with `--app` \u002F `--login`) it creates and links a real app via PLAPI instead.\n\n`--template \u003Cb2b-saas|b2c-saas|native|waitlist>` pre-configures the temporary app. Caveats — a signed-out human in an *existing* project still gets the login flow unless they pass `--accountless`; `--keyless` remains a deprecated compatibility alias. `--template`\u002F`--fresh` error on any run that targets a real app; login only auto-claims what `clerk init` created. See [clerk-cli](..\u002Fclerk-cli\u002Freferences\u002Fauth.md#accountless-operating-without-an-account).\n\n### Scenario B — Existing project, existing Clerk app\n\n```bash\nclerk auth login                      # one-time OAuth (skip if already logged in)\nclerk link                            # autolinks if a CLERK_PUBLISHABLE_KEY is in your .env\nclerk link --app app_xxx              # explicit form, required in agent mode\nclerk env pull                        # writes the framework-detected env vars\n```\n\n### Scenario C — Existing project, new Clerk app\n\n```bash\nclerk auth login\nclerk apps create \"My App\" --json     # returns the new app_id\nclerk link --app app_xxx\nclerk env pull\n```\n\n### Daily ops\n\n```bash\nclerk env pull                        # refresh keys (uses linked profile)\nclerk env pull --instance prod        # production keys\nclerk doctor --json                   # framework integration health check\n```\n\n### Rotate the secret key (replaces Dashboard rotation)\n\nPLAPI exposes secret-key rotation directly. Use raw `clerk api` until the friendly wrapper ships:\n\n```bash\nclerk api --platform POST \u002Fv1\u002Fplatform\u002Fapplications\u002F\u003Capp_id>\u002Frotate_secret_keys \\\n  -d '{\"delay_old_secrets_expiration_hours\": 24, \"reason\": \"scheduled rotation\"}'\n```\n\n`delay_old_secrets_expiration_hours` keeps the old key valid for the grace period so deploys can roll forward without downtime.\n\n### Notes for agents\n\n- Unclaimed accountless apps created by `clerk init` are configurable without an account — see the [accountless command table](..\u002Fclerk-cli\u002Freferences\u002Fauth.md#accountless-operating-without-an-account) for which commands work and which need a claimed app.\n- `clerk link` (no flags) only autolinks when a `CLERK_PUBLISHABLE_KEY` is already in `.env` \u002F `.env.local`. Without it, agent mode errors out: \"Cannot select an application in agent mode.\" When that happens, run `clerk apps list --json`, and ask the user which `app_id` to link rather than guessing.\n- Pass `--json` on `apps list\u002Fcreate`, `users create`, and `doctor` for parseable output.\n- The CLI auto-detects framework env var names (`VITE_CLERK_PUBLISHABLE_KEY` for Vite, `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` for Next.js, etc.) and target file (`.env.development.local` > `.env.local` > `.env`).\n\n## Quick Reference (Dashboard fallback)\n\nIf the CLI isn't an option (sandboxed environments, docs walkthroughs), here's the manual Dashboard path:\n\n| Step | Action |\n|------|--------|\n| 1. Detect framework | Check `package.json` dependencies |\n| 2. Fetch quickstart | Use WebFetch on the appropriate docs URL |\n| 3. Follow instructions | Execute steps; create `proxy.ts` (Next.js \u003C=15: `middleware.ts`) |\n| 4. Get API keys | From [dashboard.clerk.com](https:\u002F\u002Fdashboard.clerk.com\u002F~\u002Fapi-keys) |\n\n> If the project has `components.json` (shadcn\u002Fui), apply the shadcn theme after setup. See `clerk-custom-ui` skill → shadcn Theme.\n\n## Framework Detection\n\nCheck `package.json` to identify the framework:\n\n| Dependency | Framework | Quickstart URL |\n|------------|-----------|----------------|\n| `next` | Next.js | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fnextjs\u002Fgetting-started\u002Fquickstart` |\n| `@remix-run\u002Freact` | Remix (deprecated) | Migrate to React Router v7 — use the React Router quickstart below |\n| `react-router` | React Router (v7+) | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact-router\u002Fgetting-started\u002Fquickstart` |\n| `astro` | Astro | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fastro\u002Fgetting-started\u002Fquickstart` |\n| `nuxt` | Nuxt | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fnuxt\u002Fgetting-started\u002Fquickstart` |\n| `@tanstack\u002Freact-start` | TanStack Start | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Ftanstack-react-start\u002Fgetting-started\u002Fquickstart` |\n| `react` (no framework) | React SPA | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact\u002Fgetting-started\u002Fquickstart` |\n| `vue` | Vue | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fvue\u002Fgetting-started\u002Fquickstart` |\n| `express` | Express | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fexpressjs\u002Fgetting-started\u002Fquickstart` |\n| `fastify` | Fastify | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Ffastify\u002Fgetting-started\u002Fquickstart` |\n| `expo` | Expo | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fexpo\u002Fgetting-started\u002Fquickstart` |\n\nFor other platforms:\n- **Chrome Extension**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fchrome-extension\u002Fgetting-started\u002Fquickstart`\n- **Android**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fandroid\u002Fgetting-started\u002Fquickstart`\n- **iOS**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fios\u002Fgetting-started\u002Fquickstart`\n- **Vanilla JavaScript**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fjs-frontend\u002Fgetting-started\u002Fquickstart`\n\n## Decision Tree\n\n```\nUser Request: \"Add Clerk\" \u002F \"Add authentication\"\n    │\n    ├─ Read package.json\n    │\n    ├─ Existing auth detected?\n    │   ├─ YES → Audit → Migration plan\n    │   └─ NO → Fresh install\n    │\n    ├─ Identify framework → WebFetch quickstart → Follow instructions\n    │   └─ Next.js? → Create proxy.ts (Next.js \u003C=15: middleware.ts)\n    │\n    └─ components.json exists? → YES → Apply shadcn theme (see clerk-custom-ui)\n```\n\n## Setup Process\n\n### 1. Detect the Framework\n\nRead the project's `package.json` and match dependencies to the table above.\n\n### 2. Fetch the Quickstart Guide\n\nUse WebFetch to retrieve the official quickstart for the detected framework:\n\n```\nWebFetch: https:\u002F\u002Fclerk.com\u002Fdocs\u002F{framework}\u002Fgetting-started\u002Fquickstart\nPrompt: \"Extract the complete setup instructions including all code snippets, file paths, and configuration steps.\"\n```\n\n### 3. Follow the Instructions\n\nExecute each step from the quickstart guide:\n- Install the required packages\n- Set up environment variables\n- Add the provider and proxy\u002Fmiddleware\n- Create sign-in\u002Fsign-up routes if needed\n- Test the integration\n\n> **Next.js:** Create `proxy.ts` (Next.js \u003C=15: `middleware.ts`). See the `clerk-nextjs-patterns` skill for middleware strategies.\n\n> **shadcn\u002Fui detected** (`components.json` exists): ALWAYS apply the shadcn theme. See `clerk-custom-ui` skill → shadcn Theme section.\n\n### 4. Get API Keys\n\nTwo paths for development API keys:\n\n**CLI (Automatic)**\n- `clerk init` writes temporary development keys to the project's env file — no Clerk account required\n- When you're ready, run `clerk auth login` and the app is claimed into your Clerk account automatically so you can edit it from the Dashboard\n- Simplest path for new projects\n\n**Manual (Dashboard)**\n- Get keys from [dashboard.clerk.com](https:\u002F\u002Fdashboard.clerk.com\u002F~\u002Fapi-keys)\n- **Publishable Key**: Starts with `pk_test_` or `pk_live_`\n- **Secret Key**: Starts with `sk_test_` or `sk_live_`\n- Set as environment variables: `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY`\n\n## Migrating from Another Auth Provider\n\nIf the project already has authentication, create a migration plan before replacing it.\n\n### Detect Existing Auth\n\nCheck `package.json` for existing auth libraries:\n- `next-auth` \u002F `@auth\u002Fcore` → NextAuth\u002FAuth.js\n- `@supabase\u002Fsupabase-js` → Supabase Auth\n- `firebase` \u002F `firebase-admin` → Firebase Auth\n- `@aws-amplify\u002Fauth` → AWS Cognito\n- `auth0` \u002F `@auth0\u002Fnextjs-auth0` → Auth0\n- `passport` → Passport.js\n- Custom JWT\u002Fsession implementation\n\n### Migration Process\n\n1. **Audit current auth** - Identify all auth touchpoints:\n   - Sign-in\u002Fsign-up pages\n   - Session\u002Ftoken handling\n   - Protected routes and middleware\n   - User data storage (database tables, external IDs)\n   - OAuth providers configured\n\n2. **Create migration plan** - Consider:\n   - **User data export** - Export users and import via Clerk's Backend API\n   - **Password hashes** - Clerk can upgrade hashes to Bcrypt transparently\n   - **External IDs** - Store legacy user IDs as `external_id` in Clerk\n   - **Session handling** - Existing sessions will terminate on switch\n\n3. **Choose migration strategy**:\n   - **Big bang** - Switch all users at once (simpler, requires maintenance window)\n   - **Trickle migration** - Run both systems temporarily (lower risk, higher complexity)\n\n### Migration Reference\n\n- **Migration Overview**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fmigrating\u002Foverview\n\n## SDK Notes\n\n### Package Names\n\n| Package | Install |\n|---------|---------|\n| Next.js | `@clerk\u002Fnextjs` |\n| React | `@clerk\u002Freact` |\n| Expo | `@clerk\u002Fexpo` |\n| React Router | `@clerk\u002Freact-router` |\n| TanStack Start | `@clerk\u002Ftanstack-react-start` |\n\n> **Core 2 ONLY (skip if current SDK):** React and Expo packages have different names: `@clerk\u002Fclerk-react` and `@clerk\u002Fclerk-expo` (with `clerk-` prefix).\n\n### ClerkProvider Placement (Next.js)\n\n`ClerkProvider` must be placed **inside `\u003Cbody>`**, not wrapping `\u003Chtml>`:\n\n```tsx\n\u002F\u002F root layout.tsx\nexport default function RootLayout({ children }) {\n  return (\n    \u003Chtml>\n      \u003Cbody>\n        \u003CClerkProvider>{children}\u003C\u002FClerkProvider>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n```\n\n> **Core 2 ONLY (skip if current SDK):** `ClerkProvider` can wrap `\u003Chtml>` directly.\n\n### Dynamic Rendering (Next.js)\n\nFor dynamic rendering with auth data, use the `dynamic` prop:\n\n```tsx\n\u003CClerkProvider dynamic>{children}\u003C\u002FClerkProvider>\n```\n\n### Node.js Requirement\n\nRequires **Node.js 20.9.0** or higher.\n\n> **Core 2 ONLY (skip if current SDK):** Minimum Node.js 18.17.0.\n\n### Themes Package\n\nThemes are installed from `@clerk\u002Fui`:\n\n```bash\nnpm install @clerk\u002Fui\n```\n\n> **Core 2 ONLY (skip if current SDK):** Themes are from `@clerk\u002Fthemes` instead of `@clerk\u002Fui`.\n\n### shadcn Theme\n\nIf the project uses shadcn\u002Fui (check for `components.json` in the project root), apply the shadcn theme so Clerk components match the app's design system:\n\n```bash\nnpm install @clerk\u002Fui\n```\n\n```tsx\nimport { shadcn } from '@clerk\u002Fui\u002Fthemes'\n\n\u003CClerkProvider appearance={{ theme: shadcn }}>{children}\u003C\u002FClerkProvider>\n```\n\nAlso import the shadcn CSS in your global styles:\n```css\n@import 'tailwindcss';\n@import '@clerk\u002Fui\u002Fthemes\u002Fshadcn.css';\n```\n\n> **Core 2 ONLY (skip if current SDK):** Import from `@clerk\u002Fthemes` and `@clerk\u002Fthemes\u002Fshadcn.css` instead.\n\n## Common Pitfalls\n\n> **Run `clerk doctor` first.** It checks framework integration, env vars, middleware presence, and SDK install status. Fixes a lot of these in one shot.\n\n| Issue | Solution |\n|-------|----------|\n| Missing `await` on `auth()` | In Next.js 15+, `auth()` is async: `const { userId } = await auth()` |\n| Exposing `CLERK_SECRET_KEY` | Never use the secret key in client code; only `NEXT_PUBLIC_*` keys are safe |\n| Missing middleware matcher | Include API routes: `matcher: ['\u002F((?!.*\\\\..*|_next).*)', '\u002F']` |\n| ClerkProvider placement | Must be inside `\u003Cbody>` in root layout (Core 2: could wrap `\u003Chtml>`) |\n| Auth routes not public | Allow `\u002Fsign-in`, `\u002Fsign-up` in middleware config |\n| Landing page requires auth | To keep \"\u002F\" public, exclude it: `matcher: ['\u002F((?!.*\\\\..*|_next|^\u002F$).*)', '\u002Fapi\u002F(.*)']` |\n| Wrong import path | Server code uses `@clerk\u002Fnextjs\u002Fserver`, client uses `@clerk\u002Fnextjs` |\n| Wrong package name | Use `@clerk\u002Freact` not `@clerk\u002Fclerk-react` (Core 2 naming) |\n\n## See Also\n\n- `clerk-custom-ui` - Custom sign-in\u002Fup components\n- `clerk-nextjs-patterns` - Advanced Next.js patterns\n- `clerk-react-patterns` - React SPA patterns\n- `clerk-react-router-patterns` - React Router patterns\n- `clerk-vue-patterns` - Vue patterns\n- `clerk-nuxt-patterns` - Nuxt patterns\n- `clerk-astro-patterns` - Astro patterns\n- `clerk-tanstack-patterns` - TanStack Start patterns\n- `clerk-chrome-extension-patterns` - Chrome Extension patterns\n- `clerk-orgs` - B2B multi-tenant organizations\n- `clerk-webhooks` - Webhook → database sync\n- `clerk-testing` - E2E testing setup\n- `clerk-swift` - Native iOS auth\n- `clerk-android` - Native Android auth\n- `clerk-expo` - Expo \u002F React Native auth\n- `clerk-backend-api` - Backend REST API explorer\n\n## Documentation\n\n- **Quickstart Overview**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fgetting-started\u002Fquickstart\u002Foverview\n- **Migration Guide**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fmigrating\u002Foverview\n- **Full Documentation**: https:\u002F\u002Fclerk.com\u002Fdocs\n","# Adding Clerk\n\n> **Version**: Check `package.json` for the SDK version — see `clerk` skill for the version table. Core 2 differences are noted inline with `> **Core 2 ONLY (skip if current SDK):**` callouts.\n\nThis skill sets up Clerk for authentication by following the official quickstart documentation. For agents, the `clerk` CLI handles most of this end to end — see the next section.\n\n## Agent-first: Provision via CLI\n\nThe `clerk` CLI replaces most Dashboard clicks. Three scenarios cover almost everything:\n\n### Scenario A — New project, new Clerk app\n\n```bash\nclerk init --framework \u003Cnext|react|vue|nuxt|astro|react-router|tanstack-react-start|expressjs|fastify|expo> -y\n```\n\n`clerk init` installs the SDK, wires the project up, and writes the framework-specific publishable + secret keys to the right env file (e.g. `.env.local` for Next.js, `.env` for Vite-based projects).\n\n**No login required.** On a supported framework, unauthenticated `clerk init` provisions a claimable accountless app and writes temporary development keys to the project's env file — no account, no browser, no flag. Don't run `clerk auth login` first. Authenticated (or with `--app` \u002F `--login`) it creates and links a real app via PLAPI instead.\n\n`--template \u003Cb2b-saas|b2c-saas|native|waitlist>` pre-configures the temporary app. Caveats — a signed-out human in an *existing* project still gets the login flow unless they pass `--accountless`; `--keyless` remains a deprecated compatibility alias. `--template`\u002F`--fresh` error on any run that targets a real app; login only auto-claims what `clerk init` created. See [clerk-cli](..\u002Fclerk-cli\u002Freferences\u002Fauth.md#accountless-operating-without-an-account).\n\n### Scenario B — Existing project, existing Clerk app\n\n```bash\nclerk auth login                      # one-time OAuth (skip if already logged in)\nclerk link                            # autolinks if a CLERK_PUBLISHABLE_KEY is in your .env\nclerk link --app app_xxx              # explicit form, required in agent mode\nclerk env pull                        # writes the framework-detected env vars\n```\n\n### Scenario C — Existing project, new Clerk app\n\n```bash\nclerk auth login\nclerk apps create \"My App\" --json     # returns the new app_id\nclerk link --app app_xxx\nclerk env pull\n```\n\n### Daily ops\n\n```bash\nclerk env pull                        # refresh keys (uses linked profile)\nclerk env pull --instance prod        # production keys\nclerk doctor --json                   # framework integration health check\n```\n\n### Rotate the secret key (replaces Dashboard rotation)\n\nPLAPI exposes secret-key rotation directly. Use raw `clerk api` until the friendly wrapper ships:\n\n```bash\nclerk api --platform POST \u002Fv1\u002Fplatform\u002Fapplications\u002F\u003Capp_id>\u002Frotate_secret_keys \\\n  -d '{\"delay_old_secrets_expiration_hours\": 24, \"reason\": \"scheduled rotation\"}'\n```\n\n`delay_old_secrets_expiration_hours` keeps the old key valid for the grace period so deploys can roll forward without downtime.\n\n### Notes for agents\n\n- Unclaimed accountless apps created by `clerk init` are configurable without an account — see the [accountless command table](..\u002Fclerk-cli\u002Freferences\u002Fauth.md#accountless-operating-without-an-account) for which commands work and which need a claimed app.\n- `clerk link` (no flags) only autolinks when a `CLERK_PUBLISHABLE_KEY` is already in `.env` \u002F `.env.local`. Without it, agent mode errors out: \"Cannot select an application in agent mode.\" When that happens, run `clerk apps list --json`, and ask the user which `app_id` to link rather than guessing.\n- Pass `--json` on `apps list\u002Fcreate`, `users create`, and `doctor` for parseable output.\n- The CLI auto-detects framework env var names (`VITE_CLERK_PUBLISHABLE_KEY` for Vite, `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` for Next.js, etc.) and target file (`.env.development.local` > `.env.local` > `.env`).\n\n## Quick Reference (Dashboard fallback)\n\nIf the CLI isn't an option (sandboxed environments, docs walkthroughs), here's the manual Dashboard path:\n\n| Step | Action |\n|------|--------|\n| 1. Detect framework | Check `package.json` dependencies |\n| 2. Fetch quickstart | Use WebFetch on the appropriate docs URL |\n| 3. Follow instructions | Execute steps; create `proxy.ts` (Next.js \u003C=15: `middleware.ts`) |\n| 4. Get API keys | From [dashboard.clerk.com](https:\u002F\u002Fdashboard.clerk.com\u002F~\u002Fapi-keys) |\n\n> If the project has `components.json` (shadcn\u002Fui), apply the shadcn theme after setup. See `clerk-custom-ui` skill → shadcn Theme.\n\n## Framework Detection\n\nCheck `package.json` to identify the framework:\n\n| Dependency | Framework | Quickstart URL |\n|------------|-----------|----------------|\n| `next` | Next.js | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fnextjs\u002Fgetting-started\u002Fquickstart` |\n| `@remix-run\u002Freact` | Remix (deprecated) | Migrate to React Router v7 — use the React Router quickstart below |\n| `react-router` | React Router (v7+) | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact-router\u002Fgetting-started\u002Fquickstart` |\n| `astro` | Astro | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fastro\u002Fgetting-started\u002Fquickstart` |\n| `nuxt` | Nuxt | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fnuxt\u002Fgetting-started\u002Fquickstart` |\n| `@tanstack\u002Freact-start` | TanStack Start | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Ftanstack-react-start\u002Fgetting-started\u002Fquickstart` |\n| `react` (no framework) | React SPA | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact\u002Fgetting-started\u002Fquickstart` |\n| `vue` | Vue | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fvue\u002Fgetting-started\u002Fquickstart` |\n| `express` | Express | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fexpressjs\u002Fgetting-started\u002Fquickstart` |\n| `fastify` | Fastify | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Ffastify\u002Fgetting-started\u002Fquickstart` |\n| `expo` | Expo | `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fexpo\u002Fgetting-started\u002Fquickstart` |\n\nFor other platforms:\n- **Chrome Extension**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fchrome-extension\u002Fgetting-started\u002Fquickstart`\n- **Android**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fandroid\u002Fgetting-started\u002Fquickstart`\n- **iOS**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fios\u002Fgetting-started\u002Fquickstart`\n- **Vanilla JavaScript**: `https:\u002F\u002Fclerk.com\u002Fdocs\u002Fjs-frontend\u002Fgetting-started\u002Fquickstart`\n\n## Decision Tree\n\n```\nUser Request: \"Add Clerk\" \u002F \"Add authentication\"\n    │\n    ├─ Read package.json\n    │\n    ├─ Existing auth detected?\n    │   ├─ YES → Audit → Migration plan\n    │   └─ NO → Fresh install\n    │\n    ├─ Identify framework → WebFetch quickstart → Follow instructions\n    │   └─ Next.js? → Create proxy.ts (Next.js \u003C=15: middleware.ts)\n    │\n    └─ components.json exists? → YES → Apply shadcn theme (see clerk-custom-ui)\n```\n\n## Setup Process\n\n### 1. Detect the Framework\n\nRead the project's `package.json` and match dependencies to the table above.\n\n### 2. Fetch the Quickstart Guide\n\nUse WebFetch to retrieve the official quickstart for the detected framework:\n\n```\nWebFetch: https:\u002F\u002Fclerk.com\u002Fdocs\u002F{framework}\u002Fgetting-started\u002Fquickstart\nPrompt: \"Extract the complete setup instructions including all code snippets, file paths, and configuration steps.\"\n```\n\n### 3. Follow the Instructions\n\nExecute each step from the quickstart guide:\n- Install the required packages\n- Set up environment variables\n- Add the provider and proxy\u002Fmiddleware\n- Create sign-in\u002Fsign-up routes if needed\n- Test the integration\n\n> **Next.js:** Create `proxy.ts` (Next.js \u003C=15: `middleware.ts`). See the `clerk-nextjs-patterns` skill for middleware strategies.\n\n> **shadcn\u002Fui detected** (`components.json` exists): ALWAYS apply the shadcn theme. See `clerk-custom-ui` skill → shadcn Theme section.\n\n### 4. Get API Keys\n\nTwo paths for development API keys:\n\n**CLI (Automatic)**\n- `clerk init` writes temporary development keys to the project's env file — no Clerk account required\n- When you're ready, run `clerk auth login` and the app is claimed into your Clerk account automatically so you can edit it from the Dashboard\n- Simplest path for new projects\n\n**Manual (Dashboard)**\n- Get keys from [dashboard.clerk.com](https:\u002F\u002Fdashboard.clerk.com\u002F~\u002Fapi-keys)\n- **Publishable Key**: Starts with `pk_test_` or `pk_live_`\n- **Secret Key**: Starts with `sk_test_` or `sk_live_`\n- Set as environment variables: `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY`\n\n## Migrating from Another Auth Provider\n\nIf the project already has authentication, create a migration plan before replacing it.\n\n### Detect Existing Auth\n\nCheck `package.json` for existing auth libraries:\n- `next-auth` \u002F `@auth\u002Fcore` → NextAuth\u002FAuth.js\n- `@supabase\u002Fsupabase-js` → Supabase Auth\n- `firebase` \u002F `firebase-admin` → Firebase Auth\n- `@aws-amplify\u002Fauth` → AWS Cognito\n- `auth0` \u002F `@auth0\u002Fnextjs-auth0` → Auth0\n- `passport` → Passport.js\n- Custom JWT\u002Fsession implementation\n\n### Migration Process\n\n1. **Audit current auth** - Identify all auth touchpoints:\n   - Sign-in\u002Fsign-up pages\n   - Session\u002Ftoken handling\n   - Protected routes and middleware\n   - User data storage (database tables, external IDs)\n   - OAuth providers configured\n\n2. **Create migration plan** - Consider:\n   - **User data export** - Export users and import via Clerk's Backend API\n   - **Password hashes** - Clerk can upgrade hashes to Bcrypt transparently\n   - **External IDs** - Store legacy user IDs as `external_id` in Clerk\n   - **Session handling** - Existing sessions will terminate on switch\n\n3. **Choose migration strategy**:\n   - **Big bang** - Switch all users at once (simpler, requires maintenance window)\n   - **Trickle migration** - Run both systems temporarily (lower risk, higher complexity)\n\n### Migration Reference\n\n- **Migration Overview**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fmigrating\u002Foverview\n\n## SDK Notes\n\n### Package Names\n\n| Package | Install |\n|---------|---------|\n| Next.js | `@clerk\u002Fnextjs` |\n| React | `@clerk\u002Freact` |\n| Expo | `@clerk\u002Fexpo` |\n| React Router | `@clerk\u002Freact-router` |\n| TanStack Start | `@clerk\u002Ftanstack-react-start` |\n\n> **Core 2 ONLY (skip if current SDK):** React and Expo packages have different names: `@clerk\u002Fclerk-react` and `@clerk\u002Fclerk-expo` (with `clerk-` prefix).\n\n### ClerkProvider Placement (Next.js)\n\n`ClerkProvider` must be placed **inside `\u003Cbody>`**, not wrapping `\u003Chtml>`:\n\n```tsx\n\u002F\u002F root layout.tsx\nexport default function RootLayout({ children }) {\n  return (\n    \u003Chtml>\n      \u003Cbody>\n        \u003CClerkProvider>{children}\u003C\u002FClerkProvider>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n```\n\n> **Core 2 ONLY (skip if current SDK):** `ClerkProvider` can wrap `\u003Chtml>` directly.\n\n### Dynamic Rendering (Next.js)\n\nFor dynamic rendering with auth data, use the `dynamic` prop:\n\n```tsx\n\u003CClerkProvider dynamic>{children}\u003C\u002FClerkProvider>\n```\n\n### Node.js Requirement\n\nRequires **Node.js 20.9.0** or higher.\n\n> **Core 2 ONLY (skip if current SDK):** Minimum Node.js 18.17.0.\n\n### Themes Package\n\nThemes are installed from `@clerk\u002Fui`:\n\n```bash\nnpm install @clerk\u002Fui\n```\n\n> **Core 2 ONLY (skip if current SDK):** Themes are from `@clerk\u002Fthemes` instead of `@clerk\u002Fui`.\n\n### shadcn Theme\n\nIf the project uses shadcn\u002Fui (check for `components.json` in the project root), apply the shadcn theme so Clerk components match the app's design system:\n\n```bash\nnpm install @clerk\u002Fui\n```\n\n```tsx\nimport { shadcn } from '@clerk\u002Fui\u002Fthemes'\n\n\u003CClerkProvider appearance={{ theme: shadcn }}>{children}\u003C\u002FClerkProvider>\n```\n\nAlso import the shadcn CSS in your global styles:\n```css\n@import 'tailwindcss';\n@import '@clerk\u002Fui\u002Fthemes\u002Fshadcn.css';\n```\n\n> **Core 2 ONLY (skip if current SDK):** Import from `@clerk\u002Fthemes` and `@clerk\u002Fthemes\u002Fshadcn.css` instead.\n\n## Common Pitfalls\n\n> **Run `clerk doctor` first.** It checks framework integration, env vars, middleware presence, and SDK install status. Fixes a lot of these in one shot.\n\n| Issue | Solution |\n|-------|----------|\n| Missing `await` on `auth()` | In Next.js 15+, `auth()` is async: `const { userId } = await auth()` |\n| Exposing `CLERK_SECRET_KEY` | Never use the secret key in client code; only `NEXT_PUBLIC_*` keys are safe |\n| Missing middleware matcher | Include API routes: `matcher: ['\u002F((?!.*\\\\..*|_next).*)', '\u002F']` |\n| ClerkProvider placement | Must be inside `\u003Cbody>` in root layout (Core 2: could wrap `\u003Chtml>`) |\n| Auth routes not public | Allow `\u002Fsign-in`, `\u002Fsign-up` in middleware config |\n| Landing page requires auth | To keep \"\u002F\" public, exclude it: `matcher: ['\u002F((?!.*\\\\..*|_next|^\u002F$).*)', '\u002Fapi\u002F(.*)']` |\n| Wrong import path | Server code uses `@clerk\u002Fnextjs\u002Fserver`, client uses `@clerk\u002Fnextjs` |\n| Wrong package name | Use `@clerk\u002Freact` not `@clerk\u002Fclerk-react` (Core 2 naming) |\n\n## See Also\n\n- `clerk-custom-ui` - Custom sign-in\u002Fup components\n- `clerk-nextjs-patterns` - Advanced Next.js patterns\n- `clerk-react-patterns` - React SPA patterns\n- `clerk-react-router-patterns` - React Router patterns\n- `clerk-vue-patterns` - Vue patterns\n- `clerk-nuxt-patterns` - Nuxt patterns\n- `clerk-astro-patterns` - Astro patterns\n- `clerk-tanstack-patterns` - TanStack Start patterns\n- `clerk-chrome-extension-patterns` - Chrome Extension patterns\n- `clerk-orgs` - B2B multi-tenant organizations\n- `clerk-webhooks` - Webhook → database sync\n- `clerk-testing` - E2E testing setup\n- `clerk-swift` - Native iOS auth\n- `clerk-android` - Native Android auth\n- `clerk-expo` - Expo \u002F React Native auth\n- `clerk-backend-api` - Backend REST API explorer\n\n## Documentation\n\n- **Quickstart Overview**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fgetting-started\u002Fquickstart\u002Foverview\n- **Migration Guide**: https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fmigrating\u002Foverview\n- **Full Documentation**: https:\u002F\u002Fclerk.com\u002Fdocs\n",{"license":15,"metadata":24,"description":7},{"author":25,"version":26},"clerk","2.5.1","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fclerk-setup","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add NeelakshSaxena\u002FVayu --skill clerk-setup",{"tool":40,"command":41},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill clerk-setup",{"tool":43,"command":44},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill clerk-setup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-setup\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"evals\u002Fevals.json","REFERENCE","参考文档",4544,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-setup\u002Fevals\u002Fevals.json",[55,63,70,77,84,91],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]