TanStack Start full-stack React framework. Covers file-based routing, SSR, data loading, and server functions. Triggers on tanstack start, createFileRoute, loader.
Builds full-stack React apps with TanStack Start's file-based routing, SSR, and server functions. Triggers on `createFileRoute`, `loader`, or TanStack Start setup patterns.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
<mcp_first> CRITICAL: Fetch TanStack Start documentation before implementing.
MCPSearch({ query: "select:mcp__plugin_devtools_context7__query-docs" })
// TanStack Start patterns
mcp__context7__query_docs({
libraryId: "/tanstack/start",
query: "How do I use createFileRoute with loader and serverFn?",
});
// SSR and streaming
mcp__context7__query_docs({
libraryId: "/tanstack/start",
query: "How do I implement SSR, streaming, and deferred loading?",
});
// Server functions
mcp__context7__query_docs({
libraryId: "/tanstack/start",
query: "How do I use createServerFn and server actions?",
});
Note: Context7 v2 uses server-side filtering. Use descriptive natural language queries. </mcp_first>
<quick_start> File-based route:
// routes/dashboard.tsx
import { createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/dashboard")({
loader: async () => {
const data = await fetchDashboardData();
return { data };
},
component: DashboardPage,
});
function DashboardPage() {
const { data } = Route.useLoaderData();
return <Dashboard data={data} />;
}
Root route with layout:
// routes/__root.tsx
import { createRootRoute, Outlet } from "@tanstack/react-router";
export const Route = createRootRoute({
component: () => (
<html>
<body>
<Header />
<Outlet />
<Footer />
</body>
</html>
),
});
Server function:
import { createServerFn } from "@tanstack/react-start/server";
const getUser = createServerFn({ method: "GET" })
.validator((userId: string) => userId)
.handler(async ({ data: userId }) => {
return await db.query.users.findFirst({
where: eq(users.id, userId),
});
});
// Usage in component
const user = await getUser({ data: userId });
</quick_start>
<routing_patterns> Dynamic routes:
// routes/users/$userId.tsx
export const Route = createFileRoute("/users/$userId")({
loader: async ({ params }) => {
return await getUser(params.userId);
},
});
Nested layouts:
// routes/_authenticated.tsx (layout route)
export const Route = createFileRoute("/_authenticated")({
beforeLoad: async ({ context }) => {
if (!context.session) {
throw redirect({ to: "/login" });
}
},
component: AuthenticatedLayout,
});
// routes/_authenticated/settings.tsx (nested under layout)
export const Route = createFileRoute("/_authenticated/settings")({
component: SettingsPage,
});
Search params:
import { z } from "zod";
const searchSchema = z.object({
page: z.number().optional().default(1),
search: z.string().optional(),
});
export const Route = createFileRoute("/products")({
validateSearch: searchSchema,
component: ProductsPage,
});
function ProductsPage() {
const { page, search } = Route.useSearch();
}
</routing_patterns>
<data_loading> Loader with context:
export const Route = createFileRoute("/dashboard")({
loader: async ({ context }) => {
const { queryClient, session } = context;
return queryClient.ensureQueryData({
queryKey: ["dashboard", session.userId],
queryFn: () => fetchDashboard(session.userId),
});
},
});
Deferred data (streaming):
export const Route = createFileRoute("/analytics")({
loader: async () => {
return {
// Critical data - awaited
summary: await fetchSummary(),
// Non-critical - streamed
details: fetchDetails(), // Returns promise
};
},
});
function AnalyticsPage() {
const { summary, details } = Route.useLoaderData();
return (
<div>
<Summary data={summary} />
<Suspense fallback={<Skeleton />}>
<Await promise={details}>
{(data) => <Details data={data} />}
</Await>
</Suspense>
</div>
);
}
</data_loading>
<file_structure>
src/
├── routes/
│ ├── __root.tsx # Root layout
│ ├── index.tsx # /
│ ├── _authenticated.tsx # Layout route (prefix _)
│ ├── _authenticated/
│ │ ├── dashboard.tsx # /_authenticated/dashboard
│ │ └── settings.tsx # /_authenticated/settings
│ ├── users/
│ │ ├── index.tsx # /users
│ │ └── $userId.tsx # /users/:userId
│ └── api/
│ └── [...].ts # API routes
├── router.tsx # Router configuration
└── entry-server.tsx # Server entry
</file_structure>
<constraints> **Required:** - Use `createFileRoute` for all routes - Validate search params with Zod - Use `context` for shared data (queryClient, session) - Handle errors with `errorComponent`Naming:
_ (e.g., _authenticated.tsx)$ (e.g., $userId.tsx)[...].tsx
</constraints><success_criteria>
createFileRouteOutlet for children
</success_criteria>This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.