Nuxt 4+ Development
Progressive guidance for Nuxt 4+ projects (v4.3+) with latest patterns and conventions.
When to Use
Working with:
- Server routes (API endpoints, server middleware, server utils)
- File-based routing (pages, layouts, route groups)
- Nuxt middleware (route guards, navigation)
- Nuxt plugins (app extensions)
- Nuxt-specific features (auto-imports, layers, modules)
Available Guidance
Read specific files based on current work:
- references/server.md - API routes, server middleware, validation (Zod), WebSocket, SSE
- references/routing.md - File-based routing, route groups, typed router, definePage
- references/middleware-plugins.md - Route middleware, plugins, app lifecycle
- references/nuxt-composables.md - Nuxt composables (useRequestURL, useFetch, navigation)
- references/nuxt-components.md - NuxtLink, NuxtImg, NuxtTime (prefer over HTML elements)
- references/nuxt-config.md - Configuration, modules, auto-imports, layers
For Vue composables: See vue skill composables.md (VueUse, Composition API patterns)
For UI components: use nuxt-ui skill
For database/storage: use nuxthub skill
For content-driven sites: use nuxt-content skill
For creating modules: use nuxt-modules skill
For project scaffolding/CI: use ts-library skill
Loading Files
Consider loading these reference files based on your task:
DO NOT load all files at once. Load only what's relevant to your current task.
Nuxt 4 vs Older Versions
You are working with Nuxt 4+. Key differences:
| Old (Nuxt 2/3) |
New (Nuxt 4) |
<Nuxt /> |
<NuxtPage /> |
context.params |
getRouterParam(event, 'name') |
window.origin |
useRequestURL().origin |
| String routes |
Typed router with route names |
| Separate layouts/ |
Parent routes with <slot> |
If you're unsure about Nuxt 4 patterns, read the relevant guidance file first.
Latest Documentation
When to fetch latest docs:
- New Nuxt 4 features not covered here
- Module-specific configuration
- Breaking changes or deprecations
- Advanced use cases
Official sources:
Token Efficiency
Main skill: ~300 tokens. Each sub-file: ~800-1500 tokens. Only load files relevant to current task.
1---2name: nuxt-23description: Use when working on Nuxt 4+ projects - provides server routes, file-based routing, middleware patterns, Nuxt-specific composables, and configuration with latest docs. Covers h3 v1 helpers (validation, WebSocket, SSE) and nitropack v2 patterns. Updated for Nuxt 4.3+.4license: MIT5---67# Nuxt 4+ Development89Progressive guidance for Nuxt 4+ projects (v4.3+) with latest patterns and conventions.1011## When to Use1213Working with:1415- Server routes (API endpoints, server middleware, server utils)16- File-based routing (pages, layouts, route groups)17- Nuxt middleware (route guards, navigation)18- Nuxt plugins (app extensions)19- Nuxt-specific features (auto-imports, layers, modules)2021## Available Guidance2223Read specific files based on current work:2425- **[references/server.md](references/server.md)** - API routes, server middleware, validation (Zod), WebSocket, SSE26- **[references/routing.md](references/routing.md)** - File-based routing, route groups, typed router, definePage27- **[references/middleware-plugins.md](references/middleware-plugins.md)** - Route middleware, plugins, app lifecycle28- **[references/nuxt-composables.md](references/nuxt-composables.md)** - Nuxt composables (useRequestURL, useFetch, navigation)29- **[references/nuxt-components.md](references/nuxt-components.md)** - NuxtLink, NuxtImg, NuxtTime (prefer over HTML elements)30- **[references/nuxt-config.md](references/nuxt-config.md)** - Configuration, modules, auto-imports, layers3132**For Vue composables:** See `vue` skill composables.md (VueUse, Composition API patterns)33**For UI components:** use `nuxt-ui` skill34**For database/storage:** use `nuxthub` skill35**For content-driven sites:** use `nuxt-content` skill36**For creating modules:** use `nuxt-modules` skill37**For project scaffolding/CI:** use `ts-library` skill3839## Loading Files4041**Consider loading these reference files based on your task:**4243- [ ] [references/server.md](references/server.md) - if creating API endpoints or server middleware44- [ ] [references/routing.md](references/routing.md) - if setting up pages, layouts, or route groups45- [ ] [references/nuxt-composables.md](references/nuxt-composables.md) - if using Nuxt composables (useFetch, useRequestURL, etc.)46- [ ] [references/middleware-plugins.md](references/middleware-plugins.md) - if working with middleware or plugins47- [ ] [references/nuxt-components.md](references/nuxt-components.md) - if using Nuxt components (NuxtLink, NuxtImg, etc.)48- [ ] [references/nuxt-config.md](references/nuxt-config.md) - if editing nuxt.config.ts49- [ ] [references/project-setup.md](references/project-setup.md) - if setting up CI/ESLint/build tools5051**DO NOT load all files at once.** Load only what's relevant to your current task.5253## Nuxt 4 vs Older Versions5455**You are working with Nuxt 4+.** Key differences:5657| Old (Nuxt 2/3) | New (Nuxt 4) |58| ----------------- | ------------------------------- |59| `<Nuxt />` | `<NuxtPage />` |60| `context.params` | `getRouterParam(event, 'name')` |61| `window.origin` | `useRequestURL().origin` |62| String routes | Typed router with route names |63| Separate layouts/ | Parent routes with `<slot>` |6465**If you're unsure about Nuxt 4 patterns, read the relevant guidance file first.**6667## Latest Documentation6869**When to fetch latest docs:**7071- New Nuxt 4 features not covered here72- Module-specific configuration73- Breaking changes or deprecations74- Advanced use cases7576**Official sources:**7778- Nuxt: https://nuxt.com/docs79- h3 (server engine): https://v1.h3.dev/80- Nitro: https://nitro.build/8182## Token Efficiency8384Main skill: ~300 tokens. Each sub-file: ~800-1500 tokens. Only load files relevant to current task.