Frontend · Skill

Build a Nuxt and Vue app

build-nuxt-vue-app

Builds a Nuxt 3 app with Vue 3 and TypeScript - script setup components, file-based pages and layouts, composables, server routes, and runtime config for secrets. Use when the user wants a Nuxt app, a Vue 3 app with server routes, or asks how Nuxt pages and composables fit together.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/raw' -o ~/'.claude/skills/build-nuxt-vue-app/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/files/LICENSE.txt' -o ~/'.claude/skills/build-nuxt-vue-app/LICENSE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/raw' -o '.cursor/skills/build-nuxt-vue-app/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/files/LICENSE.txt' -o '.cursor/skills/build-nuxt-vue-app/LICENSE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/raw' -o '.agents/skills/build-nuxt-vue-app/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-nuxt-vue-app/files/LICENSE.txt' -o '.agents/skills/build-nuxt-vue-app/LICENSE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Nuxt is the full-stack framework for Vue. Pages, server routes and composables live in one project.

When to use

  • You are starting a Vue 3 app and want file-based pages.
  • You want server routes and a browser UI in the same repo.
  • You are moving a Vue app onto Nuxt conventions.

When not to use

  • You want a mostly static content site. build-astro-site fits that better.
  • You already chose SvelteKit. Use build-sveltekit-app.

Steps

  1. Create the app with npx nuxi@latest init my-app. Pick TypeScript. Then npm install and npm run dev.
  2. Add pages as Vue files in pages. pages/about.vue becomes /about. Use <script setup lang="ts">.
  3. Share the chrome with layouts/default.vue. Put reusable pieces in components.
  4. Keep shared types next to the feature that owns them. Prefer an interface for an object shape.
  5. Put reusable reactive helpers in composables. Use VueUse only when it makes a state change easier to see.
  6. Load secrets through runtime config. Private keys stay off public. Read them in server code only.
  7. Add JSON routes under server/api. Validate input there. Do not trust the browser.
  8. Lazy-load a heavy component with a dynamic import. Check the bundle before you ship.
  9. Build with npm run build. Pick the Nuxt preset for your host.
<script setup lang="ts">
const { data: projects } = await useFetch("/api/projects");
const query = ref("");
const shown = computed(() => (projects.value ?? []).filter((p) => p.name.includes(query.value)));
</script>

<input v-model="query" placeholder="Filter" />
<ul>
  <li v-for="p in shown" :key="p.id">{{ p.name }}</li>
</ul>

Gotchas

  • A value under runtimeConfig.public is sent to the browser. Keep API keys and passwords on the private side.
  • pages and server are conventions. A component in the wrong folder does not become a route.
  • Setup code runs on the server during SSR. Guard window and other browser-only APIs.
  • Tailwind is optional. Add it only when the project already uses it.

Portability

Works on Node, or on Vercel, Netlify, Cloudflare or similar with a Nuxt preset. If you use Vue 3 with Vite and no Nuxt, the script setup and composable parts are the same. Another framework such as SvelteKit uses the same idea of file routes and server code.

Example prompt

"Build a Nuxt 3 app with Vue 3 and TypeScript that lists projects from a server route and filters them in a composable."

Done when

  • Pages use script setup and TypeScript.
  • Secrets stay in private runtime config, not in client code.
  • npm run build passes.

---

Based on the Vue 3 Nuxt 3 TypeScript rules file in PatrickJS/awesome-cursorrules (CC0 1.0, public domain). See LICENSE.txt.

Bundled files

Licence

Adapted from awesome-cursorrules contributors (vue-3-nuxt-3-typescript rules) (Public domain (CC0 1.0) - rules contributed to PatrickJS/awesome-cursorrules), CC0 1.0. Adapted by TheSkillVault: turned a short rules file into a build order with an original example; kept script setup, Nuxt folders, composables, server routes and runtime config; dropped editor and commit rules; added safety notes, gotchas, portability and done-when.

Licence: CC0 1.0. Attribution when you reuse it: Based on work by awesome-cursorrules contributors (vue-3-nuxt-3-typescript rules) (Public domain (CC0 1.0) - rules contributed to PatrickJS/awesome-cursorrules, CC0 1.0), https://github.com/PatrickJS/awesome-cursorrules/blob/b044f956f021b6e8877f16781bcfc466a6a120e9/rules/vue-3-nuxt-3-typescript-cursorrules-prompt-file.mdc; adapted by TheSkillVault, https://theskillvault.ai