返回 Skill 列表
extension
分类: 开发与工程无需 API Key

nuxt

在使用Nuxt 4+项目时使用 - 提供服务器路由、基于文件的路由、中间件模式、Nuxt特定的组合式API以及带有最新文档的配置。涵盖h3 v1助手(验证、WebSocket、SSE)和nitropack v2模式。更新至Nuxt 4.3+。

person作者: jakexiaohubgithub

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:

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:

  • 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.