oakoss/agent-skills/tanstack-start

Claude Code and agent skill by oakoss/agent-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Full-stack React framework built on TanStack Router. Type-safe routing, server functions, SSR/streaming, middleware, and multi-platform deployment. Use when building full-stack React apps with SSR, server functions, middleware, or authentication. Use for createServerFn, createMiddleware, beforeLoad, API routes, Cloudflare Workers, Vercel, Netlify deployment.

Install

npx vskill@latest install oakoss/agent-skills/tanstack-start

SKILL.md

TanStack Start

Full-stack React framework built on TanStack Router. Type-safe server functions via RPC, SSR/streaming, middleware composition, and deployment to Cloudflare Workers, Vercel, Netlify, AWS Lambda, and more.

RC: TanStack Start is currently in Release Candidate status. APIs may still change before the stable 1.0 release.

Package: @tanstack/react-start

Quick Reference

PatternUsage
createServerFn()GET (default) — idempotent, cacheable data fetching
createServerFn({ method: 'POST' })Mutations that change data
.inputValidator(zodSchema)Input validation before handler
.handler(async ({ data }) => {})Server-side logic with typed input data
getRequest()Access full incoming Request inside handler/middleware
getRequestHeader(name)Read a single request header by name
setResponseHeaders(headers)Set outgoing response headers (caching, cookies)
useServerFn(fn)Wrap server function for component use with pending state
createMiddleware().server(fn)Request middleware for cross-cutting concerns
.middleware([dep])Compose middleware with dependencies
next({ context: {} })Pass data downstream through middleware chain
createMiddleware({ type: 'function' })Function-level middleware with input validation
requestMiddleware in createStart()Global middleware for all requests (SSR, fns, routes)
functionMiddleware in createStart()Global middleware for server functions only
createIsomorphicFn()Different implementations per environment
createServerOnlyFn()Server-only utility — crashes if called from client
createClientOnlyFn()Client-only utility — crashes if called from server
useSession()Cookie-based session with encryption and secure settings
session.update()Update session data
session.clear()Clear session (logout)
beforeLoadAuth check before route loads
_authenticated.tsxPathless layout route for grouped protection
throw redirect({ to: '/login' })Redirect with return URL
await ensureQueryData()Block SSR on critical data
prefetchQuery()Start fetch, don't block SSR
<Suspense> boundariesDefine streaming chunks
head: ({ loaderData }) => ({})Meta tags, Open Graph, favicons
head.scripts + JSON-LDStructured data for LLMO (schema.org)
llms.txt server routeAI system guidance file
headers: () => ({...})ISR / cache-control on route definition
server: { handlers: { GET, POST } }API routes on createFileRoute
ssr: falseDisable SSR for specific routes (SPA mode)

Execution Boundaries

FunctionRuns OnClient Can Call?Use For
createServerFn()ServerYes (RPC stub)Data fetching, mutations
createServerOnlyFn()ServerNo (throws)Secrets, DB connections
createClientOnlyFn()ClientN/AlocalStorage, DOM APIs
createIsomorphicFn()BothN/APer-environment implementations

Deployment (Vite Plugins)

PlatformPluginRuntime
Cloudflare@cloudflare/vite-pluginWorkers
Netlify@netlify/vite-plugin-tanstack-startNode
Vercelnitro/vite (preset: 'vercel')Node
Node.js/Dockernitro/vite (preset: 'node-server')Node
AWS Lambdanitro/vite (preset: 'aws-lambda')Node
Bunnitro/vite (preset: 'bun')Bun
Staticnitro/vite (preset: 'static')None

Common Mistakes

MistakeFix
No .inputValidator() on server functionsAlways validate with Zod schemas
Raw fetch instead of createServerFnLoses type safety, serialization, and code splitting
Mixing server/client code without boundariesUse createServerOnlyFn / createClientOnlyFn
Checking auth in every handlerUse middleware composition or beforeLoad
Awaiting all data in loaderOnly await critical data, prefetch the rest
Date.now() in renderPass timestamp from loader (hydration mismatch)
Missing nodejs_compat flagRequired in wrangler.toml for Cloudflare
GET for mutationsUse POST for create/update/delete
Cookies not forwarded to external APIsUse getRequestHeader() or createIsomorphicFn
process.env in loader (runs on both)Wrap in createServerFn — loaders run client-side too
Unvalidated server env varsValidate with Zod in .server.ts files
Storing auth tokens in localStorageUse HTTP-only cookies via useSession
Exposing raw DB errors to clientCatch and return user-friendly messages, log details
No structured data for content pagesAdd JSON-LD via head.scripts for AI discoverability

Delegation

Use this skill for TanStack Start server functions, middleware, SSR/streaming, route protection, API routes, and deployment configuration. Delegate to tanstack-router for file-based routing, search params, and data loading patterns. Delegate to tanstack-query for cache management, optimistic updates, and query patterns.

If the tanstack-form skill is available, delegate form state management, validation, and field patterns to it.
If the local-first skill is available, delegate local-first architecture decisions and sync engine selection to it.
If the electricsql skill is available, delegate ElectricSQL shapes, auth configuration, and write patterns to it.
If the tanstack-db skill is available, delegate reactive collections, live queries, and optimistic mutation patterns to it.

References

  • Server Functions — createServerFn, useServerFn, validation, auth, request context, response headers, file uploads, streaming, TanStack Query integration
  • Middleware — composition, function-level middleware, route-level middleware, global middleware, logging, rate limiting
  • SSR and Streaming — Suspense, prerendering, ISR, cache-control, hybrid strategies, hydration safety
  • Route Protection — beforeLoad, pathless layouts, session security, login/logout, header forwarding, Better Auth
  • API Routes — server handlers, REST patterns, route-level middleware, webhooks, health check, server functions vs server routes
  • Deployment — Vite plugins, adapter comparison, Cloudflare D1/KV/R2 bindings, Docker, prerendering
  • SEO and Head Management — head property, meta tags, Open Graph, Twitter Cards, favicons, SEO helper
  • LLM Optimization (LLMO) — JSON-LD structured data, schema.org, llms.txt, machine-readable endpoints, AI citation patterns
  • Error Handling — discriminated unions, custom error classes, status codes, result types vs try-catch
  • File Organization — entry points, plugin config, execution boundaries, env validation, .server.ts convention
  • Known Issues — 10 documented issues with workarounds
  • Query Integration — Router+Query setup, SSR integration, setupRouterSsrQueryIntegration, DevTools
  • Integration Flows — form submission with cache update, infinite scroll, paginated tables, auth-protected routes, error handling
  • Local-First Integration — shape proxy server functions, mixing server-based and local-first data, ElectricSQL deployment
  • Electric Middleware — auth middleware for shape proxies, global middleware config, sendContext, function-level validation

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
10
Repository forks
2
Repository npm downloads, 7 days
82
7-day trend score
24

Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 4 May 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/oakoss/agent-skills/tanstack-start/badge)](https://verified-skill.com/skills/oakoss/agent-skills/tanstack-start)

Something wrong with this skill or its page? Tell us.