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
- 01Task-based reference guide
- 02Server and client boundary rules
- 03Server function conventions
- 04Route SSR guidance
- 05API route validation rules
Use cases
- 01Scaffolding or refactoring app folders
- 02Choosing where server-side code belongs
- 03Implementing validated server functions
- 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-conventionsAfter installing, type/tanstack-start-conventionsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/app-structure.mdclient-server-boundaries.mdexecution-model.mdlocal-runtime.mdparams-search-api-routes.mdselective-ssr.mdserver-components.mdserver-functions.mdDetails
From the project READMETanStack 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
| Task | File |
|---|---|
Scaffold or refactor app/src folders, thin routes, Layout/Page naming, tests | app-structure.md |
Split code between .server.ts / .functions.ts, import protection, beforeLoad vs loader, error logging | client-server-boundaries.md |
Write createServerFn, validation, form submit, invalidation | server-functions.md |
| Loader or component hits DB/fs/secrets, client-nav bugs | execution-model.md |
Set route ssr, debug SSR / hydration, Query dehydration | selective-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 scripts | local-runtime.md |
Auth flows: skill tanstack-start-auth.
Non-negotiable rules
| Topic | Rule |
|---|---|
| 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 fns | public*.functions.ts - no global auth middleware; rate-limit/token checks in .server.ts (see tanstack-start-auth) |
| API route files | No server-only import marker on the route file; server-only logic inside handlers or tree-shaken imports |
| API search params | No validateSearch on API routes; Zod safeParse in GET from request.url, return 400 JSON on failure |
| SSR | Set ssr explicitly on every route; UI default true; handler-only API routes false; map-heavy UI 'data-only' |
| Local Bun runtime | Vite dev and Nitro start/preview use bun --bun |
| Router search / Query | Owned by tanstack-router-conventions (parseSearch / stringifySearch, loader + Query) |
Quick decisions
beforeLoadvsloader: redirects, auth, light context inbeforeLoad(not middleware); data fetch / Query priming inloader.beforeLoadre-runs on every navigation, search-param changes included, so hot routes (map viewport, layer toggles) put redirect/auth/region in theloaderand keep those params out ofloaderDeps. 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 andmutationFncall the*Fn; server I/O always goes throughcreateServerFn. 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
| Topic | Skill |
|---|---|
| Router (required) | tanstack-router-conventions |
| Auth / session | tanstack-start-auth |
| Bun install / nvm | tech-stack -> bun-install |
| Zustand | zustand-state-management |
| URL state without TanStack Router | nuqs |
| Leftover placement after refactors | unslop-code Phase 6 -> references/component-location.md |