agentleFS
Domenico-Tenace-Open-LabsDomenico-Tenace-Open-Labs/web-dev-agent/skills/nuxt-expert/SKILL.md

nuxt-expert

Skill3 starsChanged 14 days agoMITView on GitHub

Nuxt 4 / Nuxt 3 conventions — SSR/SSG/hybrid rendering via routeRules, app/ directory structure, useFetch/useAsyncData data fetching, file-based routing, layouts, Nitro server routes, runtimeConfig env. Load when the project uses Nuxt (nuxt.config.ts, app/ or root pages/ directory, server/ handlers); also for SEO meta, hydration, deployment tuning.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read config via useRuntimeConfig() — not process.env at runtime

    line 80
  2. Very specific:

    Use Vuex — use Pinia or useState

    line 88
  3. Very specific:

    Put secrets in runtimeConfig.public

    line 89
  4. Very specific:

    Keep pages/components/composables in root for Nuxt 4 project — use app/ directory

    line 92
  5. Distinctive:

    When implementing Nuxt features, provide:

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Nuxt Expert

Senior Nuxt specialist, Vue.js meta-framework: SSR, SSG, hybrid rendering, Nitro server. Structure derived from vue-expert skill (MIT).

Builds on Vue 3: pair with skill vue-expert for Composition API, components, Pinia. Pair with skill bulma-expert when project uses Bulma — no duplication.

Core Workflow

  1. Analyze requirements - render mode per route (SSR/SSG/SPA/hybrid), data needs, auth, SEO
  2. Design architecture - app/ structure, pages, layouts, composables, Nitro routes
  3. Implement - auto-imports, useFetch/useAsyncData, file-based routing
  4. Validate - nuxi typecheck + nuxt build; verify SSR + hydration
  5. Optimize - routeRules caching/rendering, payload extraction, lazy hydration, bundle analysis
  6. Test - Vitest + @nuxt/test-utils; e2e Playwright

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Structure & auto-importsreferences/structure.mdapp/ vs root dirs, ~/ alias, srcDir, directory conventions
Pages, layouts, middlewarereferences/routing.mdFile-based routing, dynamic routes, definePageMeta, guards
Data fetchingreferences/data-fetching.mduseFetch, useAsyncData, caching, refresh, payload
Rendering modes & hydrationreferences/rendering.mdSSR/SSG/SPA/hybrid, routeRules, hydration mismatch, ClientOnly
Nitro serverreferences/server-nitro.mdserver/api, event handlers, runtimeConfig, cookies, caching
Statereferences/state.mduseState, Pinia integration, SSR-safe shared state
SEO & metadatareferences/head-seo.mduseHead, useSeoMeta, Open Graph, canonical
Config, build & deployreferences/build-config.mdnuxt.config, TypeScript strict, modules, Vite tuning, nitro preset

Quick Example

Minimal Nuxt 4 page with SSR-safe data fetching + typed props:

<!-- app/pages/users/[id].vue (Nuxt 4) / pages/users/[id].vue (Nuxt 3) -->
<script setup lang="ts">
interface User {
  id: number
  name: string
  email: string
}

const route = useRoute()

// SSR-safe: fetched on server, reused for hydration, deduped by key
const { data: user, pending, error, refresh } = await useFetch<User>(`/api/users/${route.params.id}`)

useSeoMeta({
  title: () => `User: ${user.value?.name ?? 'Loading'}`,
  description: 'User profile page'
})
</script>

<template>
  <div>
    <div v-if="pending">Loading…</div>
    <div v-else-if="error">{{ error.message }}</div>
    <div v-else-if="user">
      <h1>{{ user.name }}</h1>
      <a :href="`mailto:${user.email}`">{{ user.email }}</a>
      <button @click="refresh">Refresh</button>
    </div>
  </div>
</template>

Constraints

MUST DO

  • useFetch/useAsyncData for data that must exist on server or survive hydration — never fetch in onMounted for initial SSR data
  • Nuxt auto-imports (composables, components, utils) over manual imports from app code
  • Server-only code in server/ — never import server/ utils from client code
  • Read config via useRuntimeConfig() — not process.env at runtime
  • typescript: { strict: true }, keep pages/components typed
  • <ClientOnly> or hydration strategies for browser-only fragments
  • definePageMeta() for per-route layout, middleware, route rules metadata

MUST NOT DO

  • Access window/document unconditionally in <script setup> (SSR runs server-side)
  • Use Vuex — use Pinia or useState
  • Put secrets in runtimeConfig.public
  • Navigate with window.location — use navigateTo()/useRouter()
  • Register components manually when auto-import covers them
  • Keep pages/components/composables in root for Nuxt 4 project — use app/ directory

Output Templates

When implementing Nuxt features, provide:

  1. Page + any layout with definePageMeta() + typed data fetching
  2. Composable in app/composables/ when reusable logic exists (auto-imported)
  3. Nitro handler in server/api/ when endpoint needed
  4. nuxt.config.ts snippet for rendering modes, modules, runtimeConfig
  5. Brief explanation of rendering mode + data-fetching decision

Knowledge Reference

Nuxt 4 / Nuxt 3, SSR/SSG/SPA/hybrid via routeRules, Nitro server, useFetch/useAsyncData/useLazyFetch, file-based routing, layouts, middlewares, useState, Pinia, useHead/useSeoMeta, runtimeConfig, TypeScript strict, Vite integration, module ecosystem, @nuxt/test-utils

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.