mcpField
T
tanstack-start-conventions

tanstack-start-conventions

github.com/fixmyberlinDevelopment051 installsUpdated today
Repository

About tanstack-start-conventions

A skill documenting TanStack Start conventions for teams building or refactoring apps in this stack. It organizes guidance by task and sets rules for server boundaries, server functions, and SSR; it requires the companion tanstack-router-conventions skill.

Key features

  1. 01Task-based reference guide
  2. 02Server and client boundary rules
  3. 03Server function conventions
  4. 04Route SSR guidance
  5. 05API route validation rules

Use cases

  1. 01Scaffolding or refactoring app folders
  2. 02Choosing where server-side code belongs
  3. 03Implementing validated server functions
  4. 04Configuring route rendering behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fixmyberlin/fixmyskills --skill tanstack-start-conventions

After installing, type/tanstack-start-conventionsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
app-structure.md
client-server-boundaries.md
execution-model.md
local-runtime.md
params-search-api-routes.md
selective-ssr.md
server-components.md
server-functions.md

Details

From the project README

TanStack Start conventions

Stack conventions for TanStack Start apps in this org. Requires skill tanstack-router-conventions (search params, pretty URLs, loaders + Query, form vs useMutation, typed Router TS, devtools) - do not duplicate it here. Pair with tanstack-start-auth for auth and session layout.

Which reference to read

TaskFile
Scaffold or refactor app/src folders, thin routes, Layout/Page naming, testsapp-structure.md
Split code between .server.ts / .functions.ts, import protection, beforeLoad vs loader, error loggingclient-server-boundaries.md
Write createServerFn, validation, form submit, invalidationserver-functions.md
Loader or component hits DB/fs/secrets, client-nav bugsexecution-model.md
Set route ssr, debug SSR / hydration, Query dehydrationselective-ssr.md
API route under routes/api/ (path params, search, POST body)params-search-api-routes.md
Experimental RSC (renderServerComponent, createCompositeComponent)server-components.md
bun --bun for Vite + Nitro scriptslocal-runtime.md

Auth flows: skill tanstack-start-auth.

Non-negotiable rules

TopicRule
Server-only modules*.server.ts - never imported by routes/components (exceptions: routes/api/ and handler-only routes without a component); use createServerOnlyFn inside
Callable from client*.functions.ts with createServerFn; name exports *Fn
Public server fnspublic*.functions.ts - no global auth middleware; rate-limit/token checks in .server.ts (see tanstack-start-auth)
API route filesNo server-only import marker on the route file; server-only logic inside handlers or tree-shaken imports
API search paramsNo validateSearch on API routes; Zod safeParse in GET from request.url, return 400 JSON on failure
SSRSet ssr explicitly on every route; UI default true; handler-only API routes false; map-heavy UI 'data-only'
Local Bun runtimeVite dev and Nitro start/preview use bun --bun
Router search / QueryOwned by tanstack-router-conventions (parseSearch / stringifySearch, loader + Query)

Quick decisions

  • beforeLoad vs loader: redirects, auth, light context in beforeLoad (not middleware); data fetch / Query priming in loader. beforeLoad re-runs on every navigation, search-param changes included, so hot routes (map viewport, layer toggles) put redirect/auth/region in the loader and keep those params out of loaderDeps. Details: client-server-boundaries.md.
  • Loader vs Query, form vs mutation: follow tanstack-router-conventions -> references/router-and-query.md (#client-mutations). On Start, loaders and mutationFn call the *Fn; server I/O always goes through createServerFn.
  • ssr: map/canvas-heavy UI needing server auth/data -> 'data-only'; handler-only API (server.handlers) -> false; fully client-first UI route -> false (rare).
  • Server components: opt-in experimental, not the default FMC data path.

Related skills

TopicSkill
Router (required)tanstack-router-conventions
Auth / sessiontanstack-start-auth
Bun install / nvmtech-stack -> bun-install
Zustandzustand-state-management
URL state without TanStack Routernuqs
Leftover placement after refactorsunslop-code Phase 6 -> references/component-location.md

Comments

Markdown supported