Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

tanstack-start-optimizer

/tanstack-start-optimizer

Audytuje aplikacje TanStack Start: loadery tras, cache routera, granice funkcji serwerowych, SSR i prerender, rozmiar paczek oraz Core Web Vitals, z pomiarami.

Licencja
MIT
Ostatnia zmiana repozytorium
04.11.2026

Ocena i bezpieczeństwo

85/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
12
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/audit.py

Co robi i kiedy

Audytuje aplikacje TanStack Start: loadery tras, cache routera, granice funkcji serwerowych, SSR i prerender, rozmiar paczek oraz Core Web Vitals, z pomiarami.

Oryginalny opis (EN)

Audit and optimize TanStack Start apps (Start 1.x with TanStack Router, Vite 8 or Rsbuild, React 18/19) for route-loader waterfalls and over-fetching, router cache and preload settings, server-function boundaries/auth/validation, SSR vs data-only vs SPA vs prerender choices, code splitting and bundle size, deployment cold starts, and Core Web Vitals, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow TanStack Start app, route loaders or beforeLoad, staleTime/preload/invalidat

Jak działa

  1. Workflow
  2. Principles
Sekcje z nagłówków SKILL.md, w oryginale · 65 linii, 839 słów
Podgląd SKILL.md
---
name: tanstack-start-optimizer
description: Audit and optimize TanStack Start apps (Start 1.x with TanStack Router, Vite 8 or Rsbuild, React 18/19) for route-loader waterfalls and over-fetching, router cache and preload settings, server-function boundaries/auth/validation, SSR vs data-only vs SPA vs prerender choices, code splitting and bundle size, deployment cold starts, and Core Web Vitals, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow TanStack Start app, route loaders or beforeLoad, staleTime/preload/invalidate, createServerFn, server routes, SSR or data-only rendering, SPA mode, prerender, autoCodeSplitting, TanStack Query SSR, hydration mismatches, Vite 8/Rsbuild, Cloudflare/Nitro deployment, or upgrading from the Vinxi/beta era -- even if they never say "audit" or "optimize".
---

# TanStack Start Optimizer

Audit a TanStack Start codebase, report what is slow or fragile and why, agree a plan with the user, then fix it. Order: evidence, approval, edits. Start's performance model is route loaders plus selective SSR, and its security model is server functions as public endpoints; changing either silently changes correctness, so nothing is edited before approval.

## Workflow

### 1. Scope (quick)

- Find the root (`package.json` with `@tanstack/react-start`). Record: Start version, TanStack Router version, build tool (Vite 8+/Rsbuild), React 18/19, Node runtime (Start requires >=22.12), rendering mode (SSR by default, selective `ssr`, SPA, prerender), TanStack Query integration, and deployment target (Nitro/Cloudflare/Netlify/Node).
- Run `python <skill-dir>/scripts/audit.py <project-root>` -- static scan of `package.json`, `vite.config.*`, `src/start.ts`, `src/router.tsx`, root/route files and server functions for legacy Vinxi, loader leakage, cache/preload defaults, server-function validation/CSRF, code-splitting blockers and bundle risks, with file:line evidence. Use `--json` to post-process.
- Classify the pain: slow initial load (SSR/bundle), slow navigation (loaders/cache), slow mutations (server functions), hydration/CLS, deployment cold start, or code health/security. Ask which hurts if unclear.
- Read `references/tooling.md` once: what can be measured here (production build, router devtools, bundle analyzer, server timing, load tests).

### 2. Audit

The script finds cheap leads; you find the rest by reading. Read `package.json`, `vite.config.*`, `src/router.tsx`, `src/routes/__root.tsx`, the 3-5 routes the user cares about, and the server functions they call. Load only what applies:

| Area                                                          | Reference                        |
| ------------------------------------------------------------- | -------------------------------- |
| File routes, loaders/beforeLoad, search params, preloading    | `references/routing-loaders.md`  |
| Server functions, middleware, auth, server routes, env        | `references/server-functions.md` |
| SSR, selective SSR, SPA mode, prerender, hydration            | `references/rendering-ssr.md`    |
| Router cache, staleTime/gcTime, invalidation, TanStack Query  | `references/data-caching.md`     |
| Code splitting, bundle size, Vite/Rsbuild, deployment         | `references/bundle-build.md`     |
| Auth boundaries, XSS, secrets, types, tests, migrations       | `references/safety-quality.md`   |
| Production measurement and honest reporting                   | `references/tooling.md`          |

**Measure, never guess.** Build and run the production start command (Nitro/Node output, `vite preview` for plugin-based hosts, or the Cloudflare preview), then measure that. Record route-level JS, loader timing, SSR TTFB, hydration cost and LCP/INP/CLS. Dev mode and the Vite dev server are not evidence.

Mark each finding **Confirmed** (build output, network/profiler, code evidence) or **Suspected** (needs measuring).

