[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758TSTFVCF8GB4CM626VJ3V":3,"skill-same:01M758TSTFVCF8GB4CM626VJ3V":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":28,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M758TSTFVCF8GB4CM626VJ3V","react-query-cache-utilities",null,"Use TanStack React Query with auto-generated hooks from @repo\u002Fapi-client (preferred) or a centralized QueryKeys enum and cache utility for manual setup","CliqRelay\u002Fcliqrelay","CliqRelay","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F290753656?v=4","01M758RPDEB11FEYA2XK17DSHA","01M758RPEKP0NKH6P43GD2FBDG",41,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffrontend\u002Freact-query-cache-utilities\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: react-query-cache-utilities\ndescription: Use TanStack React Query with auto-generated hooks from @repo\u002Fapi-client (preferred) or a centralized QueryKeys enum and cache utility for manual setup\n---\n\n# React Query Cache Utilities\n\n> This skill covers `@tanstack\u002Freact-query`.\n\nThis project uses React Query (`@tanstack\u002Freact-query`) for server state caching. There are two patterns:\n\n1. **Auto-generated hooks from `@repo\u002Fapi-client`** — preferred for covered domains\n2. **Manual setup** — for domains not covered by `@repo\u002Fapi-client`\n\n---\n\n## Pattern A: Auto-generated Hooks from `@repo\u002Fapi-client` (Preferred)\n\nFor domains covered by `@repo\u002Fapi-client`, all React Query hooks are auto-generated by Orval:\n\n```typescript\n\u002F\u002F Extension app — in a component\nimport { useGetAllGuides, useCreateGuide, useDeleteGuide } from \"@repo\u002Fapi-client\";\n\nfunction GuideList() {\n  \u002F\u002F Query hook with auto-generated query keys, caching, and refetching\n  const { data, isLoading, error } = useGetAllGuides();\n\n  \u002F\u002F Mutation hook with auto-generated invalidate logic\n  const deleteMutation = useDeleteGuide({\n    mutation: {\n      onSuccess: () => {\n        showToastSuccess(\"Guide deleted\");\n      },\n      onError: (error) => {\n        showToastError(\"Error\", error.message);\n      },\n    },\n  });\n\n  \u002F\u002F ...\n}\n```\n\n### ✅ DO — Use auto-generated hooks as the primary pattern\n### ✅ DO — Use standard TanStack Query patterns (loading, error, success callbacks)\n### ❌ DON'T — Write manual query hooks for domains covered by `@repo\u002Fapi-client`\n\n---\n\n## Pattern B: Manual Setup (Non-api-client Domains)\n\nFor domains not covered by `@repo\u002Fapi-client`, use manual React Query setup:\n\n- **`useQuery` \u002F `useMutation`** — for component-level data fetching\n- **`fetchCachedDataOrFetchNewQuery`** — for app boot hydration into Zustand stores\n- **`QueryKeys`** — centralized enum for all cache keys\n\n### Folder Structure\n\n```\nconstants\u002F\n├── query-keys.ts        ← QueryKeys enum ONLY\n├── query-client.ts      ← QueryClient instance + cache utility\n└── env.ts\n```\n\n### QueryClient Setup (`constants\u002Fquery-client.ts`)\n\n```typescript\nimport { QueryClient } from \"@tanstack\u002Freact-query\";\n\nexport const queryClient = new QueryClient();\n```\n\n### QueryKeys Enum (`constants\u002Fquery-keys.ts`)\n\nAll cache keys are centralized in a single enum:\n\n```typescript\n\u002F\u002F constants\u002Fquery-keys.ts\nexport enum QueryKeys {\n  GET_USER_ME = \"get_user_me\",\n  INVENTORY = \"inventory\",\n  PRODUCT = \"product\",\n  PRODUCTS = \"products\",\n  \u002F\u002F ...\n}\n```\n\n### ✅ DO — All query keys in the enum, no inline string literals\n### ❌ DON'T — Use string literals as query keys\n\n```typescript\n\u002F\u002F ❌ DON'T\nuseQuery([\"get_user_me\"], getUserMe);\n\n\u002F\u002F ✅ DO\nuseQuery([QueryKeys.GET_USER_ME], getUserMe);\n```\n\n### Cache Utility (`constants\u002Fquery-client.ts`)\n\nThis utility is used specifically for **app boot hydration** — loading cached or fresh data into Zustand stores before the first render:\n\n```typescript\n\u002F\u002F constants\u002Fquery-client.ts\nexport const fetchCachedDataOrFetchNewQuery = async \u003CT>(\n  queryKey: QueryKey,\n  queryFn: () => Promise\u003Cunknown>\n): Promise\u003CT | null> => {\n  const cachedData: any | undefined = queryClient.getQueryData(queryKey);\n\n  if (cachedData) {\n    return cachedData as T;\n  }\n\n  const fetchedQueryData: any = await queryClient.fetchQuery({\n    queryKey,\n    queryFn: async () => {\n      try {\n        return await queryFn();\n      } catch (error: any) {\n        console.error(error);\n        return null;\n      }\n    },\n    staleTime: 60 * 1000\n  });\n\n  return fetchedQueryData;\n};\n```\n\n### Usage: Boot Hydration into Zustand Stores\n\n```typescript\nasync function bootstrapApp() {\n  const userData = await fetchCachedDataOrFetchNewQuery(\n    [QueryKeys.GET_USER_ME],\n    getCurrentUser\n  );\n\n  if (userData) {\n    useSessionStore.getState().setUser(userData);\n  } else {\n    useSessionStore.getState().setUser(null);\n  }\n}\n```\n\n---\n\n## When to Use What\n\n| Scenario | Pattern | Tool |\n|----------|---------|------|\n| Extension app, api-client covers the domain | Auto-generated hooks | `useGetAllGuides`, `useCreateGuide`, etc. |\n| Web app, client-side caching needed | Standard React Query | `useQuery` \u002F `useMutation` |\n| App boot, hydrate store (non-api-client) | Manual cache utility | `fetchCachedDataOrFetchNewQuery` |\n| Invalidating cache (non-api-client) | Manual | `queryClient.invalidateQueries()` |\n\n## Rules\n\n### ✅ DO\n- Use auto-generated hooks from `@repo\u002Fapi-client` for covered domains\n- Put `QueryKeys` enum in `constants\u002Fquery-keys.ts` (non-api-client domains)\n- Put `QueryClient` + `fetchCachedDataOrFetchNewQuery` in `constants\u002Fquery-client.ts` (non-api-client domains)\n- Use `fetchCachedDataOrFetchNewQuery` only for app boot \u002F context provider hydration\n- Cache-first: always check cache before network\n\n### ❌ DON'T\n- Don't write manual query hooks for domains covered by `@repo\u002Fapi-client`\n- Don't use `fetchCachedDataOrFetchNewQuery` in components — it's for boot hydration only\n- Don't inline query key strings — always use `QueryKeys`\n- Don't forget `staleTime` when using `fetchCachedDataOrFetchNewQuery`\n","# React Query Cache Utilities\n\n> This skill covers `@tanstack\u002Freact-query`.\n\nThis project uses React Query (`@tanstack\u002Freact-query`) for server state caching. There are two patterns:\n\n1. **Auto-generated hooks from `@repo\u002Fapi-client`** — preferred for covered domains\n2. **Manual setup** — for domains not covered by `@repo\u002Fapi-client`\n\n---\n\n## Pattern A: Auto-generated Hooks from `@repo\u002Fapi-client` (Preferred)\n\nFor domains covered by `@repo\u002Fapi-client`, all React Query hooks are auto-generated by Orval:\n\n```typescript\n\u002F\u002F Extension app — in a component\nimport { useGetAllGuides, useCreateGuide, useDeleteGuide } from \"@repo\u002Fapi-client\";\n\nfunction GuideList() {\n  \u002F\u002F Query hook with auto-generated query keys, caching, and refetching\n  const { data, isLoading, error } = useGetAllGuides();\n\n  \u002F\u002F Mutation hook with auto-generated invalidate logic\n  const deleteMutation = useDeleteGuide({\n    mutation: {\n      onSuccess: () => {\n        showToastSuccess(\"Guide deleted\");\n      },\n      onError: (error) => {\n        showToastError(\"Error\", error.message);\n      },\n    },\n  });\n\n  \u002F\u002F ...\n}\n```\n\n### ✅ DO — Use auto-generated hooks as the primary pattern\n### ✅ DO — Use standard TanStack Query patterns (loading, error, success callbacks)\n### ❌ DON'T — Write manual query hooks for domains covered by `@repo\u002Fapi-client`\n\n---\n\n## Pattern B: Manual Setup (Non-api-client Domains)\n\nFor domains not covered by `@repo\u002Fapi-client`, use manual React Query setup:\n\n- **`useQuery` \u002F `useMutation`** — for component-level data fetching\n- **`fetchCachedDataOrFetchNewQuery`** — for app boot hydration into Zustand stores\n- **`QueryKeys`** — centralized enum for all cache keys\n\n### Folder Structure\n\n```\nconstants\u002F\n├── query-keys.ts        ← QueryKeys enum ONLY\n├── query-client.ts      ← QueryClient instance + cache utility\n└── env.ts\n```\n\n### QueryClient Setup (`constants\u002Fquery-client.ts`)\n\n```typescript\nimport { QueryClient } from \"@tanstack\u002Freact-query\";\n\nexport const queryClient = new QueryClient();\n```\n\n### QueryKeys Enum (`constants\u002Fquery-keys.ts`)\n\nAll cache keys are centralized in a single enum:\n\n```typescript\n\u002F\u002F constants\u002Fquery-keys.ts\nexport enum QueryKeys {\n  GET_USER_ME = \"get_user_me\",\n  INVENTORY = \"inventory\",\n  PRODUCT = \"product\",\n  PRODUCTS = \"products\",\n  \u002F\u002F ...\n}\n```\n\n### ✅ DO — All query keys in the enum, no inline string literals\n### ❌ DON'T — Use string literals as query keys\n\n```typescript\n\u002F\u002F ❌ DON'T\nuseQuery([\"get_user_me\"], getUserMe);\n\n\u002F\u002F ✅ DO\nuseQuery([QueryKeys.GET_USER_ME], getUserMe);\n```\n\n### Cache Utility (`constants\u002Fquery-client.ts`)\n\nThis utility is used specifically for **app boot hydration** — loading cached or fresh data into Zustand stores before the first render:\n\n```typescript\n\u002F\u002F constants\u002Fquery-client.ts\nexport const fetchCachedDataOrFetchNewQuery = async \u003CT>(\n  queryKey: QueryKey,\n  queryFn: () => Promise\u003Cunknown>\n): Promise\u003CT | null> => {\n  const cachedData: any | undefined = queryClient.getQueryData(queryKey);\n\n  if (cachedData) {\n    return cachedData as T;\n  }\n\n  const fetchedQueryData: any = await queryClient.fetchQuery({\n    queryKey,\n    queryFn: async () => {\n      try {\n        return await queryFn();\n      } catch (error: any) {\n        console.error(error);\n        return null;\n      }\n    },\n    staleTime: 60 * 1000\n  });\n\n  return fetchedQueryData;\n};\n```\n\n### Usage: Boot Hydration into Zustand Stores\n\n```typescript\nasync function bootstrapApp() {\n  const userData = await fetchCachedDataOrFetchNewQuery(\n    [QueryKeys.GET_USER_ME],\n    getCurrentUser\n  );\n\n  if (userData) {\n    useSessionStore.getState().setUser(userData);\n  } else {\n    useSessionStore.getState().setUser(null);\n  }\n}\n```\n\n---\n\n## When to Use What\n\n| Scenario | Pattern | Tool |\n|----------|---------|------|\n| Extension app, api-client covers the domain | Auto-generated hooks | `useGetAllGuides`, `useCreateGuide`, etc. |\n| Web app, client-side caching needed | Standard React Query | `useQuery` \u002F `useMutation` |\n| App boot, hydrate store (non-api-client) | Manual cache utility | `fetchCachedDataOrFetchNewQuery` |\n| Invalidating cache (non-api-client) | Manual | `queryClient.invalidateQueries()` |\n\n## Rules\n\n### ✅ DO\n- Use auto-generated hooks from `@repo\u002Fapi-client` for covered domains\n- Put `QueryKeys` enum in `constants\u002Fquery-keys.ts` (non-api-client domains)\n- Put `QueryClient` + `fetchCachedDataOrFetchNewQuery` in `constants\u002Fquery-client.ts` (non-api-client domains)\n- Use `fetchCachedDataOrFetchNewQuery` only for app boot \u002F context provider hydration\n- Cache-first: always check cache before network\n\n### ❌ DON'T\n- Don't write manual query hooks for domains covered by `@repo\u002Fapi-client`\n- Don't use `fetchCachedDataOrFetchNewQuery` in components — it's for boot hydration only\n- Don't inline query key strings — always use `QueryKeys`\n- Don't forget `staleTime` when using `fetchCachedDataOrFetchNewQuery`\n",{"name":5,"description":7},"main","f06510bcaf955afc66bbbc1606871e1a1576492e",".agents\u002Fskills\u002Ffrontend\u002Freact-query-cache-utilities",0,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay","https:\u002F\u002Fcliqrelay.com","https:\u002F\u002Fgithub.com\u002FCliqRelay","Capture and refine workflows instantly to help your teams and AI agents perform at their best.","2026-11-04 22:56:05",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add CliqRelay\u002Fcliqrelay --skill react-query-cache-utilities",{"tool":38,"command":39},"bunx","bunx skills add CliqRelay\u002Fcliqrelay --skill react-query-cache-utilities",{"tool":41,"command":42},"pnpm","pnpm dlx skills add CliqRelay\u002Fcliqrelay --skill react-query-cache-utilities","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffrontend\u002Freact-query-cache-utilities\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M758WG0JG18W5MZD6ZPM6PGG","typst","Typst document creation and package development. Use when: (1) Working with .typ files, (2) User mentions typst, typst.toml, or typst-cli, (3) Creating or using Typst packages, (4) Developing document templates, (5) Converting Markdown\u002FLaTeX to Typst","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftypst\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M758WACKQMHG2BFF7T758J12","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", or \"switch to --preset\".","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M758W82G2QQ5Q14FKYNHRXQW","handoff","Compact the current conversation into a handoff document for another agent to pick up.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fhandoff\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M758W63H60EK55A93199B6NR","grilling","Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fgrilling\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M758W4HD4PF66929V7MDGKW8","grill-me","A relentless interview to sharpen a plan or design.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fgrill-me\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M758VYC5CCTP7EA5VKE7YWM5","dont-waffle","Use this skill when answering questions, explaining concepts, writing technical responses, reviewing code, or helping with development tasks. Communicate in clear, simple, standard English. Keep answers concise and focused, remove unnecessary filler and repetition, explain technical ideas in plain language, and structure information so it is easy to read and understand. When showing code, present it clearly with enough context for the developer to understand what it does and where it belongs.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fdont-waffle\u002FSKILL.md",[],[]]