start-routing-data
БесплатноБез исполняемых скриптовНе проверенUse when loading data in Start routes — isomorphic loaders, TanStack Query in a loader, mutations, or per-route SSR. Do NOT use for generic Router/Query API.
от Fusengine★ 36 звёзд на GitHubОб этом скилле
Critical rules: never touch window/localStorage at loader top level (loaders run on the server too) — gate with ssr: false/'data-only' or useEffect instead; share one queryOptions factory between ensureQueryData (loader) and useQuery (component) so cache keys match; prefetch through the router-context queryClient, never a new one; invalidate loaders/Query cache after every server-function write; and remember ssr only tightens down the route tree, a child can never loosen a parent's ssr: false back to true.
Includes templates for a Query-prefetching route and a selective-SSR route.
Do NOT use this skill for generic TanStack Router/Query API questions — route trees, search params, useQuery/useMutation basics belong to react-expert's react-tanstack-router skill.
TanStack Start — Routing Data
Agent Workflow (MANDATORY)
Before ANY implementation, spawn in parallel:
- fuse-ai-pilot:explore-codebase — map
src/routes/, existing loaders,router.tsx, queryClient wiring - fuse-ai-pilot:research-expert — verify Start API via Context7
/websites/tanstack_start_framework_react - mcp__context7__query-docs — confirm loader / ssr / ensureQueryData signatures
After implementation, run fuse-ai-pilot:sniper.
Scope Boundary (READ FIRST)
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:
- Loaders are isomorphic (server on first request, client on navigation)
context.queryClient.ensureQueryData()inside a loader (SSR prefetch + hydration)- Per-route
ssr: true | false | 'data-only' - Mutations through server functions +
router.invalidate()
Overview
| 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 |
Critical Rules
- Loaders are isomorphic — never touch
window/localStorageat loader top level; gate withssr: false/'data-only'oruseEffect. - Share
queryOptions— define once, pass to BOTHensureQueryData(loader) anduseQuery(component) so the cache key matches. - Prefetch via
context.queryClient— the loader receivesqueryClientfrom router context; do not create a new client. - Mutations invalidate — after a server-fn write, call
router.invalidate()(loader data) orqueryClient.invalidateQueries(Query cache). ssrinherits down and only tightens — a child cannot loosen a parent'sssr: falseback totrue.
Architecture
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
Reference Guide
Concepts
| 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 |
Templates
| 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 |
Best Practices
DO
- Keep
queryOptionsfactories i
Установить start-routing-data в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл start-routing-data?
Use when loading data in Start routes — isomorphic loaders, TanStack Query in a loader, mutations, or per-route SSR. Do NOT use for generic Router/Query API.
Как установить скилл start-routing-data?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл start-routing-data запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic