fjrg2007/enigma/clerk-tanstack-patterns
Claude Code and agent skill by fjrg2007/enigma
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
'TanStack React Start auth patterns with @clerk/tanstack-react-start
Install
npx vskill@latest install fjrg2007/enigma/clerk-tanstack-patternsSKILL.md
The same SKILL.md was published earlier as midudev/autoskills/clerk-tanstack-patterns.
TanStack React Start Patterns
What Do You Need?
| Task | Reference | |
|---|---|---|
| Protect routes with beforeLoad | references/router-guards.md | |
| Auth in createServerFn | references/server-functions.md | |
| Pass auth to loaders | references/loaders.md | |
| Configure Vinxi + clerkMiddleware | references/vinxi-server.md |
References
| Reference | Description | |
|---|---|---|
references/router-guards.md | beforeLoad auth redirect | |
references/server-functions.md | createServerFn with auth() | |
references/loaders.md | Auth context in loaders | |
references/vinxi-server.md | clerkMiddleware() setup |
Setup
.env:
src/start.ts (Vinxi entry):
src/routes/__root.tsx — wrap with <ClerkProvider>:
Mental Model
TanStack Start runs on Vinxi. Auth flows through two layers:
- Server layer —
createServerFn+auth()from@clerk/tanstack-react-start/server - Router layer —
beforeLoadon route definitions, throwsredirectfor unauthenticated
Both layers are server-executed. Client hooks (useAuth, useUser) are React hooks for the browser side.
Minimal Pattern
Common Pitfalls
| Symptom | Cause | Fix | |
|---|---|---|---|
auth() returns empty | Missing clerkMiddleware in start.ts | Add to requestMiddleware array | |
redirect not thrown | Using return instead of throw | throw redirect(...) in TanStack | |
Wrong import for auth | Mixing client/server imports | Server: @clerk/tanstack-react-start/server | |
| Loader context missing userId | Not passing from beforeLoad | Return from beforeLoad, access via context | |
ClerkProvider missing | Forgot root wrapping | Add to __root.tsx shell component |
See Also
clerk-setup- Initial Clerk installclerk-custom-ui- Custom flows & appearanceclerk-orgs- B2B organizations
Docs
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingassets/skills-registry/clerk-tanstack-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fjrg2007/enigma/clerk-tanstack-patterns)