[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEJZZ1PH1WN29YK8MNQDEV":3,"skill-same:01M6FEJZZ1PH1WN29YK8MNQDEV":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6FEJZZ1PH1WN29YK8MNQDEV","tanstack-query",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Ftanstack-query\u002FSKILL.md",[],[18,19,20],"tanstack","tanstack query","query","2026-11-10 10:12:30",false,"# TanStack Query Best Practices\n\nComprehensive performance optimization guide for TanStack Query v5 applications. Contains 40 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.\n\n## When to Apply\n\nReference these guidelines when:\n- Writing new queries, mutations, or data fetching logic\n- Implementing caching strategies (staleTime, gcTime)\n- Reviewing code for performance issues or request waterfalls\n- Refactoring existing TanStack Query code\n- Implementing infinite queries, Suspense, or optimistic updates\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Query Key Structure | CRITICAL | `tquery-` |\n| 2 | Caching Configuration | CRITICAL | `cache-` |\n| 3 | Mutation Patterns | HIGH | `mutation-` |\n| 4 | Prefetching & Waterfalls | HIGH | `prefetch-` |\n| 5 | Infinite Queries | MEDIUM | `infinite-` |\n| 6 | Suspense Integration | MEDIUM | `suspense-` |\n| 7 | Error & Retry Handling | MEDIUM | `error-` |\n| 8 | Render Optimization | LOW-MEDIUM | `render-` |\n\n## Quick Reference\n\n### 1. Query Key Structure (CRITICAL)\n\n- `tquery-key-factories` - Use centralized query key factories\n- `tquery-hierarchical-keys` - Structure keys from generic to specific\n- `tquery-always-arrays` - Always use array query keys\n- `tquery-serializable-objects` - Use serializable objects in keys\n- `tquery-options-pattern` - Use queryOptions for type-safe sharing\n- `tquery-colocate-keys` - Colocate query keys with features\n\n### 2. Caching Configuration (CRITICAL)\n\n- `cache-staletime-gctime` - Understand staleTime vs gcTime\n- `cache-global-defaults` - Configure global defaults appropriately\n- `cache-placeholder-vs-initial` - Use placeholderData vs initialData correctly\n- `cache-invalidation-precision` - Invalidate with precision\n- `cache-refetch-triggers` - Control automatic refetch triggers\n- `cache-enabled-option` - Use enabled for conditional queries\n\n### 3. Mutation Patterns (HIGH)\n\n- `mutation-optimistic-updates` - Implement optimistic updates with rollback\n- `mutation-invalidate-onsettled` - Invalidate in onSettled, not onSuccess\n- `mutation-cancel-queries` - Cancel queries before optimistic updates\n- `mutation-setquerydata` - Use setQueryData for immediate cache updates\n- `mutation-avoid-parallel` - Avoid parallel mutations on same data\n\n### 4. Prefetching & Waterfalls (HIGH)\n\n- `prefetch-avoid-waterfalls` - Avoid request waterfalls\n- `prefetch-on-hover` - Prefetch on hover for perceived speed\n- `prefetch-in-queryfn` - Prefetch dependent data in queryFn\n- `prefetch-server-components` - Prefetch in Server Components\n- `prefetch-flatten-api` - Flatten API to reduce waterfalls\n\n### 5. Infinite Queries (MEDIUM)\n\n- `infinite-max-pages` - Limit infinite query pages with maxPages\n- `infinite-flatten-pages` - Flatten pages for rendering\n- `infinite-refetch-behavior` - Understand infinite query refetch behavior\n- `infinite-loading-states` - Handle infinite query loading states correctly\n\n### 6. Suspense Integration (MEDIUM)\n\n- `suspense-use-suspense-hooks` - Use Suspense hooks for simpler loading states\n- `suspense-error-boundaries` - Always pair Suspense with Error Boundaries\n- `suspense-parallel-queries` - Combine Suspense queries with useSuspenseQueries\n- `suspense-boundaries-placement` - Place Suspense boundaries strategically\n\n### 7. Error & Retry Handling (MEDIUM)\n\n- `error-retry-config` - Configure retry with exponential backoff\n- `error-conditional-retry` - Use conditional retry based on error type\n- `error-global-handler` - Use global error handler for common errors\n- `error-display-patterns` - Display errors appropriately\n- `error-throw-on-error` - Use throwOnError with Error Boundaries\n\n### 8. Render Optimization (LOW-MEDIUM)\n\n- `render-select-memoize` - Memoize select functions\n- `render-select-derived` - Use select to derive data and reduce re-renders\n- `render-notify-props` - Use notifyOnChangeProps to limit re-renders\n- `render-structural-sharing` - Understand structural sharing\n- `render-tracked-props` - Avoid destructuring all properties\n\n## How to Use\n\nRead individual reference files for detailed explanations and code examples:\n\n- [Section definitions](references\u002F_sections.md) - Category structure and impact levels\n- Reference files: `references\u002F{prefix}-{slug}.md`\n\nEach reference file contains:\n- Brief explanation of why it matters\n- Incorrect code example with explanation\n- Correct code example with explanation\n- Additional context and references\n\n## Related Skills\n\n- For generating type-safe query hooks, see `orval` skill\n- For mocking API responses in tests, see `test-msw` skill\n- For React 19 data fetching patterns, see `react-19` skill\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Ftanstack-query",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill tanstack-query",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill tanstack-query",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill tanstack-query","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Ftanstack-query\u002FSKILL.md",true,[],[49,63,73,82,88,95],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":59,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[54],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[60,61,62],"model","model hierarchy","model hierarchy skill",{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":69,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[68],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[93],{"categoryNo":55,"categoryName":56,"taxonomyType":57,"taxonomyTypeDesc":58},[90],{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[97]]