plugins/tanstack-start-expert/skills/start-routing-data/SKILL.md
Use when: loading data in TanStack Start routes with isomorphic loaders, wiring TanStack Query into a Start loader (ensureQueryData), running mutations via server functions, or tuning per-route SSR (ssr flag). Do NOT use for: generic TanStack Router/Query API — route trees, search params, useQuery/useMutation basics (use react-expert's react-tanstack-router).
npx skillsauth add fusengine/agents start-routing-dataInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before ANY implementation, spawn in parallel:
src/routes/, existing loaders, router.tsx, queryClient wiring/websites/tanstack_start_framework_reactAfter implementation, run fuse-ai-pilot:sniper.
Generic TanStack Router and TanStack Query — route trees, file-based routing, search-param validation, useQuery/useMutation mechanics, cache config — are covered by react-expert's react-tanstack-router. This skill covers ONLY what is specific to Start:
context.queryClient.ensureQueryData() inside a loader (SSR prefetch + hydration)ssr: true | false | 'data-only'router.invalidate()| Start-specific feature | Description |
|------------------------|-------------|
| Isomorphic loader | Route.loader runs on server (initial) AND client (navigation) — no window at top level |
| Query in loader | ensureQueryData(queryOptions) prefetches on server, useQuery reads cache in component |
| Selective SSR | ssr flag per route: full SSR, data-only, or client-only |
| Server-fn mutation | Call createServerFn handler, then router.invalidate() to refetch loaders |
window/localStorage at loader top level; gate with ssr: false/'data-only' or useEffect.queryOptions — define once, pass to BOTH ensureQueryData (loader) and useQuery (component) so the cache key matches.context.queryClient — the loader receives queryClient from router context; do not create a new client.router.invalidate() (loader data) or queryClient.invalidateQueries (Query cache).ssr inherits down and only tightens — a child cannot loosen a parent's ssr: false back to true.src/
├── router.tsx # createRouter({ context: { queryClient } })
├── routes/
│ └── posts.$postId.tsx # loader: ensureQueryData + component: useQuery
└── queries/
└── posts.ts # queryOptions factory (shared loader + component)
→ See query-loader-route.md for the complete route
| Topic | Reference | Load when | |-------|-----------|-----------| | Isomorphic loaders | isomorphic-loaders.md | Loader touches browser API or you see hydration mismatch | | Query in loader | query-in-loader.md | Integrating TanStack Query prefetch with a Start loader | | Selective SSR | selective-ssr.md | Disabling/tuning SSR per route | | Mutations | mutations.md | Writing data via server functions and refreshing the UI |
| Template | When to Use | |----------|-------------| | query-loader-route.md | Route that prefetches with Query and reads in the component | | selective-ssr-route.md | Route needing client-only render or data-only SSR |
queryOptions factories in src/queries/ and reuse them loader + componentensureQueryData promise directly from the loader (Start awaits it)ssr: 'data-only' when the component needs window but the data should still SSRlocalStorage/window at loader top level (loader also runs on the server)useEffect when the loader already primed the cachetesting
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.