tanstack-query

Manages TanStack Query v6 server state in Svelte applications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/aydadevelop/turborepo-starter --skill tanstack-query-aydadevelop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/aydadevelop/turborepo-starter/tree/main/.agents/skills/tanstack-query
Command: npx skills add https://github.com/aydadevelop/turborepo-starter --skill tanstack-query-aydadevelop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines server-state management in Svelte applications, eliminating manual data fetching, caching, and synchronization complexities.

Core Features & Use Cases

  • Declarative Data Fetching: Define queries and mutations with clear keys and functions.
  • Automatic Caching & Revalidation: Handles caching, background updates, and cache invalidation automatically.
  • Optimistic Updates & SSR: Supports advanced patterns like optimistic UI updates and Server-Side Rendering prefetching.
  • Use Case: When building a dashboard that displays real-time user data, use this Skill to fetch user profiles, posts, and notifications, ensuring the UI is always up-to-date without manual refetching logic.

Quick Start

Use the tanstack-query skill to create a query for fetching todos from an API endpoint.

Frequently Asked Questions about tanstack-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage server state and data caching in Svelte applications?

Server state in Svelte applications is managed using TanStack Query v6, which enables declarative data fetching and automatic caching to eliminate manual synchronization complexities. It handles background revalidation to keep UI data up-to-date automatically.

What is the best way to handle data fetching and cache invalidation with oRPC in Svelte?

Data fetching and cache invalidation with oRPC are handled seamlessly through type-safe API interactions. The Skill integrates oRPC to ensure type safety during queries and mutations while automatically invalidating caches when underlying data changes.

How do I implement optimistic UI updates for mutations in SvelteKit?

Optimistic UI updates in SvelteKit are implemented by defining mutations that immediately reflect expected changes in the UI before server confirmation. The Skill supports this advanced pattern natively alongside automatic background revalidation.

Does TanStack Query v6 support Server-Side Rendering prefetching for SvelteKit?

Yes, TanStack Query v6 supports Server-Side Rendering (SSR) prefetching for SvelteKit. This allows you to fetch and prefetch data on the server before rendering, ensuring the client receives fully populated state for faster initial page loads.

How do I set up declarative queries to fetch real-time data in a Svelte dashboard?

Declarative queries for real-time dashboard data are set up by defining clear query keys and fetch functions. The Skill automatically handles caching and background updates, ensuring user profiles and notifications remain current without manual refetching logic.