Provides TanStack Router best practices for type-safe routing, data loading, search params, navigation, and code organization in React applications.
Ships in deckardger-tanstack-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Comprehensive guidelines for implementing TanStack Router patterns in React applications. These rules optimize type safety, data loading, navigation, and code organization.
| Priority | Category | Rules | Impact |
|---|---|---|---|
| CRITICAL | Type Safety | 4 rules | Prevents runtime errors and enables refactoring |
| CRITICAL | Route Organization | 5 rules | Ensures maintainable route structure |
| HIGH | Router Config | 1 rule | Global router defaults |
| HIGH | Data Loading | 6 rules | Optimizes data fetching and caching |
| HIGH | Search Params | 5 rules | Enables type-safe URL state |
| HIGH | Error Handling | 1 rule | Handles 404 and errors gracefully |
| MEDIUM | Navigation | 5 rules | Improves UX and accessibility |
| MEDIUM | Code Splitting | 3 rules | Reduces bundle size |
| MEDIUM | Preloading | 3 rules | Improves perceived performance |
| LOW | Route Context | 3 rules | Enables dependency injection |
ts-)ts-register-router — Register router type for global inferencets-use-from-param — Use from parameter for type narrowingts-route-context-typing — Type route context with createRootRouteWithContextts-query-options-loader — Use queryOptions in loaders for type inferencerouter-)router-default-options — Configure router defaults (scrollRestoration, defaultErrorComponent, etc.)org-)org-file-based-routing — Prefer file-based routing for conventionsorg-route-tree-structure — Follow hierarchical route tree patternsorg-pathless-layouts — Use pathless routes for shared layoutsorg-index-routes — Understand index vs layout routesorg-virtual-routes — Understand virtual file routesload-)load-use-loaders — Use route loaders for data fetchingload-loader-deps — Define loaderDeps for cache controlload-ensure-query-data — Use ensureQueryData with TanStack Queryload-deferred-data — Split critical and non-critical dataload-error-handling — Handle loader errors appropriatelyload-parallel — Leverage parallel route loadingsearch-)search-validation — Always validate search paramssearch-type-inheritance — Leverage parent search param typessearch-middleware — Use search param middlewaresearch-defaults — Provide sensible defaultssearch-custom-serializer — Configure custom search param serializerserr-)err-not-found — Handle not-found routes properlynav-)nav-link-component — Prefer Link component for navigationnav-active-states — Configure active link statesnav-use-navigate — Use useNavigate for programmatic navigationnav-relative-paths — Understand relative path navigationnav-route-masks — Use route masks for modal URLssplit-)split-lazy-routes — Use .lazy.tsx for code splittingsplit-critical-path — Keep critical config in main route filesplit-auto-splitting — Enable autoCodeSplitting when possiblepreload-)preload-intent — Enable intent-based preloadingpreload-stale-time — Configure preload stale timepreload-manual — Use manual preloading strategicallyctx-)ctx-root-context — Define context at root routectx-before-load — Extend context in beforeLoadctx-dependency-injection — Use context for dependency injectionEach rule file in the rules/ directory contains:
See individual rule files in rules/ directory for detailed guidance and code examples.
rules/ctx-before-load.md (opens in a new tab)rules/ctx-dependency-injection.md (opens in a new tab)rules/ctx-root-context.md (opens in a new tab)rules/err-not-found.md (opens in a new tab)rules/load-deferred-data.md (opens in a new tab)rules/load-ensure-query-data.md (opens in a new tab)rules/load-error-handling.md (opens in a new tab)rules/load-loader-deps.md (opens in a new tab)rules/load-parallel.md (opens in a new tab)rules/load-use-loaders.md (opens in a new tab)rules/nav-active-states.md (opens in a new tab)rules/nav-link-component.md (opens in a new tab)rules/nav-relative-paths.md (opens in a new tab)rules/nav-route-masks.md (opens in a new tab)rules/nav-use-navigate.md (opens in a new tab)rules/org-file-based-routing.md (opens in a new tab)rules/org-index-routes.md (opens in a new tab)rules/org-pathless-layouts.md (opens in a new tab)rules/org-route-tree-structure.md (opens in a new tab)rules/org-virtual-routes.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/tanstack-integration-best-practicesBest practices for integrating TanStack Query with TanStack Router and TanStack Start. Patterns for full-stack data flow, SSR, and caching coordination./tanstack-query-best-practicesTanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management. Activate when building data-driven React applications with server state./tanstack-start-best-practicesTanStack 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./deckardger-tanstack-agent-skills:tanstack-router-best-practicesfrom deckardger-tanstack-agent-skills
deckardger-tanstack-agent-skills@cascade-code-languages-misc-2 is listed by joshuarweaver/cascade-code-languages-misc-2 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-2 --plugin deckardger-tanstack-agent-skillsOther plugins' skills for the same job