PlugWiki

clerk-tanstack-patterns Skill: What It Does and How to Install It

Makes your coding agent add Clerk sign-in to a TanStack React Start app: middleware, server functions and route guards.

Installs
15.8K
on skills.sh
Stars
89
on GitHub
Files
12
besides SKILL.md
Updated
Oct 2026
last repo commit

The SKILL.md tells the agent to use @clerk/tanstack-react-start. It registers CSRF protection before clerkMiddleware() in src/start.ts, wraps the root in ClerkProvider, and checks auth with createServerFn plus auth() and with beforeLoad guards that throw a redirect.

It loads on TanStack auth, createServerFn Clerk and beforeLoad protection questions. You need a Clerk publishable key and secret key.

Good for

  • TanStack Start developers adding Clerk
  • Teams guarding routes with beforeLoad
  • Anyone calling auth() inside createServerFn

Install clerk-tanstack-patterns

Claude Code

  1. 1

    Copy this prompt.

    Install the clerk-tanstack-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. 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

TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vite plugin, server middleware. Triggers on: TanStack auth, createServerFn clerk, beforeLoad protection, TanStack Start middleware.

Sections in SKILL.md

  1. What Do You Need?
  2. References
  3. Setup
  4. Mental Model
  5. Minimal Pattern
  6. Common Pitfalls
  7. See Also
  8. Docs

Key facts

Installs on skills.sh
15,784 (Nov 2, 2026)
Last repo commit
Oct 30, 2026

What it includes

  • Add clerkMiddleware to src/start.ts and ClerkProvider to __root.tsx.

    The SKILL.md shows an npm install, the two env variables, CSRF middleware before clerkMiddleware, and the provider in the root document.

    Try: “Add Clerk to my TanStack Start app”

    Runs code · Start and root setup

  • Protect routes with beforeLoad and a thrown redirect.

    Covers a beforeLoad auth guard, passing auth to the loader, layout route guards and redirect after sign-in. Source: references/router-guards.md.

    Try: “Protect /dashboard with a beforeLoad guard”

    Write · Router guards

  • Check auth() inside createServerFn.

    Covers createServerFn with auth(), the import path, the redirect pattern and organization-scoped functions. Source: references/server-functions.md.

    Write · Server functions

  • Use the auth context in route loaders.

    Covers auth in loaders, organization-aware loaders, useLoaderData and server versus client data. Source: references/loaders.md.

    Write · Loaders

  • Configure the Vite plugin and request middleware.

    Covers the Vite plugin, ClerkProvider in root, environment variables and server routes. Source: references/server-setup.md.

    Write · Server setup

  • Fix auth() errors and missing redirects.

    Lists symptoms such as auth() throwing without the middleware, and return versus throw redirect.

    Read · Pitfalls table

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/tanstack-react-start`, edits `src/start.ts` and `src/routes/__root.tsx`, and puts a publishable key and a secret key in `.env`. Review the diff and keep CLERK_SECRET_KEY out of version control. 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-onlyNo read-only mode.
Talks toWebFetch tool (the frontmatter allows it; the SKILL.md links point at clerk.com/docs)
Sign-in and keysThe SKILL.md shows Clerk keys going into your project's env file.
Scopes
  • Your project files

  • Clerk keys in your env file

Questions

What does clerk-tanstack-patterns do?

It makes your coding agent write Clerk sign-in code for TanStack React Start: request middleware, createServerFn auth checks, beforeLoad guards and loaders.

How do I install clerk-tanstack-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-tanstack-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-tanstack-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 and secret key for the app you are building. The SKILL.md puts them in .env as VITE_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY.

Is clerk-tanstack-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-tanstack-patterns vs clerk-react-patterns?

Use clerk-tanstack-patterns for TanStack React Start. The React skill's SKILL.md covers only Vite or CRA single-page apps and says "For TanStack Start use clerk-tanstack-patterns."

Information

updated Nov 2, 2026

Repository
clerk/skills
Folder
skills/clerk-tanstack-patterns

clerk/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. clerk-tanstack-patterns SKILL.md · github.com
  2. clerk/skills README · github.com
  3. clerk plugin.json · github.com
  4. clerk .mcp.json · github.com

Updated Nov 2, 2026.