Agent skill

Clerk Tanstack Patterns

by geekskai in geekskai/blog

TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.

MITAuto-check: notes

Install Clerk Tanstack Patterns

skills CLI
$ npx skills add geekskai/blog --skill clerk-tanstack-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install geekskai/blog clerk-tanstack-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/geekskai/blog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clerk-tanstack-patterns .claude/skills/clerk-tanstack-patterns && rm -rf skills-src

Use ~/.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/

Facts

Skill name
clerk-tanstack-patterns
GitHub stars
103
Used in
1 other repo
Token cost
~875 tokens
SKILL.md length
182 words
Files
13 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.

  • Works in 2 steps: Server layer — createServerFn + auth()… → Router layer — beforeLoad on route…
  • : TanStack auth
  • SKILL.md covers What Do You Need?, References, Setup and Mental Model, plus 4 more sections
  • Runs TypeScript scripts from its folder; calls npm; needs CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY

What it does

Clerk Tanstack Patterns is an agent skill from geekskai/blog. TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server. Triggers on: TanStack auth, createServerFn clerk, beforeLoad protection, TanStack Start middleware.

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including reference files (for example `evals/evals.json`, `references/loaders.md` and `references/router-guards.md`).

It works with TanStack and React. 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.

When your agent uses it

  • : TanStack auth
  • CreateServerFn clerk
  • BeforeLoad protection
  • TanStack Start middleware

Example prompts

  • “/clerk-tanstack-patterns”

Requirements

  • Node.js
  • A credential in CLERK_PUBLISHABLE_KEY
  • A credential in CLERK_SECRET_KEY
  • Pre-approved tools (allowed-tools): WebFetch

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Server layer — createServerFn + auth() from @clerk/tanstack-react-start/server
  2. Router layer — beforeLoad on route definitions, throws redirect for unauthenticated

What it can do on your machine

Read from SKILL.md and the folder at commit 347e8ab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • WebFetch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • clerk.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CLERK_PUBLISHABLE_KEY
    • CLERK_SECRET_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Clerk Tanstack Patterns loads about 875 tokens when it runs, and up to ~2.9k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 182 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~875
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.9k

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.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:39
    `.env`:

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.

SKILL.md

The full file from geekskai/blog at commit 347e8ab, republished under its MIT licence (© geekskai). 182 words, ~875 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-tanstack-patterns/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
clerk-tanstack-patterns
description
TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server. Triggers on: TanStack auth, createServerFn clerk, beforeLoad protection, TanStack Start middleware.
allowed-tools
WebFetch
license
MIT
metadata.author
clerk
metadata.version
1.0.0

TanStack React Start Patterns

What Do You Need?

TaskReference
Protect routes with beforeLoadreferences/router-guards.md
Auth in createServerFnreferences/server-functions.md
Pass auth to loadersreferences/loaders.md
Configure Vinxi + clerkMiddlewarereferences/vinxi-server.md

References

ReferenceDescription
references/router-guards.mdbeforeLoad auth redirect
references/server-functions.mdcreateServerFn with auth()
references/loaders.mdAuth context in loaders
references/vinxi-server.mdclerkMiddleware() setup

Setup

npm install @clerk/tanstack-react-start

.env:

CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...

src/start.ts (Vinxi entry):

typescript
import { clerkMiddleware } from '@clerk/tanstack-react-start/server'
import { createStart } from '@tanstack/react-start'

export const startInstance = createStart(() => {
  return {
    requestMiddleware: [clerkMiddleware()],
  }
})

src/routes/__root.tsx — wrap with <ClerkProvider>:

tsx
import { ClerkProvider } from '@clerk/tanstack-react-start'

function RootDocument({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <ClerkProvider>
          {children}
        </ClerkProvider>
      </body>
    </html>
  )
}

Mental Model

TanStack Start runs on Vinxi. Auth flows through two layers:

  1. Server layer — createServerFn + auth() from @clerk/tanstack-react-start/server
  2. Router layer — beforeLoad on route definitions, throws redirect for unauthenticated

Both layers are server-executed. Client hooks (useAuth, useUser) are React hooks for the browser side.

Minimal Pattern

typescript
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { auth } from '@clerk/tanstack-react-start/server'

const authStateFn = createServerFn().handler(async () => {
  const { isAuthenticated, userId } = await auth()
  if (!isAuthenticated) {
    throw redirect({ to: '/sign-in' })
  }
  return { userId }
})

export const Route = createFileRoute('/dashboard')({
  beforeLoad: async () => await authStateFn(),
})

Common Pitfalls

SymptomCauseFix
auth() returns emptyMissing clerkMiddleware in start.tsAdd to requestMiddleware array
redirect not thrownUsing return instead of throwthrow redirect(...) in TanStack
Wrong import for authMixing client/server importsServer: @clerk/tanstack-react-start/server
Loader context missing userIdNot passing from beforeLoadReturn from beforeLoad, access via context
ClerkProvider missingForgot root wrappingAdd to __root.tsx shell component

See Also

  • clerk-setup - Initial Clerk install
  • clerk-custom-ui - Custom flows & appearance
  • clerk-orgs - B2B organizations

Docs

TanStack React Start SDK

