[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EX84FDH3VW3MB6XEQ83D8T":3,"skill-same:01M7EX84FDH3VW3MB6XEQ83D8T":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7EX84FDH3VW3MB6XEQ83D8T","tanstack-query",null,"TanStack Query patterns for this repo — queryOptions\u002FmutationOptions factories, query key hierarchies, service layer integration, optimistic updates, Suspense usage, error handling, and TanStack Router data loading. Use when creating queries, mutations, API services, query keys, cache invalidation, optimistic updates, or integrating data fetching with routes.","Phenomenon-Studio\u002Fphenomenon-configs","Phenomenon-Studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85674486?v=4","01M7EX2X2JF76C91JB202QMQHW","Phenomenon studio","01M7EX2X37T2C5FBHAH4B60YMX",1,"MIT","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fvite\u002F.claude\u002Fskills\u002Ftanstack-query\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tanstack-query\ndescription: TanStack Query patterns for this repo — queryOptions\u002FmutationOptions factories, query key hierarchies, service layer integration, optimistic updates, Suspense usage, error handling, and TanStack Router data loading. Use when creating queries, mutations, API services, query keys, cache invalidation, optimistic updates, or integrating data fetching with routes.\nuser-invocable: false\n---\n\n# TanStack Query\n\n## Quick start\n\nThis repo uses **TanStack Query v5** with strict ESLint rules (`flat\u002Frecommended-strict`). Data fetching is organized per service domain in `src\u002Fservices\u002F\u003Cdomain>\u002F`.\n\n### Adding a new query\n\n1. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002FqueryKeys.ts` — hierarchical key factory\n2. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002Fqueries.ts` — `queryOptions`\u002F`mutationOptions` factories\n3. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002Fapi.ts` — typed API functions using `http`\u002F`httpPrivate`\n4. Consume in components via `useSuspenseQuery` (default) — fall back to `useQuery` only when `enabled` is needed; if you need to keep previous data during key changes, use `startTransition` (see [REFERENCE.md](REFERENCE.md) § Suspense-First Approach)\n\n```tsx\n\u002F\u002F queries.ts\nimport { queryOptions } from '@tanstack\u002Freact-query';\nimport { fetchPosts } from '.\u002Fapi';\nimport { postsKeys } from '.\u002FqueryKeys';\n\nexport const postsListQueryOptions = (filters?: PostFilters) => {\n    return queryOptions({\n        queryKey: postsKeys.listQueryKey(filters),\n        queryFn: () => fetchPosts(filters),\n    });\n};\n```\n\n## Workflows\n\n### Adding a new service domain\n\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Ftypes.ts` — request\u002Fresponse types\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Fapi.ts` — API functions\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002FqueryKeys.ts` — key factory\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Fqueries.ts` — query\u002Fmutation options\n- [ ] Wire into route loader or component\n\n### Adding a mutation with cache invalidation\n\n- [ ] Add mutation key to `queryKeys.ts` (if needed for optimistic updates)\n- [ ] Create `mutationOptions()` factory in `queries.ts`\n- [ ] Handle `onSuccess` — invalidate or update related queries via `{ client }` context arg\n- [ ] Consume with `useMutation` in component\n\n### Adding optimistic updates\n\n- [ ] Use `useOptimisticMutation` hook from `src\u002Fhooks\u002FuseOptimisticMutation.ts`\n- [ ] Provide `queryKey`, `updater`, and `invalidates` array\n- [ ] See [REFERENCE.md](REFERENCE.md) § Optimistic Updates\n\n## Key conventions\n\n| Pattern | This repo's approach |\n|---|---|\n| Query options | Always use `queryOptions()`\u002F`mutationOptions()` factories — never inline config |\n| Query keys | Hierarchical factory per domain with `as const`; methods, not plain properties |\n| API functions | Typed wrappers around `http`\u002F`httpPrivate` (ky) in `api.ts` |\n| Imperative fetch | Only `queryClient.query()`\u002F`queryClient.infiniteQuery()`. Loaders\u002F`beforeLoad`: spread `staleTime: 'static'` (cache-or-fetch). Fire-and-forget: `.catch(noop)` — `query()` rejects. `ensureQueryData`\u002F`fetchQuery`\u002F`prefetchQuery`\u002F`fetchInfiniteQuery`\u002F`prefetchInfiniteQuery`\u002F`ensureInfiniteQueryData` are deprecated (removed in v6) |\n| Query hooks | **Suspense-first**: prefer `useSuspenseQuery`\u002F`useSuspenseQueries`\u002F`useSuspenseInfiniteQuery`; only fall back to `useQuery`\u002F`useQueries` when `enabled` is required |\n| Error handling | Global `QueryCache.onError` for toasts; `throwOnError: true` for boundaries |\n| Error type | Registered globally as `HTTPError\u003CBaseErrorData>` |\n| Data transforms | Use `select` option, not inline transforms in `queryFn` |\n| Mutations context | Access `client` (QueryClient) via 4th arg in callbacks: `onSuccess(data, vars, onMutateResult, { client })` |\n| Import order | Follow Prettier import sorting — types first, then `@tanstack`, then local |\n\n## Advanced features\n\nSee [REFERENCE.md](REFERENCE.md) for detailed patterns:\n\n- Service layer architecture (api, queryKeys, queries)\n- Query key factory design\n- QueryClient configuration and error registration\n- Optimistic mutations (useOptimisticMutation hook)\n- Imperative QueryClient API (`query`\u002F`infiniteQuery`, `staleTime: 'static'`, deprecated → replacement table)\n- TanStack Router integration (loaders, prefetching, loaderDeps)\n- Error handling strategies\n- Dependent and parallel queries\n- Infinite queries\n- Data transformations with `select`\n- Cache invalidation strategies\n","# TanStack Query\n\n## Quick start\n\nThis repo uses **TanStack Query v5** with strict ESLint rules (`flat\u002Frecommended-strict`). Data fetching is organized per service domain in `src\u002Fservices\u002F\u003Cdomain>\u002F`.\n\n### Adding a new query\n\n1. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002FqueryKeys.ts` — hierarchical key factory\n2. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002Fqueries.ts` — `queryOptions`\u002F`mutationOptions` factories\n3. Create or extend `src\u002Fservices\u002F\u003Cdomain>\u002Fapi.ts` — typed API functions using `http`\u002F`httpPrivate`\n4. Consume in components via `useSuspenseQuery` (default) — fall back to `useQuery` only when `enabled` is needed; if you need to keep previous data during key changes, use `startTransition` (see [REFERENCE.md](REFERENCE.md) § Suspense-First Approach)\n\n```tsx\n\u002F\u002F queries.ts\nimport { queryOptions } from '@tanstack\u002Freact-query';\nimport { fetchPosts } from '.\u002Fapi';\nimport { postsKeys } from '.\u002FqueryKeys';\n\nexport const postsListQueryOptions = (filters?: PostFilters) => {\n    return queryOptions({\n        queryKey: postsKeys.listQueryKey(filters),\n        queryFn: () => fetchPosts(filters),\n    });\n};\n```\n\n## Workflows\n\n### Adding a new service domain\n\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Ftypes.ts` — request\u002Fresponse types\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Fapi.ts` — API functions\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002FqueryKeys.ts` — key factory\n- [ ] Create `src\u002Fservices\u002F\u003Cdomain>\u002Fqueries.ts` — query\u002Fmutation options\n- [ ] Wire into route loader or component\n\n### Adding a mutation with cache invalidation\n\n- [ ] Add mutation key to `queryKeys.ts` (if needed for optimistic updates)\n- [ ] Create `mutationOptions()` factory in `queries.ts`\n- [ ] Handle `onSuccess` — invalidate or update related queries via `{ client }` context arg\n- [ ] Consume with `useMutation` in component\n\n### Adding optimistic updates\n\n- [ ] Use `useOptimisticMutation` hook from `src\u002Fhooks\u002FuseOptimisticMutation.ts`\n- [ ] Provide `queryKey`, `updater`, and `invalidates` array\n- [ ] See [REFERENCE.md](REFERENCE.md) § Optimistic Updates\n\n## Key conventions\n\n| Pattern | This repo's approach |\n|---|---|\n| Query options | Always use `queryOptions()`\u002F`mutationOptions()` factories — never inline config |\n| Query keys | Hierarchical factory per domain with `as const`; methods, not plain properties |\n| API functions | Typed wrappers around `http`\u002F`httpPrivate` (ky) in `api.ts` |\n| Imperative fetch | Only `queryClient.query()`\u002F`queryClient.infiniteQuery()`. Loaders\u002F`beforeLoad`: spread `staleTime: 'static'` (cache-or-fetch). Fire-and-forget: `.catch(noop)` — `query()` rejects. `ensureQueryData`\u002F`fetchQuery`\u002F`prefetchQuery`\u002F`fetchInfiniteQuery`\u002F`prefetchInfiniteQuery`\u002F`ensureInfiniteQueryData` are deprecated (removed in v6) |\n| Query hooks | **Suspense-first**: prefer `useSuspenseQuery`\u002F`useSuspenseQueries`\u002F`useSuspenseInfiniteQuery`; only fall back to `useQuery`\u002F`useQueries` when `enabled` is required |\n| Error handling | Global `QueryCache.onError` for toasts; `throwOnError: true` for boundaries |\n| Error type | Registered globally as `HTTPError\u003CBaseErrorData>` |\n| Data transforms | Use `select` option, not inline transforms in `queryFn` |\n| Mutations context | Access `client` (QueryClient) via 4th arg in callbacks: `onSuccess(data, vars, onMutateResult, { client })` |\n| Import order | Follow Prettier import sorting — types first, then `@tanstack`, then local |\n\n## Advanced features\n\nSee [REFERENCE.md](REFERENCE.md) for detailed patterns:\n\n- Service layer architecture (api, queryKeys, queries)\n- Query key factory design\n- QueryClient configuration and error registration\n- Optimistic mutations (useOptimisticMutation hook)\n- Imperative QueryClient API (`query`\u002F`infiniteQuery`, `staleTime: 'static'`, deprecated → replacement table)\n- TanStack Router integration (loaders, prefetching, loaderDeps)\n- Error handling strategies\n- Dependent and parallel queries\n- Infinite queries\n- Data transformations with `select`\n- Cache invalidation strategies\n",{"name":5,"description":7,"user-invocable":20},"main","a5c9ac2f39c1611831e417faea2e6d635699d9b5","examples\u002Fvite\u002F.claude\u002Fskills\u002Ftanstack-query",0,"https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio","https:\u002F\u002Fphenomenonstudio.com\u002F","Phenomenon is a digital product studio bolstering a core team of world-class developers, designers, and a flexible network of multi-specialized talent. ","2026-10-23 17:20:31",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill tanstack-query",{"tool":39,"command":40},"bunx","bunx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill tanstack-query",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill tanstack-query","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fvite\u002F.claude\u002Fskills\u002Ftanstack-query\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"REFERENCE.md","REFERENCE","参考文档",22184,"https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fvite\u002F.claude\u002Fskills\u002Ftanstack-query\u002FREFERENCE.md",[54,61,68,75,80,87],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7EXBNNR8YZB8PD7J8ZAB5FP","web-security","Enforce web security and avoid security vulnerabilities.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Fweb-security\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7EXBJGWKB32NY4R2V141G0S","typescript","Write clean, efficient TypeScript code that follows project conventions and advanced type patterns. Use when writing or reviewing TypeScript code, defining types, creating generics, handling errors, or working with React components, Zod schemas, and TanStack libraries.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftypescript\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7EXBESDHFPHAZKN292SDB6E","tanstack-router","TanStack Router patterns for this repo — file-based routing, auth guards, search params, data loading, TanStack Query integration, navigation, and code splitting. Use when creating routes, adding pages, implementing auth flows, working with search\u002Fpath params, or integrating loaders with TanStack Query.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-router\u002FSKILL.md",[],[],{"skillNo":76,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7EXBAZW0KSMGVDB9DW157SD","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-query\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7EXB6X2TG4HYWCYB293581T","tanstack-form","Build forms using TanStack Form with the project's useAppForm composition, composable field components, Zod validation schemas, FormFieldWrapper error tracking, and form.AppField vs form.Field patterns. Use when creating new forms, adding form fields, writing form validation, or working with TanStack Form in this project.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-form\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7EXB4EXHFSSVY64QQAE77SA","react","Build clean, modern React components that apply common best practices and avoid common pitfalls like unnecessary state management or useEffect usage.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Freact\u002FSKILL.md",[],[]]