Tanstack query

From pproenca/dot-skills · View interactive version

Tanstack query is an AI agent skill from the GitHub repository pproenca/dot-skills. TanStack Query v5 performance optimization for data fetching, caching, mutations, and query patterns. This skill should be used when using useQuery, useMutation, queryClient, prefetch patterns, or TanStack Query caching. This skill does NOT cover generating query hooks from OpenAPI (use orval skill)

How to use this skill

Skill file

TanStack Query Best Practices

Comprehensive performance optimization guide for TanStack Query v5 applications. Contains 40 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

|----------|----------|--------|--------|

| 1 | Query Key Structure | CRITICAL | tquery- |

| 2 | Caching Configuration | CRITICAL | cache- |

| 3 | Mutation Patterns | HIGH | mutation- |

| 4 | Prefetching & Waterfalls | HIGH | prefetch- |

| 5 | Infinite Queries | MEDIUM | infinite- |

| 6 | Suspense Integration | MEDIUM | suspense- |

| 7 | Error & Retry Handling | MEDIUM | error- |

| 8 | Render Optimization | LOW-MEDIUM | render- |

Quick Reference

1. Query Key Structure (CRITICAL)

2. Caching Configuration (CRITICAL)

3. Mutation Patterns (HIGH)

4. Prefetching & Waterfalls (HIGH)

5. Infinite Queries (MEDIUM)

6. Suspense Integration (MEDIUM)

7. Error & Retry Handling (MEDIUM)

8. Render Optimization (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Each reference file contains:

Related Skills

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.