accelint-tanstack-query-best-practices

Official

Master TanStack Query patterns for reliable UI.

Authorgohypergiant
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill provides expert patterns and best practices for using TanStack Query in React applications, guiding setup, caching strategies, mutation lifecycles, and server-client hydration to prevent data leakage and improve UI reliability.

Core Features & Use Cases

  • Centralized query key factories and hierarchical invalidation to keep server and client caches in sync.
  • Comprehensive mutation patterns (pessimistic and optimistic) with lifecycle guidance (onMutate, onError, onSettled).
  • Server-side hydration and streaming with Next.js App Router, including streaming support via shouldDehydrateQuery.
  • Targeted troubleshooting and pitfall guidance for observer economics, cache invalidation, and performance tuning.

Quick Start

  • Read guidance in references/query-client-setup.md, references/server-integration.md, and references/patterns-and-pitfalls.md to configure a robust TanStack Query client.
  • Implement a shared keys factory (keys.all, keys.detail) and reuse it across server and client layers for unified invalidation.
  • Encapsulate queries in custom hooks (e.g., useTrack, useAllTracks) to avoid closure bugs and to centralize configuration.

Dependency Matrix

Required Modules

None required

Components

assetsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: accelint-tanstack-query-best-practices
Download link: https://github.com/gohypergiant/agent-skills/archive/main.zip#accelint-tanstack-query-best-practices

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.