lov-install-tanstack-query

Featured

Initialize or refactor a frontend project to use TanStack Query as the unified server-state layer. Use when the user asks to install TanStack Query, initialize query infrastructure, migrate ad hoc fetch/invoke/useEffect request state, standardize query keys, or make app network requests share one cache model. Also trigger when the user mentions "初始化 TanStack Query", "重构网络请求", "统一请求缓存", "install-tanstack-query", "TanStack Query refactor", or "useInvokeQuery".

AI & Automation 64 stars 16 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
60
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# install-tanstack-query — TanStack Query 初始化与重构 Use this skill to add TanStack Query to a project or refactor existing request state into a shared query/mutation layer. ## When to Use - The user asks to install or initialize TanStack Query / React Query. - The project has repeated `useEffect + useState + fetch/invoke` request code. - The user wants all network-backed reads to share cache, refetch, invalidation, and loading/error behavior. - A Tauri app uses many `invoke()` reads that should be treated as server state. - The user mentions RTK Query but the project already uses, or prefers, TanStack Query. ## Workflow ### Step 1: Read Local Rules First Before changing files, inspect local instructions and project shape: ```bash pwd find .. -name AGENTS.md -print rg -n "@tanstack/react-query|react-query|@reduxjs/toolkit|createApi|useQuery|useMutation|fetch\\(|invoke\\(" package.json src app pages components 2>/dev/null ``` Honor project-specific constraints. If local instructions say not to run `build`, do not run it. Prefer `rg` and inspect existing patterns before adding new abstractions. ### Step 2: Classify Request Code Separate code into three buckets: | Bucket | Examples | TanStack Query? | |---|---|---| | Server state reads | list/get/search/version/status/catalog/settings loaded from network or Tauri backend | Yes, `useQuery` | | Server state writes | save/delete/toggle/install request, followed by cache changes | Yes, `useMutation` | | Imperative side ef...

Details

Author
lovstudio
Repository
lovstudio/skills
Created
4 months ago
Last Updated
today
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category