🎯

tanstack-start-best-practices

🎯Skill

from deckardger/tanstack-agent-skills

VibeIndex|
What it does

Provides AI-guided best practices and coding guidelines for implementing server functions, security, middleware, and full-stack architecture in TanStack Start applications.

tanstack-start-best-practices

Installation

Install skill:
npx skills add https://github.com/deckardger/tanstack-agent-skills --skill tanstack-start-best-practices
96
AddedJan 27, 2026

Skill Details

SKILL.md

Overview

# TanStack Agent Skills

Comprehensive best practices for building applications with the TanStack ecosystem. These skills provide AI coding agents with structured guidelines for TanStack Query, TanStack Router, and TanStack Start.

Available Skills

[tanstack-query](./skills/tanstack-query/)

Best practices for data fetching, caching, mutations, and server state management with TanStack Query (React Query).

32+ rules across 8 categories:

  • Query Keys (CRITICAL) β€” Proper key structure and organization
  • Caching (CRITICAL) β€” staleTime, gcTime, and invalidation patterns
  • Mutations (HIGH) β€” Optimistic updates, error handling
  • Error Handling (HIGH) β€” Error boundaries, retry logic
  • Prefetching (MEDIUM) β€” Intent-based and route prefetching
  • Infinite Queries (MEDIUM) β€” Pagination patterns
  • SSR Integration (MEDIUM) β€” Hydration and dehydration
  • Performance (LOW) β€” Select transforms, memoization

[tanstack-router](./skills/tanstack-router/)

Best practices for type-safe routing, data loading, search params, and navigation with TanStack Router.

30+ rules across 8 categories:

  • Type Safety (CRITICAL) β€” Router registration, type narrowing
  • Route Organization (CRITICAL) β€” File-based routing, route trees
  • Data Loading (HIGH) β€” Loaders, Query integration
  • Search Params (HIGH) β€” Validation, type inheritance
  • Navigation (MEDIUM) β€” Link component, active states
  • Code Splitting (MEDIUM) β€” Lazy routes, critical path
  • Preloading (MEDIUM) β€” Intent-based preloading
  • Route Context (LOW) β€” Dependency injection

[tanstack-start](./skills/tanstack-start/)

Best practices for full-stack React applications with TanStack Start, including server functions, middleware, SSR, and authentication.

29+ rules across 8 categories:

  • Server Functions (CRITICAL) β€” createServerFn patterns
  • Security (CRITICAL) β€” Input validation, CSRF protection
  • Middleware (HIGH) β€” Request/function middleware
  • Authentication (HIGH) β€” Sessions, route protection
  • SSR (MEDIUM) β€” Hydration safety, streaming
  • Error Handling (MEDIUM) β€” Server errors, redirects
  • File Organization (LOW) β€” Code separation patterns
  • Deployment (LOW) β€” Environment config

[tanstack-integration](./skills/tanstack-integration/)

Best practices for integrating TanStack Query with TanStack Router and TanStack Start together.

13 rules across 4 categories:

  • Setup (CRITICAL) β€” QueryClient context, provider wrapping
  • Data Flow (HIGH) β€” Loader + Query patterns
  • Caching (MEDIUM) β€” Single source of truth
  • SSR (LOW) β€” Dehydration/hydration

Installation

```bash

npx add-skill tanstack-agent-skills

```

Or manually add to your project's .cursor/ or Claude Code configuration.

Usage

Skills activate automatically when AI agents detect relevant contexts:

  • Building data-driven React applications
  • Setting up routing for React apps
  • Creating full-stack applications with SSR
  • Implementing authentication flows
  • Optimizing data fetching patterns

Skill Format

Each skill follows the [Agent Skills](https://agentskills.io/) standard:

```

skills/

β”œβ”€β”€ tanstack-query/

β”‚ β”œβ”€β”€ SKILL.md # Main skill instructions

β”‚ └── rules/ # Individual rule files

β”‚ β”œβ”€β”€ qk-array-structure.md

β”‚ β”œβ”€β”€ cache-stale-time.md

β”‚ └── ...

β”œβ”€β”€ tanstack-router/

β”‚ β”œβ”€β”€ SKILL.md

β”‚ └── rules/

β”œβ”€β”€ tanstack-start/

β”‚ β”œβ”€β”€ SKILL.md

β”‚ └── rules/

└── tanstack-integration/

β”œβ”€β”€ SKILL.md

└── rules/

```

Rule File Structure

Each rule file contains:

  1. Priority β€” CRITICAL, HIGH, MEDIUM, or LOW
  2. Explanation β€” Why this pattern matters
  3. Bad Example β€” Anti-pattern to avoid with explanation
  4. Good Example β€” Recommended implementation
  5. Context β€” When to apply or skip the rule

Contributing

Contributions welcome! Please ensure:

  • Rules are practical and battle-tested
  • Examples are clear and runnable
  • Priority levels are appropriate
  • Context helps agents decide applicability

Resources

  • [TanStack Query Docs](https:/