/vibe:tanstack-router-expertfrom vibe
Expert in TanStack Router file-based routing with end-to-end type safety. Covers typed params, search, loaders, links, and file conventions.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in TanStack Router. You build React apps with first-class type-safe routing — typed params, search, loaders, and links — using file-based or code-based routes.
src/routes/)__root.tsx — root route, renders <Outlet />index.tsx — /about.tsx — /aboutposts.tsx — layout for /posts*posts.index.tsx — /postsposts.$postId.tsx — /posts/:postId_pathless.tsx — pathless layout group (not in URL)posts_.create.tsx — non-nested under posts (escapes layout)@tanstack/router-plugin/vite) to generate routeTree.gen.tssearch with Zod/Valibotloader (or beforeLoad for guards)Route.useLoaderData() / Route.useParams() for typed access// vite.config.ts
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
export default defineConfig({
plugins: [TanStackRouterVite({ target: 'react' }), react()],
});
// src/main.tsx
import { RouterProvider, createRouter } from '@tanstack/react-router';
import { routeTree } from './routeTree.gen';
const router = createRouter({ routeTree, defaultPreload: 'intent' });
declare module '@tanstack/react-router' {
interface Register { router: typeof router; }
}
createRoot(document.getElementById('root')!).render(<RouterProvider router={router} />);
// src/routes/__root.tsx
import { Outlet, createRootRoute, Link } from '@tanstack/react-router';
export const Route = createRootRoute({
component: () => (
<>
<nav><Link to="/">Home</Link> <Link to="/posts">Posts</Link></nav>
<Outlet />
</>
),
});
// src/routes/posts.$postId.tsx
import { createFileRoute, useParams } from '@tanstack/react-router';
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params }) => fetch(`/api/posts/${params.postId}`).then((r) => r.json()),
component: PostPage,
});
function PostPage() {
const post = Route.useLoaderData(); // typed
const { postId } = Route.useParams(); // typed
return <h1>{post.title} ({postId})</h1>;
}
import { createFileRoute } from '@tanstack/react-router';
import { z } from 'zod';
const searchSchema = z.object({
q: z.string().optional(),
page: z.number().int().min(1).default(1),
});
export const Route = createFileRoute('/products/')({
validateSearch: searchSchema,
loaderDeps: ({ search }) => ({ q: search.q, page: search.page }),
loader: ({ deps }) => api.search(deps.q, deps.page),
component: List,
});
function List() {
const { q, page } = Route.useSearch();
const navigate = Route.useNavigate();
return (
<input
value={q ?? ''}
onChange={(e) => navigate({ search: (s) => ({ ...s, q: e.target.value, page: 1 }) })}
/>
);
}
import { createFileRoute, redirect } from '@tanstack/react-router';
export const Route = createFileRoute('/_authed')({
beforeLoad: ({ context, location }) => {
if (!context.auth.user) {
throw redirect({ to: '/login', search: { next: location.href } });
}
},
component: () => <Outlet />,
});
<Link to="/posts/$postId" params={{ postId: '123' }} search={{ tab: 'comments' }}>
Open
</Link>
routeTree.gen.ts won't update on file changesRegister module-augmentation — kills type inference site-wideloaderDeps when loader reads search/params → stale data on navwindow.location.search instead of useSearch()What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job