Skip to content
affaan-m avatar

Nuxt4 Patterns

Nuxt 4 rendering, hydration, and data-fetching patterns covering SSR-safe fetching, route rules, and lazy loading.

CCM score
75 of 100
skills.sh installs
11.5K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers hydration safety, data fetching with useFetch and useAsyncData, route rules, and lazy loading and hydration for performance
  • Enforces a deterministic first render, forbidding Date.now(), Math.random(), storage reads, and route.fullPath in SSR-rendered markup
  • Includes a routeRules configuration guide covering prerender, swr, isr, ssr: false, and Nitro-level caching per route group
  • Designed for developers building or reviewing Nuxt 4 apps or debugging hydration mismatches and SSR-safe data fetching

Install

$ npx -y skills add affaan-m/ecc --skill nuxt4-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Nuxt 4 Patterns

Use when building or debugging Nuxt 4 apps with SSR, hybrid rendering, route rules, or page-level data fetching.

When to Activate

  • Hydration mismatches between server HTML and client state
  • Route-level rendering decisions such as prerender, SWR, ISR, or client-only sections
  • Performance work around lazy loading, lazy hydration, or payload size
  • Page or component data fetching with useFetch, useAsyncData, or $fetch
  • Nuxt routing issues tied to route params, middleware, or SSR/client differences

Hydration Safety

  • Keep the first render deterministic. Do not put Date.now(), Math.random(), browser-only APIs, or storage reads directly into SSR-rendered template state.
  • Move browser-only logic behind onMounted(), import.meta.client, ClientOnly, or a .client.vue component when the server cannot produce the same markup.
  • Use Nuxt's useRoute() composable, not the one from vue-router.
  • Do not use route.fullPath to drive SSR-rendered markup. URL fragments are client-only, which can create hydration mismatches.
  • Treat ssr: false as an escape hatch for truly browser-only areas, not a default fix for mismatches.

Data Fetching

Details

Repository
github.com/affaan-m/ecc
Category
Frontend & UI Code
First seen
Jul 14, 2026

Questions

What does the nuxt4-patterns skill help with?

The nuxt4-patterns skill gives an agent Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData. It is meant for building or reviewing a Nuxt 4 app and debugging hydration mismatches or SSR-safe data fetching.

How do I install the nuxt4-patterns skill?

Run npx -y skills add affaan-m/ecc --skill nuxt4-patterns -y in your project. After that, the agent can apply Nuxt 4 patterns such as deterministic first renders, routeRules for prerender, SWR and ISR, and lazy hydration when building or reviewing your app.

Which skills lead the Frontend & UI Code category, and how does nuxt4-patterns differ?

Other skills in the Frontend & UI Code category include vercel-react-best-practices, web-design-guidelines and design-taste-frontend. Unlike those, nuxt4-patterns focuses on Nuxt 4 specifically, covering SSR hydration safety, route-level rendering rules and data fetching with useFetch and useAsyncData.

When should I use useFetch versus useAsyncData in a Nuxt 4 app?

The skill recommends await useFetch() for SSR-safe API reads in pages and components, since it forwards server-fetched data into the Nuxt payload. Use useAsyncData() when the fetcher is not a simple $fetch() call, when you need a custom key, or when composing multiple async sources.

More from affaan-m/ecc

All 257

Similar to Nuxt4 Patterns

More Frontend & UI Code