[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79G37GDFDTRG7BK694NSPW2":3,"skill-same:01M79G37GDFDTRG7BK694NSPW2":90},{"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":63,"commitSha":64,"skillDirectory":65,"forksCount":14,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M79G37GDFDTRG7BK694NSPW2","swr",null,"SWR data-fetching expert guidance. Use when building React apps with client-side data fetching, caching, revalidation, mutations, optimistic UI, pagination, or infinite loading using the SWR library.","zfifteen\u002Fskills-catalog","zfifteen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221906715?v=4","01M79CQFXDZM5J5CJTCECPFA66","Dionisio Alberto Lopez III","01M79CQFY4C62PN8A2T5KDAHGA",1,"MIT","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fswr\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: swr\ndescription: SWR data-fetching expert guidance. Use when building React apps with client-side data fetching, caching, revalidation, mutations, optimistic UI, pagination, or infinite loading using the SWR library.\nmetadata:\n  priority: 4\n  docs:\n    - \"https:\u002F\u002Fswr.vercel.app\u002Fdocs\"\n  sitemap: \"https:\u002F\u002Fswr.vercel.app\u002Fsitemap.xml\"\n  pathPatterns:\n    - 'lib\u002Ffetcher.*'\n    - 'src\u002Flib\u002Ffetcher.*'\n    - 'utils\u002Ffetcher.*'\n    - 'src\u002Futils\u002Ffetcher.*'\n    - 'hooks\u002Fuse*SWR*'\n    - 'src\u002Fhooks\u002Fuse*SWR*'\n    - 'hooks\u002FuseFetch*'\n    - 'src\u002Fhooks\u002FuseFetch*'\n  importPatterns:\n    - 'swr'\n    - 'swr\u002F*'\n  bashPatterns:\n    - '\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b'\n    - '\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b'\n    - '\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b'\n    - '\\byarn\\s+add\\s+[^\\n]*\\bswr\\b'\n  promptSignals:\n    phrases:\n      - \"swr\"\n      - \"useswr\"\n      - \"stale-while-revalidate\"\n    allOf:\n      - [data fetching, client]\n      - [cache, revalidat]\n    anyOf:\n      - \"mutation\"\n      - \"optimistic\"\n      - \"infinite loading\"\n      - \"pagination\"\n    noneOf: []\n    minScore: 6\n---\n\n# SWR — React Hooks for Data Fetching\n\nYou are an expert in SWR v2 (latest: 2.4.1), the React Hooks library for data fetching by Vercel. SWR implements the stale-while-revalidate HTTP cache invalidation strategy — serve from cache first, then revalidate in the background.\n\n## Installation\n\n```bash\nnpm install swr\n```\n\n## Core API\n\n### `useSWR`\n\n```tsx\nimport useSWR from 'swr'\n\nconst fetcher = (url: string) => fetch(url).then(res => res.json())\n\nfunction Profile() {\n  const { data, error, isLoading, mutate } = useSWR('\u002Fapi\u002Fuser', fetcher)\n\n  if (isLoading) return \u003Cdiv>Loading...\u003C\u002Fdiv>\n  if (error) return \u003Cdiv>Error loading data\u003C\u002Fdiv>\n  return \u003Cdiv>Hello, {data.name}\u003C\u002Fdiv>\n}\n```\n\n**Key parameters:**\n- `key` — unique string, array, or function identifying the resource (often a URL)\n- `fetcher` — async function that receives the key and returns data\n- `options` — optional config object\n\n**Return values:** `data`, `error`, `isLoading`, `isValidating`, `mutate`\n\n### `useSWRMutation` — Remote Mutations\n\n```tsx\nimport useSWRMutation from 'swr\u002Fmutation'\n\nasync function updateUser(url: string, { arg }: { arg: { name: string } }) {\n  return fetch(url, { method: 'POST', body: JSON.stringify(arg) }).then(res => res.json())\n}\n\nfunction Profile() {\n  const { trigger, isMutating } = useSWRMutation('\u002Fapi\u002Fuser', updateUser)\n\n  return (\n    \u003Cbutton disabled={isMutating} onClick={() => trigger({ name: 'New Name' })}>\n      Update\n    \u003C\u002Fbutton>\n  )\n}\n```\n\n### `useSWRInfinite` — Pagination & Infinite Loading\n\n```tsx\nimport useSWRInfinite from 'swr\u002Finfinite'\n\nconst getKey = (pageIndex: number, previousPageData: any[]) => {\n  if (previousPageData && !previousPageData.length) return null\n  return `\u002Fapi\u002Fitems?page=${pageIndex}`\n}\n\nfunction Items() {\n  const { data, size, setSize, isLoading } = useSWRInfinite(getKey, fetcher)\n  const items = data ? data.flat() : []\n\n  return (\n    \u003C>\n      {items.map(item => \u003Cdiv key={item.id}>{item.name}\u003C\u002Fdiv>)}\n      \u003Cbutton onClick={() => setSize(size + 1)}>Load More\u003C\u002Fbutton>\n    \u003C\u002F>\n  )\n}\n```\n\n## Global Configuration\n\nWrap your app (or a subtree) with `SWRConfig` to set defaults:\n\n```tsx\nimport { SWRConfig } from 'swr'\n\nfunction App() {\n  return (\n    \u003CSWRConfig value={{\n      fetcher: (url: string) => fetch(url).then(res => res.json()),\n      revalidateOnFocus: false,\n      dedupingInterval: 5000,\n    }}>\n      \u003CDashboard \u002F>\n    \u003C\u002FSWRConfig>\n  )\n}\n```\n\n## Revalidation Strategies\n\n| Strategy | Option | Default |\n|---|---|---|\n| On window focus | `revalidateOnFocus` | `true` |\n| On network recovery | `revalidateOnReconnect` | `true` |\n| On mount if stale | `revalidateIfStale` | `true` |\n| Polling | `refreshInterval` | `0` (disabled) |\n| Manual | Call `mutate()` | — |\n\n## Optimistic Updates\n\n```tsx\nconst { trigger } = useSWRMutation('\u002Fapi\u002Fuser', updateUser, {\n  optimisticData: (current) => ({ ...current, name: 'New Name' }),\n  rollbackOnError: true,\n  populateCache: true,\n  revalidate: false,\n})\n```\n\n## Conditional Fetching\n\nPass `null` or a falsy key to skip fetching:\n\n```tsx\nconst { data } = useSWR(userId ? `\u002Fapi\u002Fuser\u002F${userId}` : null, fetcher)\n```\n\n## Error Retry\n\nSWR retries on error by default with exponential backoff. Customize with:\n\n```tsx\nuseSWR(key, fetcher, {\n  onErrorRetry: (error, key, config, revalidate, { retryCount }) => {\n    if (error.status === 404) return \u002F\u002F Don't retry on 404\n    if (retryCount >= 3) return      \u002F\u002F Max 3 retries\n    setTimeout(() => revalidate({ retryCount }), 5000)\n  },\n})\n```\n\n## `useSWRSubscription` — Real-Time Data Sources\n\nSubscribe to real-time data (WebSockets, SSE, etc.) with automatic deduplication:\n\n```tsx\nimport useSWRSubscription from 'swr\u002Fsubscription'\n\nfunction LivePrice({ symbol }: { symbol: string }) {\n  const { data } = useSWRSubscription(\n    `wss:\u002F\u002Fstream.example.com\u002F${symbol}`,\n    (key, { next }) => {\n      const ws = new WebSocket(key)\n      ws.onmessage = (event) => next(null, JSON.parse(event.data))\n      ws.onerror = (event) => next(event)\n      return () => ws.close()\n    }\n  )\n\n  return \u003Cspan>{data?.price}\u003C\u002Fspan>\n}\n```\n\nThe `subscribe` function receives a `next(error, data)` callback and must return a cleanup function. Multiple components using the same key share a single subscription.\n\n## Key Rules\n\n- **Keys must be unique** — two `useSWR` calls with the same key share cache and deduplicate requests\n- **Fetcher is optional** when set via `SWRConfig`\n- **`mutate(key)`** globally revalidates any hook matching that key\n- **Array keys** like `useSWR(['\u002Fapi\u002Fuser', id], fetcher)` — the fetcher receives the full array\n- **Never call hooks conditionally** — use conditional keys (`null`) instead\n","# SWR — React Hooks for Data Fetching\n\nYou are an expert in SWR v2 (latest: 2.4.1), the React Hooks library for data fetching by Vercel. SWR implements the stale-while-revalidate HTTP cache invalidation strategy — serve from cache first, then revalidate in the background.\n\n## Installation\n\n```bash\nnpm install swr\n```\n\n## Core API\n\n### `useSWR`\n\n```tsx\nimport useSWR from 'swr'\n\nconst fetcher = (url: string) => fetch(url).then(res => res.json())\n\nfunction Profile() {\n  const { data, error, isLoading, mutate } = useSWR('\u002Fapi\u002Fuser', fetcher)\n\n  if (isLoading) return \u003Cdiv>Loading...\u003C\u002Fdiv>\n  if (error) return \u003Cdiv>Error loading data\u003C\u002Fdiv>\n  return \u003Cdiv>Hello, {data.name}\u003C\u002Fdiv>\n}\n```\n\n**Key parameters:**\n- `key` — unique string, array, or function identifying the resource (often a URL)\n- `fetcher` — async function that receives the key and returns data\n- `options` — optional config object\n\n**Return values:** `data`, `error`, `isLoading`, `isValidating`, `mutate`\n\n### `useSWRMutation` — Remote Mutations\n\n```tsx\nimport useSWRMutation from 'swr\u002Fmutation'\n\nasync function updateUser(url: string, { arg }: { arg: { name: string } }) {\n  return fetch(url, { method: 'POST', body: JSON.stringify(arg) }).then(res => res.json())\n}\n\nfunction Profile() {\n  const { trigger, isMutating } = useSWRMutation('\u002Fapi\u002Fuser', updateUser)\n\n  return (\n    \u003Cbutton disabled={isMutating} onClick={() => trigger({ name: 'New Name' })}>\n      Update\n    \u003C\u002Fbutton>\n  )\n}\n```\n\n### `useSWRInfinite` — Pagination & Infinite Loading\n\n```tsx\nimport useSWRInfinite from 'swr\u002Finfinite'\n\nconst getKey = (pageIndex: number, previousPageData: any[]) => {\n  if (previousPageData && !previousPageData.length) return null\n  return `\u002Fapi\u002Fitems?page=${pageIndex}`\n}\n\nfunction Items() {\n  const { data, size, setSize, isLoading } = useSWRInfinite(getKey, fetcher)\n  const items = data ? data.flat() : []\n\n  return (\n    \u003C>\n      {items.map(item => \u003Cdiv key={item.id}>{item.name}\u003C\u002Fdiv>)}\n      \u003Cbutton onClick={() => setSize(size + 1)}>Load More\u003C\u002Fbutton>\n    \u003C\u002F>\n  )\n}\n```\n\n## Global Configuration\n\nWrap your app (or a subtree) with `SWRConfig` to set defaults:\n\n```tsx\nimport { SWRConfig } from 'swr'\n\nfunction App() {\n  return (\n    \u003CSWRConfig value={{\n      fetcher: (url: string) => fetch(url).then(res => res.json()),\n      revalidateOnFocus: false,\n      dedupingInterval: 5000,\n    }}>\n      \u003CDashboard \u002F>\n    \u003C\u002FSWRConfig>\n  )\n}\n```\n\n## Revalidation Strategies\n\n| Strategy | Option | Default |\n|---|---|---|\n| On window focus | `revalidateOnFocus` | `true` |\n| On network recovery | `revalidateOnReconnect` | `true` |\n| On mount if stale | `revalidateIfStale` | `true` |\n| Polling | `refreshInterval` | `0` (disabled) |\n| Manual | Call `mutate()` | — |\n\n## Optimistic Updates\n\n```tsx\nconst { trigger } = useSWRMutation('\u002Fapi\u002Fuser', updateUser, {\n  optimisticData: (current) => ({ ...current, name: 'New Name' }),\n  rollbackOnError: true,\n  populateCache: true,\n  revalidate: false,\n})\n```\n\n## Conditional Fetching\n\nPass `null` or a falsy key to skip fetching:\n\n```tsx\nconst { data } = useSWR(userId ? `\u002Fapi\u002Fuser\u002F${userId}` : null, fetcher)\n```\n\n## Error Retry\n\nSWR retries on error by default with exponential backoff. Customize with:\n\n```tsx\nuseSWR(key, fetcher, {\n  onErrorRetry: (error, key, config, revalidate, { retryCount }) => {\n    if (error.status === 404) return \u002F\u002F Don't retry on 404\n    if (retryCount >= 3) return      \u002F\u002F Max 3 retries\n    setTimeout(() => revalidate({ retryCount }), 5000)\n  },\n})\n```\n\n## `useSWRSubscription` — Real-Time Data Sources\n\nSubscribe to real-time data (WebSockets, SSE, etc.) with automatic deduplication:\n\n```tsx\nimport useSWRSubscription from 'swr\u002Fsubscription'\n\nfunction LivePrice({ symbol }: { symbol: string }) {\n  const { data } = useSWRSubscription(\n    `wss:\u002F\u002Fstream.example.com\u002F${symbol}`,\n    (key, { next }) => {\n      const ws = new WebSocket(key)\n      ws.onmessage = (event) => next(null, JSON.parse(event.data))\n      ws.onerror = (event) => next(event)\n      return () => ws.close()\n    }\n  )\n\n  return \u003Cspan>{data?.price}\u003C\u002Fspan>\n}\n```\n\nThe `subscribe` function receives a `next(error, data)` callback and must return a cleanup function. Multiple components using the same key share a single subscription.\n\n## Key Rules\n\n- **Keys must be unique** — two `useSWR` calls with the same key share cache and deduplicate requests\n- **Fetcher is optional** when set via `SWRConfig`\n- **`mutate(key)`** globally revalidates any hook matching that key\n- **Array keys** like `useSWR(['\u002Fapi\u002Fuser', id], fetcher)` — the fetcher receives the full array\n- **Never call hooks conditionally** — use conditional keys (`null`) instead\n",{"name":5,"metadata":24,"description":7},{"docs":25,"sitemap":27,"priority":28,"bashPatterns":29,"pathPatterns":34,"promptSignals":43,"importPatterns":61},[26],"https:\u002F\u002Fswr.vercel.app\u002Fdocs","https:\u002F\u002Fswr.vercel.app\u002Fsitemap.xml",4,[30,31,32,33],"\\bnpm\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b","\\bpnpm\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b","\\bbun\\s+(install|i|add)\\s+[^\\n]*\\bswr\\b","\\byarn\\s+add\\s+[^\\n]*\\bswr\\b",[35,36,37,38,39,40,41,42],"lib\u002Ffetcher.*","src\u002Flib\u002Ffetcher.*","utils\u002Ffetcher.*","src\u002Futils\u002Ffetcher.*","hooks\u002Fuse*SWR*","src\u002Fhooks\u002Fuse*SWR*","hooks\u002FuseFetch*","src\u002Fhooks\u002FuseFetch*",{"allOf":44,"anyOf":51,"noneOf":56,"phrases":57,"minScore":60},[45,48],[46,47],"data fetching","client",[49,50],"cache","revalidat",[52,53,54,55],"mutation","optimistic","infinite loading","pagination",[],[5,58,59],"useswr","stale-while-revalidate",6,[5,62],"swr\u002F*","main","d9535210da9af28aa76bca80de80355197e1b6d6","skills\u002Fswr","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog","https:\u002F\u002Fgithub.com\u002Fzfifteen","I like to measure things.","2026-07-19 23:41:54",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add zfifteen\u002Fskills-catalog --skill swr",{"tool":76,"command":77},"bunx","bunx skills add zfifteen\u002Fskills-catalog --skill swr",{"tool":79,"command":80},"pnpm","pnpm dlx skills add zfifteen\u002Fskills-catalog --skill swr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fswr\u002FSKILL.md",true,[84],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"agents\u002Fopenai.yaml","REFERENCE","参考文档",90,"https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fswr\u002Fagents\u002Fopenai.yaml",[91,98,105,112,121,128],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M79GXQ2PWPT2E4CJYHXVJ0YE","Zotero","Use Zotero Desktop from Codex to enable\u002Fprobe the local API, search a local Zotero library, list items\u002Fcollections\u002Ftags, export BibTeX, insert citation keys into LaTeX or Markdown drafts, read indexed full text when requested, and import BibTeX\u002FRIS records into Zotero through the connector server. Use when the user mentions Zotero, citations, references.bib, BibTeX export, local Zotero API, localhost:23119, or adding citations from a Zotero library.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fzotero\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M79GXN85NETKBE06865CWK6Z","zoom-apps-sdk","Use when using Apps SDK.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M79GXCYD7FGYS932J9N9RFFY","youtube","Obtain accurate, timestamped YouTube video transcripts (preferring manual captions over auto-generated) as the primary deliverable, then derive summaries, key claims, or notes from that transcript.  Use when the user provides a YouTube URL (or video ID) and wants the transcript, a faithful summary, key claims with attribution, timestamped notes, or \"what does this video actually say\".  The skill is transcript-first: never substitute metadata, title, description, or search snippets for the spoken content.  Triggers: \"youtube transcript\", \"get the transcript of this video\", \"summarize this youtube video\", \"what did they say in https:\u002F\u002Fyoutube.com\u002F...\", \"key claims from this talk\".","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":116,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M79GX8EXHHYM566BKR7MS778","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":19},"01M79GX2HFJPX84NMRE5VBTYX9","x-post-creator","Create X-ready post threads and co-located story packages from the active conversation or referenced project material. Use when the user says turn this into an X-post, \u002Fx-post, make this into an X thread, or wants plain-language social posts with supporting images saved to docs\u002Fx-posts\u002F[story-name]\u002F.","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fx-post-creator\u002FSKILL.md",[],[],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":19},"01M79GWXQT4HBT6QME6QSBZJFA","x-api","Search, read, and write X posts through the local X API MCP server (the same backend used by the Codex x-api skill). Use for searching X\u002Fx.com, reading threads and replies, creating lists, staging\u002Fpublishing posts for @alltheputs, finding high-visibility reply targets for research outreach, ingesting public context, or any request that mentions \u002Fx-api or \"search X\".","https:\u002F\u002Fgithub.com\u002Fzfifteen\u002Fskills-catalog\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]