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.

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 3 + Vue rules

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

CursorVue / Nuxt

htmx + server-rendered HTML AGENTS.md

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

AGENTS.mdhtmx

SvelteKit AGENTS.md

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

AGENTS.mdSvelteKit

Angular 20 Copilot instructions

Copilot instructions for Angular 20 apps using standalone components, signals, and the new control flow.

GitHub CopilotAngular

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

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.