
tanstack-start
TanStack Start skill for full-stack React with server functions, selective SSR, and Cloudflare Workers.
- version
- 3.12.0
- GitHub stars
- 250
What it does
- Adds the
tanstack-startskill with eight reference guides and abootstrap-cloudflare-start.shscaffolding script - Covers rendering modes (SSR, data-only, CSR, SPA, prerender), server functions, routing, and Cloudflare Workers configuration
- Includes a Next.js migration path that maps
getServerSidePropsto route loaders and API routes to server functions - Designed for teams migrating from Next.js, starting new Start apps, or debugging hydration and edge rendering issues
TanStack Start (RC) full-stack React with server functions, SSR, Cloudflare Workers. Use for Next.js migration, edge rendering, or encountering hydration, auth, data pattern errors.
Add marketplace
/plugin marketplace add secondsky/claude-skillsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install tanstack-start@claude-skillsRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceTanStack Start (React) — RC-Ready Playbook
Full-stack React on TanStack Router with per-route SSR/CSR, file-based routing, server functions, and first-class Cloudflare Workers support.
Use this skill when
- Building a greenfield React app that needs route-level SSR/CSR/SSG switches.
- Migrating from Next.js/React Router while keeping file-based routing + API routes.
- Shipping to edge runtimes (Workers) with typed server functions and bindings.
- You want predictable routing with type-safe params/search + built-in preloading.
What’s inside
- References: quickstart/layout, rendering modes, server functions, Cloudflare hosting, execution/auth, plus new routing/data/navigation/devtools guides.
- Script:
scripts/bootstrap-cloudflare-start.sh <app>scaffolds Start + Workers + binding types. - Troubleshooting: hydration, API routing, bindings, navigation/preloading failures.
Quick Start (React)
npm create @tanstack/start@latest my-app
cd my-app
npm run dev
Manual installs (all bundle targets are supported): add @tanstack/react-router + @tanstack/react-start with your bundler plugin (vite, webpack, or esbuild) per the official install guides.
Core layout reminder
app/routes/**file-based routes → router tree, automatic code-splitting + data preloading.app/entry.client.tsxhydrates<StartClient />;app/entry.server.tsxwrapscreateServerEntry.app/config.tsorapp/start.tssetsdefaultSsr,spaMode, middleware, and context.
Routing + Data Best Practices
- Type-safe params & search:
createFileRoute()infers path params; addvalidateSearch(zod) to parse and coerce search params. - Route matching order is deterministic (index → static → dynamic → splat); rely on this when adding catch-alls.
- Loaders run once per location change; return plain data, throw
redirect()/notFound()for control flow. - Data mutations: colocate
action/server functions; keep loaders read-only and invalidate viarouter.invalidate()after mutation. - TanStack Query bridge: create a
QueryClientin router context andensureQueryDatainside loaders to dedupe fetches. - Deferred/external data: stream partial data or read from external loaders; prefer suspense-friendly responses.
- Head management: set
headper route for<title>/meta; derive from loader data to keep SEO consistent. - Not-found/auth: throw
notFound()orredirect()in loaders/middleware; use error boundaries for UX.
Example route (typed search + data-only SSR):
// app/routes/posts.$postId.tsx
import { createFileRoute, redirect } from '@tanstack/react-router'
import { z } from 'zod'
export const Route = createFileRoute('/posts/$postId')({
validateSearch: z.object({ preview: z.boolean().optional() }),
ssr: 'data-only',
loader: async ({ params, search, context }) => {
const post = await context.queryClient.ensureQueryData(['post', params.postId], () =>
fetch(`/api/posts/${params.postId}?preview=${!!search.preview}`).then(r => r.json())
)
if (!post.published && !search.preview) throw redirect({ to: '/drafts' })
return { post }
},
})
Navigation, Preloading, and UX
- Link prefetch defaults:
<Link preload="intent">(hover/focus) preloads route data/code; usepreload="render"for above-the-fold routes. - Programmatic preloading:
router.preloadRoute({ to, search })to warm caches before navigation (e.g., on visibility). - Route masking: keep canonical URLs while showing user-friendly masks (e.g.,
/products?slug=abcmasked as/p/abc). - Navigation blocking: protect unsaved forms with
router.navigate({ to, replace, from })blockers oruseBlocker. - Scroll restoration: enable
scrollRestorationto restore positions on back/forward; customize per route when using long lists. - Search param serialization: customize parse/stringify to keep numbers/dates stable and avoid stringified booleans.
Rendering & Performance
- Per-route SSR: set
ssr: true | false | 'data-only'on routes;defaultSsrconfig sets the baseline. - Code-splitting: file-based routes auto-split; add
lazy/loadfor manual chunks on code-based routes. - Preloading strategy: pair
preload="intent"links withdefaultPreloadStaleTimeto avoid over-fetching. - Render optimizations: keep loaders pure, memoize heavy components, and use
pendingComponentfor CSR routes to avoid layout shift.
Devtools, Linting, and LLM Support
- Add
<RouterDevtools />during development to inspect matches, loader states, and preloading. - Enable the ESLint plugin
@tanstack/eslint-plugin-routerwith the recommended config to enforce inference-sensitive property order (e.g.,beforeLoadbeforeloader). - LLM-aware routing: the Router exposes structured route metadata to LLM agents; keep descriptions concise in
Routemeta for better AI navigation.
Deployment Notes (Cloudflare-friendly)
- Keep
cloudflare({ viteEnvironment: { name: 'ssr' } })first in Vite plugins so bindings reach server entry. - Regenerate bindings after changes:
npm run cf-typegen. - For static-heavy sites, enable prerender to ship HTML to Workers Assets/Pages; exclude param routes or add explicit
pages.
Ship Checklist
- Routes load without hydration warnings (prefer
ssr: 'data-only'for non-deterministic UI). - Search params validated with
validateSearchand custom serializer where needed. - Link preloading configured for high-traffic routes; blockers added for unsaved forms.
- ESLint plugin enabled (
create-route-property-orderrule) andnpm run checkpasses. - Devtools verified locally;
router.matchesstate looks correct. - Cloudflare bindings typed (
cf-typegen) and streaming tested viacurl -N.
Readme
TanStack Start (React) Skill — RC Ready
Full-stack React framework built on TanStack Router with server functions, selective SSR, prerendering, and first-class Cloudflare Workers support. Use this skill for migrations from Next.js, greenfield Start apps, or when you need type-safe server functions plus flexible rendering modes.
Auto-Trigger Keywords
- "TanStack Start", "Start RC", "React full-stack", "file-based routing"
- "selective SSR", "SPA mode", "static prerender", "server functions"
- "Cloudflare Workers", "Start on Workers", "edge SSR", "router + server"
Current Status (2025-12-09)
- Latest RC: v1.139.12 (2025-11-29)
- GA: not announced yet; safe for pilots/POCs with monitoring.
- Track: TanStack Router releases + Start guides for breaking changes.
What You Get
- References:
references/quickstart-and-layout.md— CLI, project map, entrypointsreferences/rendering-modes.md— SSR/data-only/CSR, SPA mode, prerender, hydration playbookreferences/server-functions-and-middleware.md— server functions, routes, middleware, static functionsreferences/cloudflare-hosting-and-env.md— Workers setup, bindings, env vars, Tailwind v4references/execution-and-auth.md— execution model, environment functions, auth/data/observabilityreferences/routing-and-data-loading.md— file/code routes, params/search typing, loaders/actions, not-foundreferences/navigation-and-preloading.md— link options, preloading, route masking, blockers, scroll restorationreferences/devtools-and-llm-support.md— router devtools, ESLint rules, LLM-oriented metadata
- Script:
scripts/bootstrap-cloudflare-start.sh <app-name>scaffolds a Start + Workers project and generates binding types.
Quick Start (Cloudflare)
./scripts/bootstrap-cloudflare-start.sh my-start-app
cd my-start-app
npm run dev
Core Patterns (updated)
// app/routes/index.tsx
import { createFileRoute, redirect } from '@tanstack/react-router'
import { getGreeting } from '@/server/greeting'
export const Route = createFileRoute('/')({
ssr: 'data-only', // stream data, render on client
loader: async () => {
const greeting = await getGreeting()
if (!greeting) throw redirect({ to: '/login' })
return { greeting }
},
component: () => {
const { greeting } = Route.useLoaderData()
return <h1 className="text-2xl font-semibold">{greeting}</h1>
},
})
// app/server/greeting.ts
import { createServerFn } from '@tanstack/react-start'
export const getGreeting = createServerFn({ method: 'GET' }).handler(async () => {
return `Welcome back at ${new Date().toISOString()}`
})
- Add
validateSearchon routes to keep search params typed. - Use
<Link preload="intent">for hover/focus preloading; callrouter.preloadRoutefor critical nav. - Enable
<RouterDevtools />during dev and@tanstack/eslint-plugin-routerfor property-order safety.
Migrate from Next.js (fast path)
- Keep file-based routes; move pages into
app/routes/and convert hooks toRoute.useLoaderData(). - Replace
getServerSidePropswith route loaders; replace API routes with server routes or server functions. - Toggle SSR per route (
ssr: true | false | 'data-only') to match previous rendering behavior. - Use
@cloudflare/vite-plugin+ Wrangler instead ofnext.config.jswhen targeting Workers.
Troubleshooting Cheats
- Hydration mismatch: move non-deterministic values to loaders or use
ssr: 'data-only'. - 404 on API routes: ensure
server.handlersare defined and file path matches route path. - Cloudflare env undefined: confirm
cloudflare({ viteEnvironment: { name: 'ssr' } })is first plugin and bindings are declared inwrangler.jsonc. - Streaming stalls: avoid mixing
Response.jsonand streaming in the same handler; preferreturn toStreamResponse(...)from adapters.
Verify Before Shipping
- Run
npm run build && npm run previewlocally; thennpm run deployagainst a staging Worker. - Check
ONE_PAGE_CHECKLIST.mdand keepwrangler typesregenerated after binding changes.
Details
- Marketplace
- secondsky/claude-skills
- Source
- plugins/tanstack-start
- Category
- Frontend
- Keywords
- tanstack-start, tanstack, start, frontend, components, ssr, migration, edge
- Listed since
- Apr 7, 2026
More from secondsky/claude-skills
All 122- tanstack-tablev3.12.0
- tech-debtv3.12.0
- technical-specificationv3.12.0
- test-quality-analysisv3.12.0
- thesys-generative-uiv3.12.0
- threejsv3.12.0
- turborepov3.12.0
- typescript-migrationv3.12.0
- ultracitev3.12.0
- unknowns-discoveryv3.12.0
- vitest-testingv3.12.0
- vulnerability-scanningv3.12.0
- web-performance-auditv3.12.0
- web-performance-optimizationv3.12.0
- websocket-implementationv3.12.0
- woocommerce-backend-devv3.12.0
- woocommerce-code-reviewv3.12.0
- woocommerce-copy-guidelinesv3.12.0
- woocommerce-dev-cyclev3.12.0
- wordpress-plugin-corev3.12.0
- xss-preventionv3.12.0
- zodv3.12.0
- zustand-state-managementv3.12.0
- aceternity-uiv3.12.0
Similar to tanstack-start
More Frontend & UI Code
nextjsPluginsecondsky/claude-skills250 starsNext.js 16 with App Router, Server Components, Server Actions, Cache Components. Use for React 19.2 apps, SSR, or encountering async params, proxy.ts migration,
fuse-tanstack-startPluginfusengine/agents36 starsExpert TanStack Start full-stack React framework: server functions, selective SSR, execution model, middleware, server routes, file-based routing with data load
nextjs-on-cloudflareSkillcloudflare/skills60.4K installsBuild and deploy Next.js apps on Cloudflare Workers with vinext, not OpenNext, for new projects.
nextjs-toolkitPluginarmanzeroeight/fastagent-plugins29 starsNext.js framework toolkit for rendering strategies (SSR/SSG/ISR), App Router patterns, and full-stack React development. Includes Next.js expert agent for strat
fuse-nextjsPluginfusengine/agents36 starsExpert Next.js 16 + React 19 with App Router, Server Components, Prisma 7, Better Auth, TanStack Form, Zustand, shadcn/ui