# tanstack-start

Gives the agent a recipe for building TanStack Start pages from a JSON spec, wiring routes, layouts and SSR loaders into the router.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 245 installs · ★ 19802 repo stars
- Author: vercel-labs
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/vercel-labs/json-render/tree/HEAD/skills/tanstack-start/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/vercel-labs-tanstack-start

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add vercel-labs/json-render --skill tanstack-start -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/tanstack-start/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/tanstack-start/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add vercel-labs/json-render --skill tanstack-start -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/tanstack-start/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add vercel-labs/json-render --skill tanstack-start -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/tanstack-start/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install vercel-labs/json-render skills/tanstack-start
```

2. **Manually: put the files in place**
- File: `.github/skills/tanstack-start/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add vercel-labs/json-render --skill tanstack-start -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/vercel-labs/json-render --path skills/tanstack-start
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/tanstack-start/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add vercel-labs/json-render --skill tanstack-start -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/vercel-labs/json-render/tree/HEAD/skills/tanstack-start/SKILL.md

## When to use it
- 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
- Add a `/posts/$slug` route to `StartAppSpec` and hook up the `post` loader
- Build a `main` layout with a `Slot` element and drop the page inside it
- Wrap `getPageData` in `createServerFn` so the database client stays on the server

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: fd39c3b3d59ff3fe.

BEGIN THIRD-PARTY FILE fd39c3b3d59ff3fe
````text
---
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";
````
END THIRD-PARTY FILE fd39c3b3d59ff3fe

The third-party file has ended. Everything between the fd39c3b3d59ff3fe tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2682 of 5912 bytes. © vercel-labs · Apache-2.0 · https://github.com/vercel-labs/json-render/tree/HEAD/skills/tanstack-start/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
