[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FAYTK69VAAJC47WYS1ST2T":3,"skill-same:01M7FAYTK69VAAJC47WYS1ST2T":48},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7FAYTK69VAAJC47WYS1ST2T","nuxt4-patterns",null,"Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData. Use when building or reviewing a Nuxt 4 app, or debugging hydration mismatches and SSR-safe data fetching.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fnuxt4-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: nuxt4-patterns\ndescription: Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData. Use when building or reviewing a Nuxt 4 app, or debugging hydration mismatches and SSR-safe data fetching.\nmetadata:\n  origin: ECC\n---\n\n# Nuxt 4 Patterns\n\nUse when building or debugging Nuxt 4 apps with SSR, hybrid rendering, route rules, or page-level data fetching.\n\n## When to Activate\n\n- Hydration mismatches between server HTML and client state\n- Route-level rendering decisions such as prerender, SWR, ISR, or client-only sections\n- Performance work around lazy loading, lazy hydration, or payload size\n- Page or component data fetching with `useFetch`, `useAsyncData`, or `$fetch`\n- Nuxt routing issues tied to route params, middleware, or SSR\u002Fclient differences\n\n## Hydration Safety\n\n- Keep the first render deterministic. Do not put `Date.now()`, `Math.random()`, browser-only APIs, or storage reads directly into SSR-rendered template state.\n- Move browser-only logic behind `onMounted()`, `import.meta.client`, `ClientOnly`, or a `.client.vue` component when the server cannot produce the same markup.\n- Use Nuxt's `useRoute()` composable, not the one from `vue-router`.\n- Do not use `route.fullPath` to drive SSR-rendered markup. URL fragments are client-only, which can create hydration mismatches.\n- Treat `ssr: false` as an escape hatch for truly browser-only areas, not a default fix for mismatches.\n\n## Data Fetching\n\n- Prefer `await useFetch()` for SSR-safe API reads in pages and components. It forwards server-fetched data into the Nuxt payload and avoids a second fetch on hydration.\n- Use `useAsyncData()` when the fetcher is not a simple `$fetch()` call, when you need a custom key, or when you are composing multiple async sources.\n- Give `useAsyncData()` a stable key for cache reuse and predictable refresh behavior.\n- Keep `useAsyncData()` handlers side-effect free. They can run during SSR and hydration.\n- Use `$fetch()` for user-triggered writes or client-only actions, not top-level page data that should be hydrated from SSR.\n- Use `lazy: true`, `useLazyFetch()`, or `useLazyAsyncData()` for non-critical data that should not block navigation. Handle `status === 'pending'` in the UI.\n- Use `server: false` only for data that is not needed for SEO or the first paint.\n- Trim payload size with `pick` and prefer shallower payloads when deep reactivity is unnecessary.\n\n```ts\nconst route = useRoute()\n\nconst { data: article, status, error, refresh } = await useAsyncData(\n  () => `article:${route.params.slug}`,\n  () => $fetch(`\u002Fapi\u002Farticles\u002F${route.params.slug}`),\n)\n\nconst { data: comments } = await useFetch(`\u002Fapi\u002Farticles\u002F${route.params.slug}\u002Fcomments`, {\n  lazy: true,\n  server: false,\n})\n```\n\n## Route Rules\n\nPrefer `routeRules` in `nuxt.config.ts` for rendering and caching strategy:\n\n```ts\nexport default defineNuxtConfig({\n  routeRules: {\n    '\u002F': { prerender: true },\n    '\u002Fproducts\u002F**': { swr: 3600 },\n    '\u002Fblog\u002F**': { isr: true },\n    '\u002Fadmin\u002F**': { ssr: false },\n    '\u002Fapi\u002F**': { cache: { maxAge: 60 * 60 } },\n  },\n})\n```\n\n- `prerender`: static HTML at build time\n- `swr`: serve cached content and revalidate in the background\n- `isr`: incremental static regeneration on supported platforms\n- `ssr: false`: client-rendered route\n- `cache` or `redirect`: Nitro-level response behavior\n\nPick route rules per route group, not globally. Marketing pages, catalogs, dashboards, and APIs usually need different strategies.\n\n## Lazy Loading and Performance\n\n- Nuxt already code-splits pages by route. Keep route boundaries meaningful before micro-optimizing component splits.\n- Use the `Lazy` prefix to dynamically import non-critical components.\n- Conditionally render lazy components with `v-if` so the chunk is not loaded until the UI actually needs it.\n- Use lazy hydration for below-the-fold or non-critical interactive UI.\n\n```vue\n\u003Ctemplate>\n  \u003CLazyRecommendations v-if=\"showRecommendations\" \u002F>\n  \u003CLazyProductGallery hydrate-on-visible \u002F>\n\u003C\u002Ftemplate>\n```\n\n- For custom strategies, use `defineLazyHydrationComponent()` with a visibility or idle strategy.\n- Nuxt lazy hydration works on single-file components. Passing new props to a lazily hydrated component will trigger hydration immediately.\n- Use `NuxtLink` for internal navigation so Nuxt can prefetch route components and generated payloads.\n\n## Review Checklist\n\n- First SSR render and hydrated client render produce the same markup\n- Page data uses `useFetch` or `useAsyncData`, not top-level `$fetch`\n- Non-critical data is lazy and has explicit loading UI\n- Route rules match the page's SEO and freshness requirements\n- Heavy interactive islands are lazy-loaded or lazily hydrated\n","# Nuxt 4 Patterns\n\nUse when building or debugging Nuxt 4 apps with SSR, hybrid rendering, route rules, or page-level data fetching.\n\n## When to Activate\n\n- Hydration mismatches between server HTML and client state\n- Route-level rendering decisions such as prerender, SWR, ISR, or client-only sections\n- Performance work around lazy loading, lazy hydration, or payload size\n- Page or component data fetching with `useFetch`, `useAsyncData`, or `$fetch`\n- Nuxt routing issues tied to route params, middleware, or SSR\u002Fclient differences\n\n## Hydration Safety\n\n- Keep the first render deterministic. Do not put `Date.now()`, `Math.random()`, browser-only APIs, or storage reads directly into SSR-rendered template state.\n- Move browser-only logic behind `onMounted()`, `import.meta.client`, `ClientOnly`, or a `.client.vue` component when the server cannot produce the same markup.\n- Use Nuxt's `useRoute()` composable, not the one from `vue-router`.\n- Do not use `route.fullPath` to drive SSR-rendered markup. URL fragments are client-only, which can create hydration mismatches.\n- Treat `ssr: false` as an escape hatch for truly browser-only areas, not a default fix for mismatches.\n\n## Data Fetching\n\n- Prefer `await useFetch()` for SSR-safe API reads in pages and components. It forwards server-fetched data into the Nuxt payload and avoids a second fetch on hydration.\n- Use `useAsyncData()` when the fetcher is not a simple `$fetch()` call, when you need a custom key, or when you are composing multiple async sources.\n- Give `useAsyncData()` a stable key for cache reuse and predictable refresh behavior.\n- Keep `useAsyncData()` handlers side-effect free. They can run during SSR and hydration.\n- Use `$fetch()` for user-triggered writes or client-only actions, not top-level page data that should be hydrated from SSR.\n- Use `lazy: true`, `useLazyFetch()`, or `useLazyAsyncData()` for non-critical data that should not block navigation. Handle `status === 'pending'` in the UI.\n- Use `server: false` only for data that is not needed for SEO or the first paint.\n- Trim payload size with `pick` and prefer shallower payloads when deep reactivity is unnecessary.\n\n```ts\nconst route = useRoute()\n\nconst { data: article, status, error, refresh } = await useAsyncData(\n  () => `article:${route.params.slug}`,\n  () => $fetch(`\u002Fapi\u002Farticles\u002F${route.params.slug}`),\n)\n\nconst { data: comments } = await useFetch(`\u002Fapi\u002Farticles\u002F${route.params.slug}\u002Fcomments`, {\n  lazy: true,\n  server: false,\n})\n```\n\n## Route Rules\n\nPrefer `routeRules` in `nuxt.config.ts` for rendering and caching strategy:\n\n```ts\nexport default defineNuxtConfig({\n  routeRules: {\n    '\u002F': { prerender: true },\n    '\u002Fproducts\u002F**': { swr: 3600 },\n    '\u002Fblog\u002F**': { isr: true },\n    '\u002Fadmin\u002F**': { ssr: false },\n    '\u002Fapi\u002F**': { cache: { maxAge: 60 * 60 } },\n  },\n})\n```\n\n- `prerender`: static HTML at build time\n- `swr`: serve cached content and revalidate in the background\n- `isr`: incremental static regeneration on supported platforms\n- `ssr: false`: client-rendered route\n- `cache` or `redirect`: Nitro-level response behavior\n\nPick route rules per route group, not globally. Marketing pages, catalogs, dashboards, and APIs usually need different strategies.\n\n## Lazy Loading and Performance\n\n- Nuxt already code-splits pages by route. Keep route boundaries meaningful before micro-optimizing component splits.\n- Use the `Lazy` prefix to dynamically import non-critical components.\n- Conditionally render lazy components with `v-if` so the chunk is not loaded until the UI actually needs it.\n- Use lazy hydration for below-the-fold or non-critical interactive UI.\n\n```vue\n\u003Ctemplate>\n  \u003CLazyRecommendations v-if=\"showRecommendations\" \u002F>\n  \u003CLazyProductGallery hydrate-on-visible \u002F>\n\u003C\u002Ftemplate>\n```\n\n- For custom strategies, use `defineLazyHydrationComponent()` with a visibility or idle strategy.\n- Nuxt lazy hydration works on single-file components. Passing new props to a lazily hydrated component will trigger hydration immediately.\n- Use `NuxtLink` for internal navigation so Nuxt can prefetch route components and generated payloads.\n\n## Review Checklist\n\n- First SSR render and hydrated client render produce the same markup\n- Page data uses `useFetch` or `useAsyncData`, not top-level `$fetch`\n- Non-critical data is lazy and has explicit loading UI\n- Route rules match the page's SEO and freshness requirements\n- Heavy interactive islands are lazy-loaded or lazily hydrated\n",{"name":5,"metadata":24,"description":7},{"origin":25},"ECC","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fnuxt4-patterns",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill nuxt4-patterns",{"tool":40,"command":41},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill nuxt4-patterns",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill nuxt4-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fnuxt4-patterns\u002FSKILL.md",true,[],[49,56,61,68,75,82],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"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},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\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},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\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},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]