tanstack-start · vercel-labs — Claude Code skill: JSON-defined TanStack Start apps
Gives the agent a recipe for building TanStack Start pages from a JSON spec, wiring routes, layouts and SSR loaders into the router.
Apache-2.0 245 installs ★ 19,802 updated 2026-10-24
npx skills add vercel-labs/json-render --skill tanstack-start -a claude-codeWhat tanstack-start does
The skill tells the agent how a StartAppSpec turns into TanStack Start routes, layouts, head metadata and SSR loaders. What's inside: guidance plus code samples. The app itself stays your job.
Three packages come first: @json-render/core, @json-render/react, @json-render/tanstack-start. Spread startComponentDefinitions into the generation catalog and Slot and Link resolve without hand-written React. Every layout needs a Slot element or the page has nowhere to mount. Dynamic routes read /posts/$slug; a splat reads /docs/$ and passes the rest under _splat.
Router loaders execute on the server and again in the browser. Credentials, database clients or server-only imports belong behind createServerFn, with getPageData and getHead wrapped inside. Skip that and server code lands in the client bundle.
What it helps with
- define every route of an app in one JSON object
- add a shared layout with navigation and a slot for pages
- handle a splat route and read the path from
_splat - pass per-page metadata into head with
getHead - generate static paths from
staticParams
Example prompts for the agent
- Add a
/posts/$slugroute toStartAppSpecand hook up thepostloader - Build a
mainlayout with aSlotelement and drop the page inside it - Wrap
getPageDataincreateServerFnso the database client stays on the server
How to install tanstack-start
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill tanstack-start -a claude-code2Manually: put the files in place
~/.claude/skills/tanstack-start/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tanstack-start/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill tanstack-start -a codex2Manually: put the files in place
.agents/skills/tanstack-start/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill tanstack-start -a cursor2Manually: put the files in place
.cursor/skills/tanstack-start/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vercel-labs/json-render skills/tanstack-start2Manually: put the files in place
.github/skills/tanstack-start/SKILL.md1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill tanstack-start -a gemini-cli2Platform CLI
gemini skills install https://github.com/vercel-labs/json-render --path skills/tanstack-startManually: put the files in place
.devin/skills/tanstack-start/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill tanstack-start -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tanstack-start
How do I install tanstack-start in Claude Code?
Run npx skills add vercel-labs/json-render --skill tanstack-start -a claude-code. The skill file lands at ~/.claude/skills/tanstack-start/SKILL.md.
What does tanstack-start do?
It teaches the agent to build a TanStack Start app from StartAppSpec: routes, layouts with Slot, head metadata, SSR loaders and client navigation.
Does it work for a plain TanStack Router app?
No. It targets apps that use @json-render/tanstack-start and a JSON spec; without json-render there is nothing for it to render.
Source text
SKILL.md · Apache-2.0
---
name: tanstack-start
description: Build JSON-defined TanStack Start applications with @json-render/tanstack-start. Use for Start route specs, splat routing, SSR loaders, head metadata, layouts, and client navigation. Do not use for generic TanStack Router apps that do not use json-render.
---
# @json-render/tanstack-start
Use this integration when a TanStack Start app needs complete pages or routes
described by json-render specs.
## Install
```bash
npm install @json-render/core @json-render/react @json-render/tanstack-start
```
## Application Spec
Include the server-safe built-in definitions in the generation catalog. The
renderer supplies their component implementations.
```typescript
import { defineCatalog } from "@json-render/core";
import {
schema,
startComponentDefinitions,
} from "@json-render/tanstack-start/server";
const catalog = defineCatalog(schema, {
components: {
...startComponentDefinitions,
Card: cardDefinition,
Shell: shellDefinition,
Navigation: navigationDefinition,
Home: homeDefinition,
Post: postDefinition,
},
actions: {},
});
```
Then use `StartAppSpec` and TanStack Router route patterns:
```typescript
import type { StartAppSpec } from "@json-render/tanstack-start";
export const spec: StartAppSpec = {
metadata: {
title: { default: "Site", template: "%s | Site" },
},
layouts: {
main: {
root: "shell",
elements: {
shell: { type: "Shell", props: {}, children: ["nav", "slot"] },
nav: { type: "Navigation", props: {}, children: [] },
slot: { type: "Slot", props: {}, children: [] },
},
},
},
routes: {
"/": {
layout: "main",
metadata: { title: "Home" },
page: {
root: "home",
elements: {
home: { type: "Home", props: {}, children: [] },
},
},
},
"/posts/$slug": {
layout: "main",
loader: "post",
staticParams: [{ slug: "hello" }],
page: {
root: "post",
elements: {
post: {
type: "Post",
props: { value: { $state: "/post" } },
children: [],
},
},
},
},
},
};
```
Routes use `/posts/$slug` for named parameters and `/docs/$` for a splat.
Splat loader parameters are slash-delimited strings under `_splat`. Escape
route-key slashes as `~1` when generating RFC 6902 patches.
Every layout needs a `Slot` element. Declare `Slot` and `Link` through
`startComponentDefinitions`; do not require consumers to register React
implementations for them.
## Server Helpers
```typescript
import { createStartApp } from "@json-render/tanstack-start/server";
export const { getPageData, getHead, getStaticPaths } = createStartApp({
spec,
loaders: {
post: async ({ slug }) => ({ post: await getPost(slug as string) }),
},
});
```
State merge precedence is application state, layout state, page state, then
loader data. `getHead` merges app and route metadata into TanStack `meta` and
`links` descriptors. `getStaticPaths` includes static routes plus dynamic
routes with `staticParams`. Convert its strings to `{ path }` objects for
TanStack Start's top-level `pages` plugin option. Loader params are URL-decoded,
while values from `staticParams` are URL-encoded in generated paths.
Route matching treats trailing slashes as optional and accepts encoded or
decoded pathname representations so loader data and metadata resolve the same
static route.
## Route Wiring
```tsx
import { createFileRoute, notFound } from "@tanstack/react-router";
import {
PageRenderer,
StartErrorBoundary,
StartLoading,
StartNotFound,
} from "@json-render/tanstack-start";
import { getHead, getPageData } from "@/lib/json-app";
export const Route = createFileRoute("/$")({
loader: async ({ location }) => {
const data = await getPageData({ pathname: location.pathname });
if (!data) throw notFound();
return data;
},
head: ({ match }) => getHead({ pathname: match.pathname }),
component: () => <PageRenderer {...Route.useLoaderData()} />,
pendingComponent: StartLoading,
errorComponent: StartErrorBoundary,
notFoundComponent: StartNotFound,
});
```
TanStack Router loaders run on both the server and client. If a spec factory or
named loader uses credentials, database clients, or server-only imports, wrap
`getPageData` and `getHead` in a TanStack Start `createServerFn`; do not import
that server code directly into an isomorphic route loader.
## Root Provider
Wrap the root route's `Outlet` with `StartAppProvider`. Render `HeadContent` so
metadata from `getHead` reaches the document.
```tsx
import {
createRootRoute,
HeadContent,
Outlet,
Scripts,
} from "@tanstack/react-router";
import { StartAppProvider } from "@json-render/tanstack-start";
import { spec } from "@/lib/spec";
export const Route = createRootRoute({
component: () => (
<html lang="en">
<head>
<HeadContent />
</head>
<body>
<StartAppProvider
registry={registry}
handlers={handlers}
spec={spec}
>
<Outlet />
</StartAppProvider>
<Scripts />
</body>
</html>
),
});
```
Use `StartLoading`, `StartErrorBoundary`, and `StartNotFound` for TanStack
Router's `pendingComponent`, `errorComponent`, and `notFoundComponent` options.
When `StartAppProvider` receives `spec`, each component selects the matched
route's corresponding fallback. Explicit fallback props override that lookup.
Pass named `$computed` implementations through `StartAppProvider.functions`.
The default error boundary invalidates the router and reruns a failed loader
when the user selects **Try again**.
Import React components from `@json-render/tanstack-start`. Import `schema`,
`createStartApp`, `matchRoute`, `resolveMetadata`, and static path helpers from
`@json-render/tanstack-start/server`.
© vercel-labs · Apache-2.0 · vercel-labs/json-render
Similar skills
All skills for Frontend and UI →tanstack-start by other authors comes first.