tanstack-start
/tanstack-start
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.
- Author
- secondsky ↗
- Repository
- claude-skills ↗
- Licence
- MIT
- Last repository change
- 26.09.2026
Assessment and security
- Files in this package
- 10
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 26.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/bootstrap-cloudflare-start.sh
What it does and when to use it
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.
Original author description
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.
How it works
- Use this skill when
- What’s inside
- Quick Start (React)
- Routing + Data Best Practices
- Navigation, Preloading, and UX
- Rendering & Performance
- Devtools, Linting, and LLM Support
- Deployment Notes (Cloudflare-friendly)
- Ship Checklist
SKILL.md preview
---
name: tanstack-start
description: 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.
license: MIT
allowed-tools: [Bash, Read, Write, Edit]
metadata:
version: 1.0.0-rc.1
author: Claude Skills Maintainers
last-verified: 2025-12-09
production-tested: false
status: rc
keywords:
- tanstack start
- tanstack react start
- full-stack react
- selective ssr
- spa mode
- static prerender
- server functions
- server routes
- cloudflare workers
- edge rendering
- hydration errors
- next.js migration
---
# TanStack 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)
```bash
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.tsx` hydrates `<StartClient />`; `app/entry.server.tsx` wraps `createServerEntry`.
- `app/config.ts` or `app/start.ts` sets `defaultSsr`, `spaMode`, middleware, and context.
---
## Routing + Data Best Practices
- **Type-safe params & search**: `createFileRoute()` infers path params; add `validateSearch` (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 via `router.invalidate()` after mutation.
- **TanStack Query bridge**: create a `QueryClient` in router context and `ensureQueryData` inside loaders to dedupe fetches.
- **Deferred/external data**: stream partial data or read from external loaders; prefer suspense-friendly responses.
- **Head management**: set `head` per route for `<title>`/meta; derive from loader data to keep SEO consistent.
- **Not-found/auth**: throw `notFound()` or `redirect()` in loaders/middleware; use error boundaries for UX.
Example route (typed search + data-only SSR):
```ts
// 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; use `preload="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=abc` masked as `/p/abc`).
- **Navigation blocking**: protect unsaved forms with `router.navigate({ to, replace, from })` blockers or `useBlocker`.
- **Scroll restoration**: enable `scrollRestoration` to 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; `defaultSsr` config sets the baseline.
- **Code-splitting**: file-based routes auto-split; add `lazy`/`load` for manual chunks on code-based routes.
- **Preloading strategy**: pair `preload="intent"` links with `defaultPreloadStaleTime` to avoid over-fetching.
- **Render optimizations**: keep loaders pure, memoize heavy components, and use `pendingComponent` for 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-router` with the recommended config to enforce inference-sensitive property order (e.g., `beforeLoad` before `loader`).
- LLM-aware routing: the Router exposes structured route metadata to LLM agents; keep descriptions concise in `Route` meta 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 `validateSearch` and custom serializer where needed.
- [ ] Link preloading configured for high-traffic routes; blockers added for unsaved forms.
- [ ] ESLint plugin enabled (`create-route-property-order` rule) and `npm run check` passes.
- [ ] Devtools verified locally; `router.matches` state looks correct.
- [ ] Cloudflare bindings typed (`cf-typegen`) and streaming tested via `curl -N`.
Files in this package (10)
- SKILL.md 6 KB
- references/cloudflare-hosting-and-env.md 3 KB
- references/devtools-and-llm-support.md 1 KB
- references/execution-and-auth.md 2 KB
- references/navigation-and-preloading.md 2 KB
- references/quickstart-and-layout.md 3 KB
- references/rendering-modes.md 2 KB
- references/routing-and-data-loading.md 2 KB
- references/server-functions-and-middleware.md 3 KB
- scripts/bootstrap-cloudflare-start.sh 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · secondsky/claude-skills | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| Mindrally/skills | 100 | Apache-2.0 |
| vercel-labs/json-render | 95 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version 4c4325bf48cb (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95tanstack-start-best-practices
TanStack Start best practices for full-stack React applications. Server functions, middleware, SSR, authentication, and deployment patterns. Activate when building full-stack apps with TanStack Start. - 100bun-tanstack-start
TanStack Start full-stack React framework with Bun runtime. Use for TanStack Router, server functions, vinxi, or encountering SSR, build, preset errors. - 100tanstack-start-architecture
Use when creating, moving, or naming files in a full-stack TanStack Start app (file-based routes, server functions) that also uses TanStack Query, Form, Table, DB, and Devtools, organized by technical layer. Covers routes, server/ (functions, middleware, services, db),… - 100tanstack
Type-safe React with TanStack Query (fetching, caching, mutations), Router (file-based routing, search params, loaders), and Start (SSR, server functions). Use for react-query, server state, typed search params, route loaders, or SSR. - 95tanstack-table
TanStack Table v8 headless data tables with server-side features for Cloudflare Workers + D1. Use for pagination, filtering, sorting, virtualization, or encountering state management, TanStack Query coordination, URL sync errors. - 100solid-tanstack-start
Use when organizing TanStack Start code, splitting oversized routes/server functions, or reviewing architecture. Do NOT use for setup or plain React SPA.