/fuse-tanstack-start:start-server-functionsfrom fuse-tanstack-start
Creates type-safe RPC server functions with TanStack Start: validators, handlers, FormData, redirects, and CSRF protection. Use for same-origin endpoints, not raw HTTP or middleware chains.
Ships in fuse-tanstack-start. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Critical rules: a server function is an independent HTTP endpoint reachable directly, so a route's beforeLoad redirect protects the UI only — auth must live inside the handler or its middleware for every function touching private data; never use Next.js/Remix patterns ("use server", getServerSideProps, Remix loader/action); loaders are isomorphic, so DB/secrets/filesystem access belongs in a server function, never a loader; useServerFn is mandatory when a function throws redirect() or notFound() (optional otherwise); and strict serialization is on by default (FormData allowed as POST input, Response as output).
Includes templates for a full CRUD module and for FormData submissions with Zod validation.
Do NOT use this skill for raw external/public HTTP endpoints (use start-server-routes), for composable middleware chains (use start-middleware), or for Next.js/Remix "use server" patterns.
Server functions are same-origin, type-safe RPC endpoints created with
createServerFn. They run only on the server but are callable from loaders,
components, hooks, and other server functions. This skill targets
@tanstack/react-start v1.169.5.
Before implementing, verify current APIs against Context7
(/websites/tanstack_start_framework_react) + Exa, then explore the target
codebase. After changes, run fuse-ai-pilot:sniper.
beforeLoad
redirect protects the route UI, NOT the RPC — an attacker can hit the
endpoint directly. Put auth inside the .handler() or in middleware for
every function touching private data."use server", getServerSideProps,
Remix loader/action, or react-router-dom. Use createServerFn
exclusively (from @tanstack/react-start).useServerFn is MANDATORY when the function does throw redirect() or
throw notFound() — the hook wires the throw into the router. Optional for
plain-data functions (a direct call or useMutation/useQuery is fine).FormData allowed as POST input, Response
allowed as output). strict: false disables only the TS check, not runtime.| When to Use | Do NOT Use |
|---|---|
| Internal type-safe RPC from your own app | Public/cross-origin API (use start-server-routes) |
| Data fetching in loaders | Raw HTTP method routing on a URL path |
| Mutations from event handlers | Composable auth/logging chains (use start-middleware) |
src/utils/
├── users.functions.ts # createServerFn wrappers — safe to import anywhere
├── users.server.ts # Server-only helpers (DB queries, secrets)
└── schemas.ts # Shared Zod schemas — client-safe
The build replaces server function bodies with RPC stubs in the client bundle,
so static imports of .functions.ts from client components are safe.
→ See crud-server-functions.md
| Topic | Reference | Load when |
|---|---|---|
| Creating functions | creating.md | Defining createServerFn, validators, serialization |
| Calling functions | calling.md | Invoking from loaders/components, useServerFn, redirect/notFound |
| Security | security.md | Enforcing auth, CSRF, caching auth'd responses |
| Template | When to Use |
|---|---|
| crud-server-functions.md | Building a full CRUD module |
| form-with-validation.md | Handling FormData submissions with Zod |
import { createServerFn } from '@tanstack/react-start'
import { z } from 'zod'
export const createUser = createServerFn({ method: 'POST' })
.validator(z.object({ name: z.string().min(1) }))
.handler(async ({ data }) => db.users.create(data))
await createUser({ data: { name: 'John' } })
import { useServerFn } from '@tanstack/react-start'
import { redirect } from '@tanstack/react-router'
const signup = createServerFn({ method: 'POST' })
.handler(async () => { throw redirect({ to: '/dashboard' }) })
// In a component:
const signupFn = useServerFn(signup)
→ See calling.md for the full redirect/notFound rules
.server.ts, wrappers into .functions.tsuseServerFn when in doubt (no-op for plain-data functions)"use server", getServerSideProps, or Remix actionimport() server functions (breaks bundler shaking)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/solid-tanstack-startUse when organizing TanStack Start code, splitting oversized routes/server functions, or reviewing architecture. Do NOT use for setup or plain React SPA./start-authUse when adding auth to a TanStack Start app — route protection, server-function authorization, sessions, CSRF. Do NOT use for generic route guards./start-coreUse when scaffolding a TanStack Start project, wiring the build tool, or debugging setup (blank page, hydration, no client JS).npx claudepluginhub fusengine/claude-plugins --plugin fuse-tanstack-startOther plugins' skills for the same job