### 3. Report

Fill `assets/report-template.md`, save it as `TANSTACK_START_OPTIMIZATION_REPORT.md` in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, behavior impact). Group near-duplicates.

### 4. Plan -- then stop for approval

Use plan mode: `EnterPlanMode` (load with ToolSearch if deferred), write the plan, present with `ExitPlanMode`; if unavailable show it in chat and wait for an explicit "go". Structure:

1. **Quick wins** -- `defaultPreload: 'intent'`, per-route `staleTime`, remove fetch-in-effect, parallelize independent loader calls, set body/cache headers, lazy-load heavy widgets, delete dead route exports. Low risk.
2. **Structural** -- move data into loaders/server functions, batch N+1 calls with `loaderDeps`, split slow routes, choose `ssr: 'data-only'`/`false` where justified, adopt Query integration with a per-router client, validate search/server input. Name each behavior change.
3. **Heavy** -- Vinxi/beta to Vite 8 Start 1.x, Rsbuild adoption, SPA/prerender migration, server-function architecture, framework/RSC adoption. Separately approved.
   Each step: files touched, expected effect, how to verify, how to roll back.

### 5. Fix

Only approved items, in small groups. After each: `tsc --noEmit`, lint, tests, `vite build` (or `rsbuild build`), then start the production server. A break must trace to one change. Do not mix a Start/Router/Vite major upgrade with optimization edits. If an approved change moves an auth check out of a server function, exposes server-only code to the client, or changes SSR output, stop and ask.

### 6. Verify and wrap up

Re-measure the same routes and scenario: route JS (raw/gzip), SSR TTFB, loader duration, navigation time, LCP/INP/CLS, and server-function latency. State plainly what could not be measured. End with deferred items and one suggested next step.

## Principles

- **Loaders are the data boundary.** Fetch in a loader (or server function), not in `useEffect`; component fetching creates waterfalls and layout shift.
- **Loaders are isomorphic.** They run on the server for the first request and in the browser on navigation; database, filesystem and secrets belong in `createServerFn`.
- **Server functions are public endpoints.** Enforce auth inside the handler or middleware; route `beforeLoad` is UX, not a security boundary.
- **Validate every boundary.** Search params, server-function input and server-route bodies all cross the network; use Zod/Standard Schema.
- **Cache deliberately.** Router `staleTime` defaults to 0 and preload data is fresh for 30s, retained for 5 minutes; set per-route freshness and `loaderDeps`, and invalidate after mutations.
- **SSR is per-route.** Full SSR by default; `data-only` for browser-only markup, `false` for client-only screens, SPA/prerender only with a reason.
- **Code splitting is on, but exports defeat it.** Do not export route components/options; check actual chunks, not the config.
- **One QueryClient per router.** A module-scope client leaks one user's cache into another user's SSR HTML.
- **Docs move.** Start v1 (Oct 2026) uses Vite 8, `validator()` and build plugins; Vinxi-era advice is stale. Check the installed version.
Pliki w paczce (12)
  • LICENSE 1 KB
  • README.md 1 KB
  • SKILL.md 7 KB
  • assets/report-template.md 2 KB
  • references/bundle-build.md 5 KB
  • references/data-caching.md 5 KB
  • references/rendering-ssr.md 5 KB
  • references/routing-loaders.md 5 KB
  • references/safety-quality.md 5 KB
  • references/server-functions.md 6 KB
  • references/tooling.md 4 KB
  • scripts/audit.py 20 KB

Wersje

W bazie nie ma innych skilli o nazwie tanstack-start-optimizer.

Migawka bazy z 13.11.2026 · wersja paczki 7f475e3ecd01 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 85svelte-optimizer
    Audytuje i optymalizuje strony SvelteKit i biblioteki Svelte 5: ładowanie danych, runes, hydratację, rozmiar paczek i adaptery, z pomiarami przed i po.
  • 100tanstack
    Obsługuje typowane TanStack w React: Query (pobieranie, cache, mutacje), Router (routing plikowy, parametry wyszukiwania, loadery) i Start (SSR, funkcje serwerowe).
  • 85solid-optimizer
    Audytuje i optymalizuje aplikacje SolidJS i SolidStart: reaktywność, waterfalle danych, SSR, rozmiar paczek i wdrożenie, z pomiarami przed i po.
  • 95tanstack-start
    Buduje aplikacje TanStack Start definiowane w JSON przez @json-render/tanstack-start: specyfikacje tras, routing splat, loadery SSR, metadane head, layouty i nawigację po stronie klienta.
  • 100tanstack-router
    Obejmuje routing plikowy TanStack Router w React: definicje tras, layouty, guardy uwierzytelniania, loadery i typowaną nawigację.
  • 100start-routing-data
    Pomaga ładować dane w trasach TanStack Start: izomorficzne loadery, TanStack Query w loaderze, mutacje i SSR dla pojedynczej trasy.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.