React Router Development
remix-run/react-router
Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.
React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install geekskai/blog clerk-react-router-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .claude/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.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/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .claude/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install geekskai/blog clerk-react-router-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .agents/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .agents/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install geekskai/blog clerk-react-router-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .cursor/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .cursor/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/geekskai/blog.git --path .agents/skills/clerk-react-router-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install geekskai/blog clerk-react-router-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .gemini/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .gemini/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install geekskai/blog clerk-react-router-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .github/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .github/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add geekskai/blog --skill clerk-react-router-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install geekskai/blog clerk-react-router-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/clerk-react-router-patterns .opencode/skills/clerk-react-router-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "clerk-react-router-patterns" agent skill from https://github.com/geekskai/blog/tree/main/.agents/skills/clerk-react-router-patterns into .opencode/skills/clerk-react-router-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clerk-react-router-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
clerk-react-router-patternsReact Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.
Clerk React Router Patterns is an agent skill from geekskai/blog. React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching. Triggers on: react-router auth, rootAuthLoader, getAuth loader, react-router protected route, loader authentication, SSR auth react-router, useNavigate may be used only in the context of a Router.
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including reference files (for example `evals/evals.json`, `references/loaders-actions.md` and `references/protected-routes.md`).
It works with React Router. The repository describes itself as: 🚀 2026 Most Popular FREE Blog Template! Next.js 14, Zero Code - Just Write & Deploy | 2026最火免费博客模板!支持Markdown,一键部署,极致性能!⚡️ ✨ Write in Markdown, get your professional blog in…. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 347e8ab. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
WebFetchFrom allowed-tools in the SKILL.md frontmatter.
Ships script files (TypeScript), which the agent can run.
Shell commands in SKILL.md call:
npmFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comclerk.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Clerk React Router Patterns loads about 1.8k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 487 words of instructions outside code blocks.
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.
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.
The full file from geekskai/blog at commit 347e8ab, republished under its MIT licence (© geekskai). 487 words, ~1,840 tokens.
.claude/skills/clerk-react-router-patterns/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.SDK: @clerk/react-router v3.5+. Supports React Router v7.9+ and v8.
| Task | Reference |
|---|---|
| Auth in loaders and actions | references/loaders-actions.md |
| Protected routes and redirects | references/protected-routes.md |
| SSR user data and session | references/ssr-auth.md |
Check the installed react-router major version before scaffolding — the config differs:
| v7.9+ | v8+ | |
|---|---|---|
| Middleware API | Opt-in: set future: { v8_middleware: true } in react-router.config.ts | Always on — do NOT set the flag (v8 removed it) |
ssr.noExternal workaround (below) | Not needed | Required |
React Router v8 ships development/production conditional exports. In react-router dev,
Vite externalizes @clerk/react-router for SSR, so Node resolves the production build of
react-router while the app code gets the development build — two module instances, two
Router contexts. Every request then fails during SSR with:
Error: useNavigate() may be used only in the context of a <Router> component.npm ls react-router shows a single copy — that does NOT rule this out. The
duplication is per export condition, not per installed copy. Do not chase duplicate
installs; add the workaround (upstream issue:
https://github.com/remix-run/react-router/issues/15232):
import { reactRouter } from '@react-router/dev/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [reactRouter()],
ssr: {
noExternal: ['@clerk/react-router'],
},
})import { Outlet } from 'react-router'
import { rootAuthLoader, clerkMiddleware } from '@clerk/react-router/server'
import { ClerkProvider } from '@clerk/react-router'
import type { Route } from './+types/root'
export const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]
export async function loader(args: Route.LoaderArgs) {
return rootAuthLoader(args)
}
export default function App({ loaderData }: Route.ComponentProps) {
return (
<ClerkProvider loaderData={loaderData}>
<Outlet />
</ClerkProvider>
)
}There is no ClerkApp HOC in @clerk/react-router (that was the @clerk/remix API).
Render <ClerkProvider loaderData={loaderData}> inside the default export and pass it
the root route's loaderData.
import type { Config } from '@react-router/dev/config'
export default {
future: {
v8_middleware: true,
},
} satisfies ConfigOn v8, omit the future block entirely — the flag no longer exists.
Required:
rootAuthLoadermust be called inroot.tsx's loader. Without it,getAuththrows in nested loaders.
React Router v7/v8 uses a middleware + loader pipeline. Clerk plugs into both layers:
clerkMiddleware()) — runs on every request, attaches auth to contextrootAuthLoader — required in root.tsx to pass Clerk state to the clientgetAuth(args) — called inside any loader/action to get the current userRequest → clerkMiddleware() → rootAuthLoader → page loader → component
↓ ↓ ↓
attaches auth injects state getAuth(args)
to context to response reads contextimport { getAuth } from '@clerk/react-router/server'
import type { Route } from './+types/dashboard'
export async function loader(args: Route.LoaderArgs) {
const { userId } = await getAuth(args)
if (!userId) throw redirect('/sign-in')
const data = await fetchUserData(userId)
return { data }
}import { getAuth } from '@clerk/react-router/server'
export async function action(args: Route.ActionArgs) {
const { userId, orgId } = await getAuth(args)
if (!userId) throw new Response('Unauthorized', { status: 401 })
const formData = await args.request.formData()
await saveData(userId, orgId, formData)
return redirect('/dashboard')
}import { useAuth, useUser } from '@clerk/react-router'
export function Profile() {
const { userId, isSignedIn } = useAuth()
const { user } = useUser()
if (!isSignedIn) return null
return <p>{user?.firstName}</p>
}import { OrganizationSwitcher } from '@clerk/react-router'
export function Nav() {
return <OrganizationSwitcher afterSelectOrganizationUrl="/dashboard" />
}export async function loader(args: Route.LoaderArgs) {
const { userId, orgId } = await getAuth(args)
if (!userId) throw redirect('/sign-in')
if (!orgId) throw redirect('/select-org')
return { data: await fetchOrgData(orgId) }
}| Symptom | Cause | Fix |
|---|---|---|
useNavigate() may be used only in the context of a <Router> thrown from ClerkProvider during SSR in dev (v8) | Vite dev SSR externalizes @clerk/react-router, which then loads react-router's production build while the app uses the development build — two Router contexts. A single copy in npm ls does not rule this out. | Add ssr: { noExternal: ['@clerk/react-router'] } to vite.config.ts. Do NOT downgrade to v7 |
Build error: ClerkApp is not exported | ClerkApp does not exist in @clerk/react-router | Use <ClerkProvider loaderData={loaderData}> in root.tsx's default export |
clerkMiddleware() not detected | Missing middleware (or on v7, missing v8_middleware future flag) | Export middleware = [clerkMiddleware()] from root route; on v7 also set future: { v8_middleware: true } |
| Unknown future flag error/warning (v8) | v8_middleware flag left in react-router.config.ts after upgrading | Remove the future.v8_middleware entry — middleware is always on in v8 |
getAuth returns empty userId | rootAuthLoader not called | Call rootAuthLoader(args) in root.tsx loader |
| Infinite redirect loop | Redirect target is also protected | Exclude /sign-in from protection check |
redirect not working in action | Using Response instead of throw redirect() | Use throw redirect('/path') from react-router |
| What | Import From |
|---|---|
getAuth | @clerk/react-router/server |
rootAuthLoader | @clerk/react-router/server |
clerkMiddleware | @clerk/react-router/server |
ClerkProvider | @clerk/react-router |
useAuth, useUser | @clerk/react-router |
OrganizationSwitcher | @clerk/react-router |
clerk-setup - Initial Clerk installclerk-custom-ui - Custom flows & appearanceclerk-orgs - B2B organizations© geekskai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 11 other files (references) in .agents/skills/clerk-react-router-patterns of geekskai/blog.
Open the folder on GitHubat commit 347e8ab
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in geekskai/blog, which our catalogue first saw on October 7, 2026.
Clerk React Router Patterns 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Clerk React Router Patterns this skillgeekskai/blog | 103 | 1 repos | ~1.8k | Automated safety check: Pass | MIT | |
| React Router Developmentremix-run/react-router | 57k | 1 repos | ~1.5k | Automated safety check: Pass | MIT | |
| React Router Release Notes Prepremix-run/react-router | 57k | — | ~1.1k | Automated safety check: Pass | MIT | |
| React Router Pull Request Creatorremix-run/react-router | 57k | — | ~2.5k | Automated safety check: Pass | MIT | |
| React Router PR Finish Lineremix-run/react-router | 57k | — | ~1.4k | Automated safety check: Pass | MIT | |
| React Router Data Modehalo-dev/upage | 555 | 1 repos | ~927 | Automated safety check: Pass | MIT |
remix-run/react-router
Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.
remix-run/react-router
Polishes pending React Router change files before the versioning scripts run, and decides whether a long-form What's Changed section is warranted.
remix-run/react-router
Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.
remix-run/react-router
Takes a blocked community pull request in React Router and adds the missing tests, change file or docs so it can merge, working on the contributor's branch.
halo-dev/upage
Build React applications using React Router's data mode with createBrowserRouter and RouterProvider.
remix-run/react-router
Fixes a React Router bug reported in a GitHub issue end to end: fetching the issue, validating the reproduction, writing a failing test and implementing the fix on a new branch.
geekskai/blog
Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns.
geekskai/blog
React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider setup, useAuth/useUser/useClerk hooks, React Router protected routes, custom sign-in flows.
geekskai/blog
TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.
geekskai/blog
Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering.
geekskai/blog
Clerk Billing for subscription management - render Clerk's PricingTable and in-app checkout drawer, configure subscription plans, seat-limit plans for B2B, feature entitlements with has(), and…
geekskai/blog
Chrome Extension auth with @clerk/chrome-extension -- popup/sidepanel setup, syncHost for OAuth/SAML via web app, createClerkClient for service workers and headless extensions, stable CRX ID.
Works with
React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching. Clerk React Router Patterns is an agent skill from geekskai/blog. React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.
Clerk React Router Patterns fits situations like: : react-router auth; React-router protected route; loader authentication; SSR auth react-router.
Run `npx skills add geekskai/blog --skill clerk-react-router-patterns -a claude-code`. Or copy the skill folder (.agents/skills/clerk-react-router-patterns in geekskai/blog) into .claude/skills/clerk-react-router-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add geekskai/blog --skill clerk-react-router-patterns -a codex`. Or copy the skill folder (.agents/skills/clerk-react-router-patterns in geekskai/blog) into .agents/skills/clerk-react-router-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add geekskai/blog --skill clerk-react-router-patterns -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-react-router-patterns, .gemini/skills/clerk-react-router-patterns, .github/skills/clerk-react-router-patterns and .opencode/skills/clerk-react-router-patterns in your project.
Going by SKILL.md and its folder, Clerk React Router Patterns needs TypeScript for the scripts in its folder and the command-line tools its instructions call (npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: WebFetch.
SKILL.md names 2 domains. As links in the text: github.com and clerk.com. This is read from the text; nothing was executed.
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.
Clerk React Router Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.4k 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.2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Clerk React Router Patterns: React Router Development (remix-run/react-router, 57k stars), React Router Release Notes Prep (remix-run/react-router, 57k stars), React Router Pull Request Creator (remix-run/react-router, 57k stars) and React Router PR Finish Line (remix-run/react-router, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
geekskai (a GitHub user) maintains it in geekskai/blog, which has 103 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 6, 2026.
Source: geekskai/blog on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.