clerk-react-patterns Skill: What It Does and How to Install It
Makes your coding agent add Clerk sign-in to a Vite or CRA React app: provider, hooks, protected routes and custom flows.
- Installs
- 20K
- on skills.sh
- Stars
- 89
- on GitHub
- Files
- 11
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
The SKILL.md tells the agent to use @clerk/react in a client-only React app. It sets up ClerkProvider in main.tsx, guards on isLoaded before trusting isSignedIn, builds a protected route with React Router, and fetches a session token with getToken() for API calls.
It loads on Vite Clerk setup, useAuth, protected route and custom sign-in form questions. For Next.js the SKILL.md points to clerk-nextjs-patterns, and for TanStack Start to clerk-tanstack-patterns. You need a Clerk publishable key.
Good for
- React SPA developers adding Clerk
- Teams building custom sign-in forms
- Anyone gating routes behind sign-in with React Router
Install clerk-react-patterns
Claude Code
- 1
Copy this prompt.
Install the clerk-react-patterns skill in Claude Code. Run this command: /plugin marketplace add clerk/skills /plugin install clerk@clerk-skills Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Pick one route. The plugin installs all 20 skills in the Clerk repo (counted from the repo tree) and adds the Clerk MCP server from the repo's .mcp.json, which points at https://mcp.clerk.com/mcp. The skills-only routes install just this skill and no MCP server config. The README says to open /plugin, go to Marketplaces, select clerk-skills and enable auto-update if you want updates.
From the project README. Source.
What's in the skill
When it loads
React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider setup, useAuth/useUser/useClerk hooks, React Router protected routes, custom sign-in flows. Triggers on: Vite Clerk setup, React Router auth, useAuth hook, protected route, custom sign-in form React.
Sections in SKILL.md
- What Do You Need?
- References
- Setup
- Mental Model
- Minimal Pattern
- Protected Route (React Router v6/v7)
- Token for API Calls
- Common Pitfalls
- See Also
- Docs
Key facts
- Installs on skills.sh
- 19,996 (Nov 2, 2026)
- GitHub stars
- 89 for the whole clerk/skills repo (Nov 2, 2026)
- Last repo commit
- Oct 30, 2026
What it includes
Install @clerk/react and wrap the app in ClerkProvider.
The SKILL.md shows an npm install, the Vite env variable and the main.tsx change that adds ClerkProvider.
Try: “Add Clerk to my Vite React app”
Runs code ·
Provider setupUse useAuth, useUser and useClerk with an isLoaded guard.
Always checks isLoaded before isSignedIn. Source: references/hooks.md.
Try: “Show the signed-in user name in this React component”
Write ·
HooksGate React Router routes behind sign-in.
Covers a ProtectedRoute component, router setup, organization-gated routes and prebuilt components. Source: references/protected-routes.md.
Try: “Protect /dashboard and /settings with Clerk”
Write ·
Protected routesBuild sign-in and sign-up forms with useSignIn and useSignUp.
Covers custom sign-in, custom sign-up, email verification and signIn.status values. Source: references/custom-flows.md.
Write ·
Custom flowsPlace ClerkProvider correctly and wire redirect URLs.
Covers provider position, redirect URLs, the prebuilt sign-in component and useNavigate with Clerk actions. Source: references/router-integration.md.
Write ·
Router integrationSend the session token in an Authorization header.
Calls getToken() and sends it as a Bearer token with fetch.
Write ·
Token for API calls
From the official docs
Permissions
Low risk
The skill makes an agent change code in your project and add Clerk keys to your env file, so a wrong edit lands in your own app. Review the diff before you commit it and keep the secret key out of git.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits files in your project
The SKILL.md setup runs an npm install of `@clerk/react`, adds a publishable key to `.env` and edits `src/main.tsx`. Review the diff before you commit it. github.com
The plugin route also adds the Clerk MCP server
The plugin's .mcp.json registers https://mcp.clerk.com/mcp. Use the skills CLI route if you only want this skill. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only mode. |
|---|---|
| Talks to | WebFetch tool (the frontmatter allows it; the SKILL.md links point at clerk.com/docs) |
| Sign-in and keys | The SKILL.md shows Clerk keys going into your project's env file. |
| Scopes |
|
Questions
What does clerk-react-patterns do?
It makes your coding agent write Clerk sign-in code for a client-side React app: ClerkProvider, the auth hooks, protected routes with React Router and custom sign-in forms.
How do I install clerk-react-patterns?
Use the install box above. The Claude Code plugin route installs every Clerk skill and the Clerk MCP server, and the skills CLI route installs only this skill. Pick one route, not both, or you get the skills twice.
Is clerk-react-patterns official?
Yes. It is published in Clerk's own clerk/skills repository, and the plugin.json in that repo lists Clerk as the author.
Does clerk-react-patterns work in the Claude app or Codex?
Codex, Cursor and GitHub Copilot CLI each have a plugin install in the README. The README does not document uploading Clerk skills to the Claude app, and this skill's job is to change code in a local project, so the install box has no Claude app tab.
Does it need a Clerk account or API key?
You need a Clerk publishable key for the app you are building. The SKILL.md setup reads it from VITE_CLERK_PUBLISHABLE_KEY.
Is clerk-react-patterns safe to install?
Its SKILL.md makes the agent change files in your project and use Clerk keys from your env file, and its frontmatter allows the WebFetch tool. Our advice: read each change before you commit it, and keep the secret key out of git.
clerk-react-patterns vs clerk-react-router-patterns?
Use clerk-react-patterns for a Vite or CRA single-page app. Use clerk-react-router-patterns for React Router v7 or v8 apps with loaders and server rendering, where @clerk/react-router replaces @clerk/react.
Information
updated Nov 2, 2026
- Repository
- clerk/skills
- Folder
skills/clerk-react-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 4Hide
- clerk-react-patterns SKILL.md · github.com
- clerk/skills README · github.com
- clerk plugin.json · github.com
- clerk .mcp.json · github.com