vue-nuxt
Use when the user asks about Nuxt 4 or Nuxt 3, useFetch and useAsyncData, server routes in server/api, Nitro, Nuxt layers, route rules, the app/ directory…
от j4flmao★ 47 звёзд на GitHub
Установить vue-nuxt в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Nuxt
Purpose
Build Nuxt 4 applications (Nuxt 3 reached end of life on 31 July 2026; upgrade with npx nuxt upgrade and the v4 migration guide) with directory-based routing, server-side data fetching, and auto-imported components and composables. useFetch for data, server/api/ for backend endpoints. Nuxt 4 (2025) moves app code into app/ by default, makes data a shallowRef, defaults it to undefined instead of null, and changes pending semantics, so check status instead.
Agent Protocol
Trigger
Exact user phrases: "Nuxt", "Nuxt 3", "Nuxt structure", "Nuxt composables", "Nuxt server routes", "useFetch", "useAsyncData", "Nuxt layers", "Nuxt architecture".
Input Context
Before activating, verify:
- nuxt.config.ts exists; check the
nuxtmajor version in package.json (3 or 4) and whether source lives inapp/. - The feature or page being created is known.
Output Artifact
No file output. Produces directory structure and page/component code as text.
Response Format
Directory structure:
app/
pages/
components/
composables/
server/api/
Code: SFC with script setup. No import statements.
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Pages use file-based routing in pages/ directory.
- Data fetching uses useFetch by default (useAsyncData when the data source is not an API).
- Server routes in server/api/ for backend logic.
- Components in components/ are auto-imported (globally available).
- Composables in composables/ are auto-imported.
- Layouts use definePageMeta for opt-in.
- Nuxt layers configured for shared code across projects (if multi-project).
Max Response Length
2560 tokens.
Component Architecture / Decision Trees
Architecture Options
| Approach | Trade-off | When to Use |
|---|---|---|
| useFetch | SSR-hydrated, caching, dedup | API data on page load |
| useAsyncData | SSR-hydrated, no automatic fetch | Custom async logic |
| $fetch | No SSR hydration, direct call | Mutations, client-only data |
| server/api/ | Backend endpoints | All server-side logic |
| server/routes/ | Non-API server routes | Webhooks, middleware |
| Pinia stores | Client state | Auth, cart, UI state |
Decision Tree: Data Fetching
Is the data loaded on page render?
├── Yes -> Can it be fetched from an API URL?
│ ├── Yes -> useFetch
│ └── No (needs processing) -> useAsyncData + $fetch
└── No (user action, mutation) -> $fetch
Decision Tree: SSR vs Static vs SPA
Is SEO important?
├── Yes -> SSR (default) or prerender
│ └── Static content that rarely changes -> prerender: true
├── Partially -> Hybrid SSR + prerender
└── No (dashboard, admin) -> ssr: false in nuxt.config
Decision Tree: State Location
Where is this state needed?
├── Single page -> ref/computed locally
├── Page + children -> useState or provide/inject
├── Multiple pages across routes -> Pinia store
└── Server-side state (DB, cache) -> useFetch / server route
Component Design Patterns
Page with useFetch
<script setup lang="ts">
definePageMeta({ layout: 'default', title: 'Products' })
const page = ref(1)
const { data, status, error } = await useFetch('/api/products', {
query: { page, limit: 20 },
watch: [page],
default: () => ({ products: [], total: 0 }),
})
</script>
<template>
<div v-if="status === 'pending'">Loading...</div>
<div v-else-if="error">Error: {{ error.message }}</div>
<div v-else>
<ProductCard v-for="p in data.products" :key="p.id" :product="p" />
<button @click="page++" :disabled="data.products.length >= data.total">Load More</button>
</div>
</template>
useAsyncData for Processed Data
<script setup lang="ts">
const { data: stats } = await useAsyncData('dashboard-stats', async () => {
const [users, orders, revenue] = await Promise.all([
$fetch('/api/stats/users'),
$fetch('/api/stats/orders'),
$fetch('/api/stats/revenue'),
])
return { totalUsers: users.count, totalOrders: orders.count, revenue: revenue.amount }
})
</script>
Server Route with Validation
// server/api/products/[id].delete.ts
import { z } from 'zod'
export default defineEventHandler(async (event) => {
const id = getRouterParam(event, 'id')
const body = await readBody(event)
const schema = z.object({ reason: z.string().min(1).optional() })
const parsed = schema.safeParse(body)
if (!parsed.success) throw createError({ statusCode: 400, statusMessage: 'Invalid body' })
await db.product.delete({ where: { id } })
return { success: true }
})
Auth Middleware
// middleware/auth.global.ts
export default defineNuxtRouteMiddleware(async (to, from) => {
if (process.server) return // skip on first render
const token = useCookie('token')
if (!token.value && to.path !== '/
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/composables-autoimport.md
- references/nuxt-auth.md
- references/nuxt-conventions.md
- references/nuxt-deployment.md
- references/nuxt-modules.md
- references/nuxt-performance.md
- references/nuxt-testing.md
- references/server-routes.md
FAQ
Что делает скилл vue-nuxt?
Use when the user asks about Nuxt 4 or Nuxt 3, useFetch and useAsyncData, server routes in server/api, Nitro, Nuxt layers, route rules, the app/ directory, auto-imports or upgrading Nuxt 3 to 4. Produces Nuxt app structure, data fetching and server code. Not for plain Vue 3 SPA structure (use vue-architecture).
Как установить скилл vue-nuxt?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vue-nuxt запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…