Tanstack Integration Best Practices

Best practices for integrating TanStack Query with TanStack Router and TanStack Start. Patterns for full-stack data flow, SSR, and caching coordination.

230 stars 19 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-integration-best-practices
Manual install
git clone --depth 1 https://github.com/DeckardGer/tanstack-agent-skills.git /tmp/tanstack-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/tanstack-agent-skills/skills/tanstack-integration ~/.claude/skills/tanstack-integration-best-practices

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# TanStack Integration Best Practices

Guidelines for integrating TanStack Query, Router, and Start together effectively. These patterns ensure optimal data flow, caching coordination, and type safety across the stack.

## When to Apply

- Setting up a new TanStack Start project
- Integrating TanStack Query with TanStack Router
- Configuring SSR with query hydration
- Coordinating caching between router and query
- Setting up type-safe data fetching patterns

## Rule Categories by Priority

| Priority | Category | Rules | Impact |
|----------|----------|-------|--------|
| CRITICAL | Setup | 3 rules | Foundational configuration |
| CRITICAL | SSR Integration | 1 rule | Router + Query SSR setup |
| HIGH | Data Flow | 4 rules | Correct data fetching patterns |
| MEDIUM | Caching | 3 rules | Performance optimization |
| MEDIUM | SSR | 2 rules | Additional SSR patterns |

## Quick Reference

### Setup (Prefix: `setup-`)

- `setup-query-client-context` — Pass QueryClient through router context
- `setup-provider-wrapping` — Correctly wrap with QueryClientProvider
- `setup-stale-time-coordination` — Coordinate staleTime between router and query

### Data Flow (Prefix: `flow-`)

- `flow-loader-query-pattern` — Use loaders with ensureQueryData
- `flow-suspense-query-component` — Use useSuspenseQuery in components
- `flow-mutations-invalidation` — Coordinate mutations with query invalidation
- `flow-server-functions-queries` — Use server functions for query functions
Read the full skill on GitHub

Details

Skill name
tanstack-integration-best-practices
Path
skills/tanstack-integration/SKILL.md
License
MIT
Repo updated
9 September 2026

FAQ

What does the Tanstack Integration Best Practices skill do?

Best practices for integrating TanStack Query with TanStack Router and TanStack Start. Patterns for full-stack data flow, SSR, and caching coordination.

How do I install the Tanstack Integration Best Practices skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-integration-best-practices. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Tanstack Integration Best Practices popular?

It lives in DeckardGer/tanstack-agent-skills, which has 230 GitHub stars and 19 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.