nuxt

Implement Nuxt 4+ patterns for server routes, routing, and middleware.

26|2|Updated Jun 16, 2025
One-click install
npx skills add https://github.com/besidka/besidka --skill nuxt-besidka
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nuxt
Source: https://github.com/besidka/besidka/tree/main/.ai/skills/nuxt
Command: npx skills add https://github.com/besidka/besidka --skill nuxt-besidka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Nuxt 4+ projects often require up-to-date patterns for server routes, file-based routing, middleware, and Nuxt-specific functionality. This Skill consolidates guidance into a single, maintainable playbook that accelerates setup and reduces misconfigurations.

Core Features & Use Cases

  • Guidance on building server routes, API endpoints, and server middleware with Nuxt 4+.
  • File-based routing practices, route groups, typed router navigation, and Nuxt 4 patterns.
  • Middleware patterns, auto-imports, and Nuxt composables for data fetching and UI utilities.
  • Example real-world usage: bootstrap a Nuxt 4+ project with a sample authenticated route and a basic API.

Quick Start

  • Create a Nuxt 4+ project skeleton with server routes, file-based routing, and a sample middleware.

Frequently Asked Questions about nuxt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up file-based routing and middleware in a Nuxt 4 project?

Nuxt 4 file-based routing automatically generates routes from your directory structure, while middleware functions run before page rendering to guard access. You define middleware in the middleware directory and apply it to routes or globally to control navigation.

What are Nitro server routes in Nuxt and when do I need them?

Nitro server routes in Nuxt let you build API endpoints and server middleware directly in your project. You need them when creating backend functionality like handling form submissions, serving JSON data, or implementing authentication checks without an external server.

Can I use auto-imported composables for data fetching in Nuxt 4?

Yes, Nuxt 4 auto-imports composables like useFetch and useAsyncData for data fetching without manual imports. These composables handle SSR-compatible data requests, caching, and reactive state management out of the box across your application components.

Do I need any external tools beyond Node.js to work with Nuxt 4 patterns?

No, you only need Node.js and Nuxt installed to implement server routes, routing, middleware, and composables. The framework provides built-in guidance and examples for configuration, server utilities, and Nitro v2 patterns without requiring additional external tooling.

What's the best way to structure route groups and authenticated routes in Nuxt 4?

The best way to structure authenticated routes in Nuxt 4 is combining route groups for organization with middleware for access control. You create a sample middleware function that checks auth state, then apply it to protected route groups within your file-based routing structure.

How does Nuxt 4 typed router navigation improve route safety?

Nuxt 4 typed router navigation generates TypeScript types from your file-based routes, enabling autocompletion and compile-time error checking for route names and parameters. This catches invalid navigation calls during development rather than at runtime in production.