Skip to content
Back to skills

Tanstack Start

ASecurity

TanStack Start, Router, Query, and Server Functions patterns and best practices for this project.

  • 66 stars
  • 0 votes
  • 1 copy
  • 7 views
  • Added May 26, 2026
developmentreactapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add dlupiak/claude-session-dashboard --skill tanstack-start --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tanstack Start?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tanstack Start
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dlupiak-tanstack-start/badge)](https://www.skillsdirectory.com/skills/dlupiak-tanstack-start)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tanstack-start
description: TanStack Start, Router, Query, and Server Functions patterns and best practices for this project.
user-invocable: true
---

# TanStack Start Patterns

## Server Functions
- Define with `createServerFn` from `@tanstack/react-start`
- Use `.validator()` for input validation (e.g. with zod)
- Use `.handler()` for the implementation
- Server functions run on the server only — safe for DB access and secrets

## Router
- File-based routing in `src/routes/`
- Use `createFileRoute` for route definitions
- Use `loader` for server-side data fetching (runs on server)
- Use `beforeLoad` for auth guards and redirects
- Route context flows from `__root.tsx` to child routes

## Query
- Use `queryOptions` to define reusable query configs
- Use `useSuspenseQuery` in components for data fetching
- Invalidate queries after mutations with `queryClient.invalidateQueries()`
- TanStack Query handles caching, deduplication, and background refetching

## Key Conventions
- Path alias: `@/` → `apps/web/src/`
- Route files: `src/routes/<path>.tsx`
- Layouts: `src/routes/_<layout>.tsx` (pathless layout routes)
- API routes: `src/routes/api/<name>.ts`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…