Apply Nuxt 4 patterns for SSR safety, performance, and data fetching.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "nuxt4-patterns" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/nuxt4-patterns/SKILL.md 2. Save it as ~/.claude/skills/nuxt4-patterns/SKILL.md 3. Reload skills and tell me it's ready
Give me a set of Nuxt 4 patterns to diagnose hydration mismatches between SSR and client rendering on the homepage. Explain what state should use useState, what logic must run client-side only, and provide safe example code.
A practical set of patterns to avoid hydration errors, with reusable Nuxt 4 code examples.
Create a Nuxt 4 performance optimization plan covering component lazy loading, route rules, prioritizing critical content, and reducing initial JavaScript on first paint.
A Nuxt 4 performance checklist with configuration advice, implementation patterns, and code snippets.
Compare when to use useFetch versus useAsyncData in Nuxt 4, and propose an SSR-safe data-fetching approach that avoids duplicate requests, empty-state flicker, and client-state mismatches.
Guidance on choosing useFetch or useAsyncData, plus stable example patterns for data fetching.
Use when building or debugging Nuxt 4 apps with SSR, hybrid rendering, route rules, or page-level data fetching.
useFetch, useAsyncData, or $fetchDate.now(), Math.random(), browser-only APIs, or storage reads directly into SSR-rendered template state.onMounted(), import.meta.client, ClientOnly, or a .client.vue component when the server cannot produce the same markup.useRoute() composable, not the one from vue-router.route.fullPath to drive SSR-rendered markup. URL fragments are client-only, which can create hydration mismatches.ssr: false as an escape hatch for truly browser-only areas, not a default fix for mismatches.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.useAsyncData() when the fetcher is not a simple $fetch() call, when you need a custom key, or when you are composing multiple async sources.useAsyncData() a stable key for cache reuse and predictable refresh behavior.useAsyncData() handlers side-effect free. They can run during SSR and hydration.$fetch() for user-triggered writes or client-only actions, not top-level page data that should be hydrated from SSR.lazy: true, useLazyFetch(), or useLazyAsyncData() for non-critical data that should not block navigation. Handle status === 'pending' in the UI.server: false only for data that is not needed for SEO or the first paint.pick and prefer shallower payloads when deep reactivity is unnecessary.const route = useRoute()
const { data: article, status, error, refresh } = await useAsyncData(
() => `article:${route.params.slug}`,
() => $fetch(`/api/articles/${route.params.slug}`),
)
const { data: comments } = await useFetch(`/api/articles/${route.params.slug}/comments`, {
lazy: true,
server: false,
})
Prefer routeRules in nuxt.config.ts for rendering and caching strategy:
export default defineNuxtConfig({
routeRules: {
'/': { prerender: true },
'/products/**': { swr: 3600 },
'/blog/**': { isr: true },
'/admin/**': { ssr: false },
'/api/**': { cache: { maxAge: 60 * 60 } },
},
})
prerender: static HTML at build timeswr: serve cached content and revalidate in the backgroundisr: incremental static regeneration on supported platformsssr: false: client-rendered routecache or redirect: Nitro-level response behaviorPick route rules per route group, not globally. Marketing pages, catalogs, dashboards, and APIs usually need different strategies.
Lazy prefix to dynamically import non-critical components.v-if so the chunk is not loaded until the UI actually needs it.<template>
<LazyRecommendations v-if="showRecommendations" />
<LazyProductGallery hydrate-on-visible />
</template>
defineLazyHydrationComponent() with a visibility or idle strategy.…
Compare prediction-market baskets with research notes to find gaps and alignment.
Run pre-release verification for Spring Boot builds, tests, scans, and diffs.
Run a four-voice council to evaluate tradeoffs before making tough decisions.
Design security and risk controls for autonomous trading agents with transaction authority
Retrieve and update Jira issues, analyze requirements, and streamline team workflows.
Coordinate behavior-preserving code refactors with tests, review, and gated commits.
Learn frontend patterns for React, Next.js, state, performance, and UI best practices.
Apply NestJS architecture patterns to build maintainable production-ready TypeScript backends.
Write and review React 18/19 components using modern best practices.
Optimize React and Next.js performance during coding, review, and refactoring.
Handle Vite config, plugins, optimization, SSR, and project setup issues.
Build polished React and Next.js animations with reusable production-ready patterns.