Back to Nuxt.js

nuxt

Nuxt.jsVue.jsFrontend DevelopmentServer-side RenderingAPI DevelopmentFile-based RoutingComposablesNitro
682🕒 2026-06-01Source ↗

Install this skill

npx skills add onmax/nuxt-skills

Works 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

  1. Analyze current codebase to determine if the task requires server or client guidance.
  2. Load the relevant reference file (e.g., server.md or routing.md).
  3. Consult the Nuxt 4 vs older versions table to identify deprecated syntax.
  4. Refactor code to implement typed router patterns or H3 server utilities.
  5. 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

Should I read all reference files at once?
No. Always load only the file specific to your current file path or task, such as server.md for backend work.
Is this for Nuxt 3 or Nuxt 4?
This skill is specifically tuned for Nuxt 4+ patterns, though much is compatible with later Nuxt 3 versions.
What do I do if I need to build a module?
Use the dedicated nuxt-modules skill rather than this general Nuxt 4 development guide.
How does this handle server routes?
It maps your needs to the references/server.md file, which covers H3 integration and API route validation.

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.

Source & trust

682 stars🕒 Updated 2026-06-01
📄 Full skill instructions — original source: onmax/nuxt-skills
# Nuxt 4+ Development

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)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/nuxt/
  3. Save the file as SKILL.md
  4. 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

Read the Master Guide: Mastering Agent Skills

Related Skill Units

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid nuxt.js issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Nuxt.js and is published by Onmax, maintained in onmax/nuxt-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.