Home › Vue / Nuxt › Nuxt 3 + Vue rules

Nuxt 3 + Vue rules

Cursor rules for Nuxt 3 / Vue 3 apps using the Composition API, script setup and Pinia.

CursorVue / Nuxt

How to use

Save this as .cursor/rules/nuxt.mdc in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.cursor/rules/nuxt.mdcDownload  
---
description: Nuxt + Vue conventions
globs: ["**/*.vue", "composables/**/*.ts", "server/**/*.ts"]
---

# Nuxt 3 / Vue 3

- Always `<script setup lang="ts">` with the Composition API. No Options API in new code.
- Type props with `defineProps<{...}>()` and emits with `defineEmits<{...}>()`.
- Data fetching with `useFetch`/`useAsyncData` (SSR-safe); never fetch in `onMounted` for initial page data.
- Rely on Nuxt auto-imports for components, composables and Vue APIs; don't add redundant imports.
- Shared logic in `composables/useX.ts`; global state in Pinia stores under `stores/`.
- Server endpoints in `server/api/*.ts` with `defineEventHandler`; validate input with zod (`readValidatedBody`).
- SEO per page with `useSeoMeta`.
- Run `npx nuxi typecheck` and `npm run lint` before finishing.

Related rules

Astro content site rules

Cursor rules for Astro 5 sites with content collections, islands, and zero-JS-by-default pages.

CursorAstro

Chrome extension (Manifest V3) rules

Cursor rules for building Manifest V3 browser extensions with TypeScript and minimal permissions.

CursorChrome extensions

Cloudflare Agents SDK rules

Cursor rules for stateful AI agents on Cloudflare (agents package): Durable Object state, SQL, scheduling, and WebSockets.

CursorCloudflare Workers / Hono

Convex backend rules

Cursor rules for Convex backends: schema, validated queries/mutations/actions, indexes, and auth checks.

CursorConvex

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.