Home › Vue / Nuxt › Vue 3 + Pinia AGENTS.md

Vue 3 + Pinia AGENTS.md

AGENTS.md for Vue 3.5 single-page apps on Vite with the Composition API, Pinia, and Vue Router 4.

AGENTS.mdVue / Nuxt

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

AGENTS.mdDownload  
# AGENTS.md: Vue 3 + Pinia

## Commands
- Dev: `npm run dev` · Types: `npx vue-tsc --noEmit` · Tests: `npx vitest run` · Lint: `npm run lint`

## Conventions
- Single-file components with `<script setup lang="ts">`. No Options API in new code.
- Props via `defineProps<{...}>()` with reactive destructuring (Vue 3.5) and defaults in the destructure; emits via `defineEmits<{...}>()`; two-way binding via `defineModel()`.
- Reuse logic as composables in `src/composables/useX.ts` that return refs.
- Global state in Pinia setup stores (`defineStore('cart', () => {...})`). Read in components with `storeToRefs` so reactivity survives destructuring.
- Prefer `computed` over `watch`. Use `watch` only for side effects; clean up with `onWatcherCleanup`.
- Routes are lazy (`component: () => import('...')`) and typed route names are used in `router.push({ name })`.
- Template refs via `useTemplateRef('name')`.

## Don't
- Don't mutate props, and don't use `this` or mixins.
- Don't call stores at module top level outside setup (Pinia isn't installed yet).
- Don't add Vuex.

## Done
Types, tests, lint and `npm run build` pass. Mention any new component's props in the summary.

More: all Vue / Nuxt rules · all AGENTS.md rules

Related rules

Nuxt 4 AGENTS.md

AGENTS.md for Nuxt 4 apps: the app/ directory layout, data fetching keys, server routes with validation, and runtime config.

AGENTS.mdVue / Nuxt

Nuxt 3 + Vue rules

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

CursorVue / Nuxt

Browser extension with WXT AGENTS.md

AGENTS.md for cross-browser Manifest V3 extensions built with WXT: entrypoints, messaging, storage, and permissions.

AGENTS.mdChrome extensions

htmx + server-rendered HTML AGENTS.md

AGENTS.md for htmx 2 apps with server-rendered templates (any backend), partials, and progressive enhancement.

AGENTS.mdhtmx

Next.js AGENTS.md

AGENTS.md for Next.js 16 App Router projects: commands, folder layout, data access, auth, and done criteria.

AGENTS.mdNext.js

SvelteKit AGENTS.md

AGENTS.md for SvelteKit 2 + Svelte 5 (runes) apps with TypeScript.

AGENTS.mdSvelteKit

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.