nuxt
Install this skill
npx skills add onmax/nuxt-skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
This skill acts as a navigational guide for Nuxt 4 development, focusing on the framework's modern architecture and server-side engine, Nitro. It prioritizes efficient context loading, instructing AI agents to access specific documentation files—such as server routes, routing conventions, or middleware plugins—only when necessary to maintain token economy. By adhering to Nuxt 4-specific patterns like typed routing and improved request handling, this resource helps developers avoid deprecated practices found in Nuxt 2 or 3. It serves as a structured interface between the codebase and official documentation, ensuring that configuration, data fetching, and app lifecycle management remain consistent with current ecosystem standards. This systematic approach reduces hallucination risks during complex refactors or new feature implementation by grounding the agent in the latest framework conventions.
When to Use This Skill
- •Building API endpoints within the Nitro server engine
- •Migrating legacy page components to Nuxt 4 typed routing
- •Defining global authentication middleware for protected routes
- •Configuring custom module layers or auto-import settings
- •Implementing server-side data fetching with useFetch
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- “How do I setup a server API route in Nuxt 4?
- “Show me the correct way to handle route middleware
- “Explain Nuxt 4 file-based routing conventions
- “How to use typed routing instead of string-based paths?
- “Update my Nuxt configuration for auto-imports
Pro Tips
- 💡Always specify 'Nuxt 4+' when invoking the skill to ensure the most relevant and up-to-date guidance, especially regarding h3 v1 and nitropack v2.
- 💡Combine this skill with a 'typescript' skill for enhanced type safety and better autocompletion, particularly when dealing with typed routers and Zod validation.
- 💡For performance-critical components, ask the skill for best practices on `NuxtImg` and `NuxtTime` usage, preferring them over standard HTML elements where appropriate.
What this skill does
- •Context-aware guidance for Nuxt 4 server routes and API middleware
- •Typed routing and file-based layout structure management
- •Lifecycle management via specialized route guards and plugins
- •Configuration and module integration for Nuxt 4 build systems
- •Optimized implementation of built-in components like NuxtLink and NuxtImg
When not to use it
- ✕Projects strictly requiring Nuxt 2 or early Nuxt 3 compatibility
- ✕Pure client-side SPAs that do not benefit from Nitro server features
- ✕When another domain-specific skill like nuxthub or nuxt-ui handles the task
Example workflow
- Analyze current codebase to determine if the task requires server or client guidance.
- Load the relevant reference file (e.g., server.md or routing.md).
- Consult the Nuxt 4 vs older versions table to identify deprecated syntax.
- Refactor code to implement typed router patterns or H3 server utilities.
- Verify integration against official Nuxt and Nitro documentation if edge cases arise.
Prerequisites
- –Basic knowledge of Vue 3 Composition API
- –Familiarity with TypeScript
- –Active Nuxt 4 project environment
Pitfalls & limitations
- !Over-requesting documentation files leads to high token consumption.
- !Applying deprecated Nuxt 3 logic to Nuxt 4 server events.
- !Failing to use built-in Nuxt components, resulting in unnecessary layout shifts.
FAQ
How it compares
Generic prompts often suggest outdated Nuxt 2/3 patterns; this skill forces strict adherence to Nuxt 4 typed router and Nitro engine conventions.
📄 Full skill instructions — original source: onmax/nuxt-skills
Progressive guidance for Nuxt 4+ projects 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](references/server.md)** - API routes, server middleware, validation (Zod), WebSocket, SSE
- **[references/routing.md](references/routing.md)** - File-based routing, route groups, typed router, definePage
- **[references/middleware-plugins.md](references/middleware-plugins.md)** - Route middleware, plugins, app lifecycle
- **[references/nuxt-composables.md](references/nuxt-composables.md)** - Nuxt composables (useRequestURL, useFetch, navigation)
- **[references/nuxt-components.md](references/nuxt-components.md)** - NuxtLink, NuxtImg, NuxtTime (prefer over HTML elements)
- **[references/nuxt-config.md](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
personal-ts-setup skill## Usage Pattern
**Progressive loading - only read what you need:**
- Creating API endpoint? → [references/server.md](references/server.md)
- Setting up pages/routing? → [references/routing.md](references/routing.md)
- Using composables/data fetching? → [references/nuxt-composables.md](references/nuxt-composables.md)
- Adding middleware/plugins? → [references/middleware-plugins.md](references/middleware-plugins.md)
- Configuring Nuxt? → [references/nuxt-config.md](references/nuxt-config.md)
- Setting up CI/ESLint? → [references/project-setup.md](references/project-setup.md)
**DO NOT read all files at once.** Load based on context:
- Working in
server/ → read server.md- Working in
pages/ or layouts/ → read routing.md- Using
useFetch, useRequestURL, navigation → read nuxt-composables.md- Using
<a>, <img>, <time> elements → read nuxt-components.md- Working in
middleware/ or plugins/ → read middleware-plugins.md- Editing
nuxt.config.ts → read nuxt-config.md## 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:**
- Nuxt: https://nuxt.com/docs
- h3 (server engine): https://v1.h3.dev/
- Nitro: https://nitro.build/
## Token Efficiency
Main skill: ~300 tokens. Each sub-file: ~800-1500 tokens. Only load files relevant to current task.
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/nuxt/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/onmax/nuxt-skills/nuxt/SKILL.md - Cursor:
~/.cursor/skills/onmax/nuxt-skills/nuxt/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/onmax/nuxt-skills/nuxt/SKILL.md
🚀 Install with CLI:npx skills add onmax/nuxt-skills