© geekskai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (references) in .agents/skills/clerk-tanstack-patterns of geekskai/blog.

  • SKILL.md
  • evals/evals.json
  • references/loaders.md
  • references/router-guards.md
  • references/server-functions.md
  • references/vinxi-server.md
  • templates/tanstack-basic-auth/package.json
  • templates/tanstack-basic-auth/src/router.tsx
  • templates/tanstack-basic-auth/src/routes/__root.tsx
  • templates/tanstack-basic-auth/src/routes/index.tsx
  • templates/tanstack-basic-auth/src/start.ts
  • templates/tanstack-basic-auth/tsconfig.json
  • templates/tanstack-basic-auth/vite.config.ts

Open the folder on GitHubat commit 347e8ab

Used in 1 other repository

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.

Compare with similar skills

Clerk Tanstack 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.

Clerk Tanstack Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Tanstack Patterns this skillgeekskai/blog1031 repos~875Automated safety check: NotesMIT
Game Changing FeaturesopenstatusHQ/data-table-filters2.3k3 repos~2.1kAutomated safety check: PassMIT
React Frontend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2.9kAutomated safety check: PassMIT
Wagmi Feature Developmentwevm/wagmi6.8k—~3.8kAutomated safety check: PassMIT
Tanstack Query Best PracticesDeckardGer/tanstack-agent-skills2221 repos~1.2kAutomated safety check: PassMIT
Frontend Code Reviewlangflow-ai/langflow156k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Game Changing Features

    openstatusHQ/data-table-filters

    Find 10x product opportunities and high-leverage improvements.

    2.3k GitHub starsUsed in 3 repos~2.1k tokens
    Product & Project ManagementAuto-check passed
  • React Frontend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

    10k GitHub starsUsed in 2 repos~2.9k tokens
    Frontend & DesignAuto-check passed
  • Walks through adding a Wagmi feature across its layers: a Viem-based core action, TanStack Query options, and React and Vue bindings.

    6.8k GitHub stars~3.8k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Tanstack Query Best Practices

    DeckardGer/tanstack-agent-skills

    TanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management.

    222 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed
  • Frontend Code Review

    langflow-ai/langflow

    Review frontend code (.tsx, .ts, .js files) for quality, performance, and correctness against Langflow's frontend conventions.

    156k GitHub stars~1.6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Morphous Catalog

    Ameyanagi/morphos

    Create or refresh Morphous website design-system/theme bundles from animal, insect, plant, landscape, mineral, weather, or other nature motifs.

    102 GitHub stars~2.1k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed

More from geekskai/blog

All 20 skills in this repo
  • Clerk Android

    geekskai/blog

    Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns.

    103 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider setup, useAuth/useUser/useClerk hooks, React Router protected routes, custom sign-in flows.

    103 GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching.

    103 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering.

    103 GitHub stars~822 tokensUpdated yesterday
    Auto-check: notes
  • Clerk Billing

    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…

    103 GitHub stars~5.1k tokensUpdated yesterday
    Auto-check passed
  • 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.

    103 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check: notes

Works with

Questions about Clerk Tanstack Patterns

What does Clerk Tanstack Patterns do?

TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server. Clerk Tanstack Patterns is an agent skill from geekskai/blog. TanStack React Start auth patterns with @clerk/tanstack-react-start - createServerFn, beforeLoad guards, loaders, Vinxi server.

When should I use Clerk Tanstack Patterns?

Clerk Tanstack Patterns fits situations like: : TanStack auth; createServerFn clerk; beforeLoad protection; tanStack Start middleware.

How do I install Clerk Tanstack Patterns in Claude Code?

Run `npx skills add geekskai/blog --skill clerk-tanstack-patterns -a claude-code`. Or copy the skill folder (.agents/skills/clerk-tanstack-patterns in geekskai/blog) into .claude/skills/clerk-tanstack-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Tanstack Patterns in Codex?

Run `npx skills add geekskai/blog --skill clerk-tanstack-patterns -a codex`. Or copy the skill folder (.agents/skills/clerk-tanstack-patterns in geekskai/blog) into .agents/skills/clerk-tanstack-patterns in your project. Codex loads it when a task matches its description.

Can I use Clerk Tanstack Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add geekskai/blog --skill clerk-tanstack-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-tanstack-patterns, .gemini/skills/clerk-tanstack-patterns, .github/skills/clerk-tanstack-patterns and .opencode/skills/clerk-tanstack-patterns in your project.

What does Clerk Tanstack Patterns need to run?

Going by SKILL.md and its folder, Clerk Tanstack Patterns needs TypeScript for the scripts in its folder, the command-line tools its instructions call (npm) and credentials named CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY. Our summary lists: Node.js; A credential in CLERK_PUBLISHABLE_KEY; A credential in CLERK_SECRET_KEY. Its frontmatter pre-approves these tools: WebFetch.

Does Clerk Tanstack Patterns access the network?

SKILL.md names 1 domain. As links in the text: clerk.com. This is read from the text; nothing was executed.

Is Clerk Tanstack Patterns safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Clerk Tanstack Patterns use?

Clerk Tanstack Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clerk Tanstack Patterns use?

About 875 tokens (SKILL.md is roughly 3.5k 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 2k tokens, read only when the agent opens those files.

What are the alternatives to Clerk Tanstack Patterns?

Skills that share tags, products or a category with Clerk Tanstack Patterns: Game Changing Features (openstatusHQ/data-table-filters, 2.3k stars), React Frontend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), Wagmi Feature Development (wevm/wagmi, 6.8k stars) and Tanstack Query Best Practices (DeckardGer/tanstack-agent-skills, 222 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Tanstack Patterns?

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.