Nuxt
Use Nuxt-owned primitives for Nuxt lifecycle, rendering, routing, and server behavior. Hand module-specific behavior to the matching module skill instead of reproducing its API here.
Start here
- Inspect
package.json, the lockfile, nuxt.config.*, and the directory layout before choosing an API. Nuxt features move, so verify the installed version instead of assuming the latest release.
- Open only the reference that owns the task.
- Prefer the smallest Nuxt primitive that preserves SSR, hydration, and generated types.
- Run
nuxt prepare after config, module, alias, or generated-type changes, then verify the affected runtime path.
Reference map
- Project structure, upgrades, deployment mode, and testing: project-setup.md
- Data fetching, state, request context, cookies, head, and hydration: nuxt-composables.md
- Pages, layouts, navigation, route metadata, and errors: routing.md
- Route middleware, app plugins, and runtime hooks: middleware-plugins.md
- API routes, server middleware, validation, caching, and Nitro: server.md
- Built-in components, assets, images, and lazy hydration: nuxt-components.md
- Nuxt config, runtime config, route rules, layers, modules, Vite, and Nitro options: nuxt-config.md
Ownership boundaries
- Use the
nuxt-modules skill for authoring or publishing a Nuxt module.
- Use the relevant module skill for Nuxt UI, Nuxt Content, Nuxt Studio, NuxtHub, Nuxt Image, Nuxt Scripts, Nuxt SEO, or another installed module.
- Use official VueUse guidance for VueUse composables. When names overlap, Nuxt owns Nuxt lifecycle and SSR semantics; see nuxt-composables.md.
- Use Vue guidance for component-local reactivity that has no Nuxt lifecycle or rendering concern.
Baseline
<script setup lang="ts">
const { data: products, status, error } = await useFetch('/api/products')
useSeoMeta({
title: 'Products',
description: 'Browse the product catalog.',
})
</script>
<template>
<main>
<p v-if="status === 'pending'">Loading…</p>
<p v-else-if="error">Could not load products.</p>
<ProductList v-else :products="products ?? []" />
</main>
</template>
useFetch integrates the request with Nuxt's SSR payload, while useSeoMeta participates in Nuxt's head lifecycle. Reach for lower-level primitives only when the task needs behavior these do not provide.
1---2name: nuxt3description: Nuxt application development and maintenance. Use for project structure, pages and routing, data fetching, SSR-safe state, middleware, plugins, server routes, runtime config, route rules, layers, built-in components, hydration, upgrades, and testing.4license: MIT5---6
7# Nuxt
8
9Use Nuxt-owned primitives for Nuxt lifecycle, rendering, routing, and server behavior. Hand module-specific behavior to the matching module skill instead of reproducing its API here.
10
11## Start here
12
131. Inspect `package.json`, the lockfile, `nuxt.config.*`, and the directory layout before choosing an API. Nuxt features move, so verify the installed version instead of assuming the latest release.
142. Open only the reference that owns the task.
153. Prefer the smallest Nuxt primitive that preserves SSR, hydration, and generated types.
164. Run `nuxt prepare` after config, module, alias, or generated-type changes, then verify the affected runtime path.
17
18## Reference map
19
20- Project structure, upgrades, deployment mode, and testing: [project-setup.md](references/project-setup.md)
21- Data fetching, state, request context, cookies, head, and hydration: [nuxt-composables.md](references/nuxt-composables.md)
22- Pages, layouts, navigation, route metadata, and errors: [routing.md](references/routing.md)
23- Route middleware, app plugins, and runtime hooks: [middleware-plugins.md](references/middleware-plugins.md)
24- API routes, server middleware, validation, caching, and Nitro: [server.md](references/server.md)
25- Built-in components, assets, images, and lazy hydration: [nuxt-components.md](references/nuxt-components.md)
26- Nuxt config, runtime config, route rules, layers, modules, Vite, and Nitro options: [nuxt-config.md](references/nuxt-config.md)
27
28## Ownership boundaries
29
30- Use the `nuxt-modules` skill for authoring or publishing a Nuxt module.
31- Use the relevant module skill for Nuxt UI, Nuxt Content, Nuxt Studio, NuxtHub, Nuxt Image, Nuxt Scripts, Nuxt SEO, or another installed module.
32- Use official VueUse guidance for VueUse composables. When names overlap, Nuxt owns Nuxt lifecycle and SSR semantics; see [nuxt-composables.md](references/nuxt-composables.md#vueuse-boundary).
33- Use Vue guidance for component-local reactivity that has no Nuxt lifecycle or rendering concern.
34
35## Baseline
36
37```vue
38<script setup lang="ts">
39const { data: products, status, error } = await useFetch('/api/products')
40
41useSeoMeta({
42 title: 'Products',
43 description: 'Browse the product catalog.',
44})
45</script>
46
47<template>
48 <main>
49 <p v-if="status === 'pending'">Loading…</p>
50 <p v-else-if="error">Could not load products.</p>
51 <ProductList v-else :products="products ?? []" />
52 </main>
53</template>
54```
55
56`useFetch` integrates the request with Nuxt's SSR payload, while `useSeoMeta` participates in Nuxt's head lifecycle. Reach for lower-level primitives only when the task needs behavior these do not provide.