tanstack-query by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill tanstack-query适用于 TanStack Query v5 应用程序的全面性能优化指南。包含 8 个类别共 40 条规则,按影响优先级排序,以指导自动化重构和代码生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 查询键结构 | 关键 | tquery- |
| 2 | 缓存配置 | 关键 | cache- |
| 3 | 变更模式 | 高 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
mutation-| 4 | 预取与瀑布流 | 高 | prefetch- |
| 5 | 无限查询 | 中 | infinite- |
| 6 | Suspense 集成 | 中 | suspense- |
| 7 | 错误与重试处理 | 中 | error- |
| 8 | 渲染优化 | 低-中 | render- |
tquery-key-factories - 使用集中式的查询键工厂tquery-hierarchical-keys - 从通用到具体地构建键结构tquery-always-arrays - 始终使用数组作为查询键tquery-serializable-objects - 在键中使用可序列化的对象tquery-options-pattern - 使用 queryOptions 进行类型安全的共享tquery-colocate-keys - 将查询键与功能特性放在一起cache-staletime-gctime - 理解 staleTime 与 gcTime 的区别cache-global-defaults - 适当地配置全局默认值cache-placeholder-vs-initial - 正确使用 placeholderData 与 initialDatacache-invalidation-precision - 精确地使缓存失效cache-refetch-triggers - 控制自动重新获取的触发条件cache-enabled-option - 使用 enabled 选项处理条件查询mutation-optimistic-updates - 实现带回滚的乐观更新mutation-invalidate-onsettled - 在 onSettled 中使缓存失效,而不是 onSuccessmutation-cancel-queries - 在乐观更新前取消查询mutation-setquerydata - 使用 setQueryData 立即更新缓存mutation-avoid-parallel - 避免对相同数据进行并行变更prefetch-avoid-waterfalls - 避免请求瀑布流prefetch-on-hover - 在悬停时预取以提高感知速度prefetch-in-queryfn - 在 queryFn 中预取依赖数据prefetch-server-components - 在服务器组件中预取prefetch-flatten-api - 扁平化 API 以减少瀑布流infinite-max-pages - 使用 maxPages 限制无限查询的页数infinite-flatten-pages - 扁平化页面以便渲染infinite-refetch-behavior - 理解无限查询的重新获取行为infinite-loading-states - 正确处理无限查询的加载状态suspense-use-suspense-hooks - 使用 Suspense 钩子简化加载状态suspense-error-boundaries - 始终将 Suspense 与错误边界配对使用suspense-parallel-queries - 使用 useSuspenseQueries 组合 Suspense 查询suspense-boundaries-placement - 策略性地放置 Suspense 边界error-retry-config - 配置指数退避重试error-conditional-retry - 根据错误类型进行条件重试error-global-handler - 使用全局错误处理器处理常见错误error-display-patterns - 适当地显示错误error-throw-on-error - 结合错误边界使用 throwOnErrorrender-select-memoize - 记忆化 select 函数render-select-derived - 使用 select 派生数据并减少重新渲染render-notify-props - 使用 notifyOnChangeProps 限制重新渲染render-structural-sharing - 理解结构共享render-tracked-props - 避免解构所有属性阅读单独的参考文件以获取详细解释和代码示例:
references/{prefix}-{slug}.md每个参考文件包含:
orval 技能test-msw 技能react-19 技能要获取包含所有规则详情的完整指南:AGENTS.md
每周安装数
153
代码仓库
GitHub 星标数
86
首次出现
2026年1月20日
安全审计
安装于
opencode130
gemini-cli126
codex125
github-copilot119
cursor115
claude-code111
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.
Reference these guidelines when:
| 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- |
tquery-key-factories - Use centralized query key factoriestquery-hierarchical-keys - Structure keys from generic to specifictquery-always-arrays - Always use array query keystquery-serializable-objects - Use serializable objects in keystquery-options-pattern - Use queryOptions for type-safe sharingtquery-colocate-keys - Colocate query keys with featurescache-staletime-gctime - Understand staleTime vs gcTimecache-global-defaults - Configure global defaults appropriatelycache-placeholder-vs-initial - Use placeholderData vs initialData correctlycache-invalidation-precision - Invalidate with precisioncache-refetch-triggers - Control automatic refetch triggerscache-enabled-option - Use enabled for conditional queriesmutation-optimistic-updates - Implement optimistic updates with rollbackmutation-invalidate-onsettled - Invalidate in onSettled, not onSuccessmutation-cancel-queries - Cancel queries before optimistic updatesmutation-setquerydata - Use setQueryData for immediate cache updatesmutation-avoid-parallel - Avoid parallel mutations on same dataprefetch-avoid-waterfalls - Avoid request waterfallsprefetch-on-hover - Prefetch on hover for perceived speedprefetch-in-queryfn - Prefetch dependent data in queryFnprefetch-server-components - Prefetch in Server Componentsprefetch-flatten-api - Flatten API to reduce waterfallsinfinite-max-pages - Limit infinite query pages with maxPagesinfinite-flatten-pages - Flatten pages for renderinginfinite-refetch-behavior - Understand infinite query refetch behaviorinfinite-loading-states - Handle infinite query loading states correctlysuspense-use-suspense-hooks - Use Suspense hooks for simpler loading statessuspense-error-boundaries - Always pair Suspense with Error Boundariessuspense-parallel-queries - Combine Suspense queries with useSuspenseQueriessuspense-boundaries-placement - Place Suspense boundaries strategicallyerror-retry-config - Configure retry with exponential backofferror-conditional-retry - Use conditional retry based on error typeerror-global-handler - Use global error handler for common errorserror-display-patterns - Display errors appropriatelyerror-throw-on-error - Use throwOnError with Error Boundariesrender-select-memoize - Memoize select functionsrender-select-derived - Use select to derive data and reduce re-rendersrender-notify-props - Use notifyOnChangeProps to limit re-rendersrender-structural-sharing - Understand structural sharingrender-tracked-props - Avoid destructuring all propertiesRead individual reference files for detailed explanations and code examples:
references/{prefix}-{slug}.mdEach reference file contains:
orval skilltest-msw skillreact-19 skillFor the complete guide with all rules expanded: AGENTS.md
Weekly Installs
153
Repository
GitHub Stars
86
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode130
gemini-cli126
codex125
github-copilot119
cursor115
claude-code111
Flutter应用架构设计指南:分层结构、数据层实现与最佳实践
4,300 周安装