Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

skill_spec.md

111 lines8.8 KB

TanStack Start β€” Skill Spec

TanStack Start is a full-stack React framework built on TanStack Router and Vite. It adds SSR, streaming, server functions (type-safe RPCs), middleware, server routes, and universal deployment. All code is isomorphic by default β€” it runs in both server and client environments unless explicitly constrained.

Domains

DomainDescriptionSkills
Project SetupScaffolding, Vite plugin, router factory, root route, entriesstart-setup
Server FunctionsType-safe RPCs with createServerFn, validation, streamingserver-functions
Middleware and ContextRequest/function middleware, context, global middlewaremiddleware
Execution ModelIsomorphic defaults, environment boundaries, env varsexecution-model
Server RoutesAPI endpoints, HTTP handlers, handler middlewareserver-routes
Deployment and RenderingHosting, selective SSR, prerendering, SEOdeployment, server-components

Skill Inventory

SkillTypeDomainWhat it coversFailure modes
start-setupcoreproject-setuptanstackStart(), getRouter(), root route, entries3
server-functionscoreserver-functionscreateServerFn, validation, useServerFn, streaming8
middlewarecoremiddleware-and-contextcreateMiddleware, context, global middleware, factories3
execution-modelcoreexecution-modelIsomorphic defaults, environment functions, env vars5
server-routescoreserver-routesserver property, HTTP handlers, createHandlers5
deploymentcoredeployment-and-renderingHosting, SSR modes, prerendering, SEO3
server-componentssub-skilldeployment-and-renderingReact Server Components, cache ownership, selective SSR3
react-startframeworkproject-setupReact bindings, useServerFn, full setup3
migrate-from-nextjslifecycleproject-setupNext.js App Router migration checklist3

Failure Mode Inventory

start-setup (3 failure modes)

#MistakePrioritySource
1React plugin before Start plugin in Vite configCRITICALdocs/build-from-scratch
2Enabling verbatimModuleSyntax in tsconfigHIGHdocs/build-from-scratch
3Missing Scripts component in root routeHIGHdocs/guide/routing

server-functions (8 failure modes)

#MistakePrioritySource
1Putting server-only code in loaders instead of server functionsCRITICALmaintainer interview
2Using dynamic imports for server functionsHIGHdocs/guide/server-functions
3Not using useServerFn for component callsMEDIUMdocs/guide/server-functions
4Generating Next.js or Remix server patternsCRITICALmaintainer interview
5Relying on a route guard to protect a server functionCRITICALprotocol-v4 evaluation
6Self-fetching a relative API URL from an SSR loaderCRITICALprotocol-v4 evaluation
7Mutating without invalidating cached loader dataHIGHprotocol-v4 evaluation
8Treating typecheck as proof of output schema propagationCRITICALprotocol-v4 evaluation

middleware (3 failure modes)

#MistakePrioritySource
1Trusting client sendContext without server validationHIGHdocs/guide/middleware
2Confusing request vs server function middlewareMEDIUMdocs/guide/middleware
3Wrong middleware method orderMEDIUMdocs/guide/middleware

execution-model (5 failure modes)

#MistakePrioritySource
1Assuming loaders are server-onlyCRITICALdocs/guide/execution-model
2Exposing secrets via module-level process.envCRITICALdocs/guide/execution-model
3Using VITE_ prefix for server secretsCRITICALdocs/guide/environment-variables
4Hydration mismatches from env-dependent renderingHIGHdocs/guide/execution-model
5Using a relative URL in an isomorphic loaderCRITICALprotocol-v4 evaluation

server-routes (5 failure modes)

#MistakePrioritySource
1Duplicate path resolution for server routesMEDIUMdocs/guide/server-routes
2Forgetting to await request body methodsMEDIUMdocs/guide/server-routes
3Relying on page auth to protect a server routeCRITICALprotocol-v4 evaluation
4Self-fetching a server route from an SSR loaderCRITICALprotocol-v4 evaluation
5Omitting a field from serialized response outputCRITICALprotocol-v4 evaluation

deployment (3 failure modes)

#MistakePrioritySource
1Missing nodejs_compat flag for Cloudflare WorkersHIGHdocs/guide/hosting
2Bun deployment with React 18MEDIUMdocs/guide/hosting
3Child route loosening parent SSR configMEDIUMdocs/guide/selective-ssr

server-components (3 failure modes)

#MistakePrioritySource
1Using renderServerComponent when the UI needs slotsHIGHdocs/guide/server-components
2Omitting structuralSharing: false for Query-cached RSC valuesHIGHdocs/guide/server-components
3Copying stale renderRsc or .validator examplesMEDIUMdocs/guide/server-functions

Tensions

TensionSkillsAgent implication
Isomorphic defaults vs server-only expectationsexecution-model ↔ server-functionsAgents put secrets/DB queries in loaders instead of server functions
Simplicity of isomorphic code vs security boundariesexecution-model ↔ middlewareAgents expose secrets via module-level process.env or skip context validation

Cross-References

FromToReason
server-functionsexecution-modelServer functions ARE the isomorphic boundary
server-functionsmiddlewareMiddleware chains compose with server functions
middlewareserver-routesServer routes use the same middleware system
deploymentexecution-modelDeployment target affects where code runs