start-execution-model

Diagnose and fix server/client execution boundary bugs in TanStack Start applications.

1|Updated Jul 29, 2026
One-click install
npx skills add https://github.com/fusengine/kimi-code --skill start-execution-model-fusengine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: start-execution-model
Source: https://github.com/fusengine/kimi-code/tree/main/plugins/tanstack-start-expert/skills/start-execution-model
Command: npx skills add https://github.com/fusengine/kimi-code --skill start-execution-model-fusengine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? TanStack Start modules are isomorphic by default, so code runs in both server and client bundles — causing secret leaks, DB-in-loader bugs, undefined env vars on edge runtimes, and hydration mismatches. This Skill provides the mental model and boundary APIs to place code in the correct environment. ## Core Features & Use Cases - Boundary API Reference: Covers createServerFn, createServerOnlyFn, createClientOnlyFn, createIsomorphicFn, <ClientOnly>, useHydrated(), and server-only/client-only import markers with a decision framework for choosing between them. - Environment Variable Safety: Explains VITE_/PUBLIC_ client exposure versus process.env server reads, and why env must be read per request rather than at module scope. - Copy-Paste Templates: Complete working examples of every boundary pattern, including loaders calling server functions and hydration-safe rendering. - Use Case: You discover an API secret visible in the browser bundle. Use this Skill to move the secret access into a createServerFn handler and remove the public prefix from the variable. ## Quick Start Ask the agent to review your TanStack Start route loaders and move any database or secret access into createServerFn handlers.

Frequently Asked Questions about start-execution-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep secrets out of the client bundle in TanStack Start?▼

Move all secret access into a createServerFn or createServerOnlyFn handler, never a bare loader or module scope. Also ensure the variable has no VITE_ or PUBLIC_ prefix, since prefixed variables are exposed to the client bundle.

Why is process.env undefined in my TanStack Start app on Cloudflare Workers?▼

Edge runtimes inject environment variables at request time, so module-level reads happen before the values exist. Read process.env inside the per-request handler of a createServerFn, middleware .server() callback, or server route instead of at module scope.

What is the difference between createServerFn and createServerOnlyFn?▼

createServerFn is an RPC boundary: on the client the call becomes a network request, on the server it executes directly. createServerOnlyFn is a hard guard for server utilities that throws if reached on the client, with no network round trip.

How do I fix hydration mismatch errors in TanStack Start?▼

Hydration mismatches come from non-deterministic render output like calling new Date() directly in JSX. Render a deterministic placeholder on the server, then fill in the value after mount using useEffect, useHydrated(), or the ClientOnly component.

Can I mark a whole file as server-only in TanStack Start?▼

Yes. Use the *.server.ts filename suffix or add the side-effect import '@tanstack/react-start/server-only' at the top of the file. Client-side imports of that file are then denied, with error mode in production builds and mock mode in dev.