tanstack-router
Type-safe routing with TanStack Router v1 for React apps, including file-based routing, loaders, search params validation, auth guards, and TanStack Query integration
Install / Use
npx skills add PatrickJS/awesome-cursorrulesInstalls into whichever agent you are using.
Other
Other agent config
Quality Score
Category
AutomationSupported Platforms
Our assessment of tanstack-router
tanstack-router scores 91/100 on our quality scale, 63rd of 641 Automation skills we index (top 10%).
Its Other is 3.2 KB long, well organised into 9 sections with 7 code examples: a solid amount of guidance for an agent.
With 40,827 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-09-21 found the source still online.
- It is released under the CC0-1.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-23. Automated pattern scan on 2026-09-23. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
tanstack-router compared with similar skills
All 4 of these similar skills score higher than tanstack-router; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| tanstack-router (this skill)by PatrickJS | 91 | 40.8k | 4mo ago | Other |
| Agent-Reachby Panniantong | 100 | 85.1k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 73.6k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 73.2k | today | CLAUDE.md |
| nanobotby HKUDS | 100 | 48.5k | today | MCP Server |
Frequently asked questions
- How do I install tanstack-router?
- Run
npx skills add PatrickJS/awesome-cursorrules. The install tabs above show the steps for each supported agent. - Which AI agents does tanstack-router work with?
- It is written for Cursor, as a Other file. Other agents that read the same format can often use it too.
- Is tanstack-router safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is CC0-1.0-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is tanstack-router still maintained?
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubdescription: "Type-safe routing with TanStack Router v1 for React apps, including file-based routing, loaders, search params validation, auth guards, and TanStack Query integration" globs: ["src/routes/**/*", "src/routeTree.gen.ts", "app.config.ts"] alwaysApply: false
You are an expert in TanStack Router v1, React, TypeScript, and type-safe client-side routing.
Core Principles
- TanStack Router is 100% type-safe — leverage TypeScript generics for params, search params, and loader data
- Prefer file-based routing with
@tanstack/router-vite-pluginfor scalability - Always define routes with
createFileRouteorcreateRootRoute - Route data loading belongs in
loaderfunctions, not in componentuseEffect - Search params are first-class — always define their schema with Zod for type safety
File-Based Route Conventions
src/routes/
__root.tsx ← Root layout
index.tsx ← / route
posts/
index.tsx ← /posts
$postId.tsx ← /posts/:postId (dynamic)
_layout.tsx ← Layout route (no path segment)
_auth/ ← Pathless auth layout group
dashboard.tsx
Route Definition
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params }) => fetchPost(params.postId),
component: PostComponent,
errorComponent: ({ error }) => <ErrorBanner message={error.message} />,
pendingComponent: () => <PostSkeleton />,
})
function PostComponent() {
const post = Route.useLoaderData() // type-safe
const { postId } = Route.useParams() // type-safe
return <div>{post.title}</div>
}
Type-Safe Search Params
- Always define search params with Zod and
validateSearch - Access with
Route.useSearch()— never readwindow.location.searchdirectly
const searchSchema = z.object({
page: z.number().int().min(1).default(1),
q: z.string().optional(),
})
export const Route = createFileRoute('/search')({
validateSearch: searchSchema,
component: SearchPage,
})
Navigation
- Use
<Link>for internal navigation — never<a href> - Always pass typed
paramsandsearch— the compiler will catch mistakes
<Link to="/posts/$postId" params={{ postId: '123' }}>View Post</Link>
Loaders + TanStack Query Integration
export const Route = createFileRoute('/posts')({
loader: ({ context: { queryClient } }) =>
queryClient.ensureQueryData(postsQueryOptions()),
component: PostsPage,
})
Router Context for Dependency Injection
// __root.tsx
interface RouterContext { queryClient: QueryClient; auth: AuthState }
export const Route = createRootRouteWithContext<RouterContext>()({ component: RootLayout })
// main.tsx
const router = createRouter({ routeTree, context: { queryClient, auth } })
Auth Guards
export const Route = createFileRoute('/_auth/dashboard')({
beforeLoad: ({ context }) => {
if (!context.auth.isAuthenticated) throw redirect({ to: '/login' })
},
component: Dashboard,
})
Performance
- Set
defaultPreload: 'intent'on router for automatic prefetching on hover/focus - Use
React.lazyfor route component code splitting - Install
@tanstack/router-devtoolsand render<TanStackRouterDevtools />in development
Related Skills
Agent-Reach
85.1kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
73.6kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.2k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
nanobot
48.5kUltra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
