pproenca avatar

Tanstack Query

This is a comprehensive performance optimization guide for TanStack Query v5 with 40 rules across 8 categories, from query key structure to render optimization. Use it when writing queries and mutations, implementing caching strategies, or debugging request waterfalls. The structure is practical: rules are prioritized by impact (critical to low-medium) and organized with prefixes like `tquery-`, `cache-`, and `mutation-` for quick reference. Each rule includes incorrect and correct code examples. The main value here is consolidating scattered best practices into a single reference that covers the full spectrum from basic staleTime vs gcTime configuration to advanced patterns like optimistic updates with rollback. Pairs well with the orval skill for generating hooks and test-msw for mocking.

skills.sh installs
858
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill tanstack-query --agent claude-code

Installs into .claude/skills of the current project.

Files

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:

  • Writing new queries, mutations, or data fetching logic
  • Implementing caching strategies (staleTime, gcTime)
  • Reviewing code for performance issues or request waterfalls
  • Refactoring existing TanStack Query code
  • Implementing infinite queries, Suspense, or optimistic updates

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Query Key StructureCRITICALtquery-
2Caching ConfigurationCRITICALcache-
3Mutation PatternsHIGHmutation-
4Prefetching & WaterfallsHIGHprefetch-
5Infinite QueriesMEDIUMinfinite-
6Suspense IntegrationMEDIUMsuspense-
7Error & Retry HandlingMEDIUMerror-
8Render OptimizationLOW-MEDIUMrender-

Quick Reference

1. Query Key Structure (CRITICAL)

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Frontend Development, Backend & APIs, Testing & QA, Debugging
First seen
Jun 3, 2026

More from pproenca/dot-skills

All 100
1astronomer avatarwarehouse-initastronomer/agentsInitialize warehouse schema discovery. Generates .astro/warehouse.md with all table metadata for instant lookups. Run once per project, refresh when schema chan841skills.sh installs
2makisuo avatareffect-best-practicesmakisuo/skillsEnforces Effect-TS patterns for services, errors, layers, and atoms. Use when writing code with Effect.Service, Schema.TaggedError, Layer composition, or effect841skills.sh installs
3netresearch avatarsecurity-auditnetresearch/security-audit-skillUse when conducting security assessments — OWASP Top 10 / API / LLM, CWE Top 25, CVSS scoring — auditing PHP/TYPO3, APIs, frontend, Terraform/K8s/Docker IaC, AW839skills.sh installs
4bitjaru avatarss-pagebitjaru/styleseedScaffold a new mobile page/screen using the StyleSeed layout patterns835skills.sh installs
5mindrally avatarthree-jsmindrally/skillsExpert guidance for Three.js and React Three Fiber development with modern React, TypeScript, and performance best practices834skills.sh installs
6daymade avatarscrapling-skilldaymade/claude-code-skillsInstall, troubleshoot, and use Scrapling CLI to extract HTML, Markdown, or text from webpages. Use this skill whenever the user mentions Scrapling, `uv tool ins827skills.sh installs