What does this skill do?

The Nuxt 4 Patterns Skill addresses the most common challenges in Nuxt 4 development: it ensures secure server-to-client hydration, optimizes performance through lazy loading and deferred hydration, and establishes proper rendering and data-fetching strategies in SSR environments using `useFetch` and `useAsyncData`.

Hydration Mistakes
Detect and correct mismatches between the server-side HTML and the client-side state using onMounted, ClientOnly, or .client.vue files.
Routing Rules
Define `routeRules` in `nuxt.config.ts` to assign prerender, SWR, ISR, or client-only sections by route group.
Performance and Lazy Loading
Reduce payload size and improve load times with lazy dynamic imports and deferred hydration for below-the-fold components.
SSR Data Collection
Implement `useFetch` for safe reads and `useAsyncData` for custom fetchers, avoiding duplicate requests between the server and the client.

Usage examples

🔧 Hydration error
I have a rendering mismatch on my Nuxt 4 page because I'm using `Date.now()` in the template. How do I fix this?
🛣️ Configure routeRules
Help me define routeRules in nuxt.config.ts to prerender the home page, use SWR for products, and ISR for the blog.
📡 useFetch vs. useAsyncData
When should I use `useFetch` and when should I use `useAsyncData` to safely fetch data during SSR?
⚡ Lazy loading of components

Features

Hydration Safety Isolate browser-specific logic using `onMounted`, `import.meta.client`, `ClientOnly`, or `.client.vue` files to prevent SSR mismatches.
Robust Data Collection Use `useFetch` for simple reads and `useAsyncData` for custom fetchers, dynamic keys, or source composition.
RouteRules by route group Assign rendering and caching strategies (prerender, SWR, ISR, ssr: false) by group rather than through global settings.
Lazy loading and deferred hydration Load non-critical components with the "Lazy" prefix and delay their hydration using "hydrate-on-visible" to reduce the initial payload.
Hybrid rendering Combine SSR, prerendering, and client-only sections within a single application, following Nuxt 4 best practices.

Frequently asked questions

The skill provides templates and code that you can apply to your existing Nuxt 4 project. It doesn't install anything for you, but it guides you step by step through the implementation.
The data binding and data fetching patterns are similar, but some features—such as routeRules and deferred data binding—are specific to Nuxt 4.
Yes. Describe the hydration error or performance issue you're having, and Claude will apply the correct pattern with tailored code examples.
No. This skill works with Claude Code or Cowork without any additional MCP configuration.
Nuxt 4 Patterns — Secure SSR and Performance with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.