RuleMembers

Vue 3 Cursor rules for Pinia state

Vue + Pinia Guidelines is a Cursor rule file on state management with Pinia in Vue 3 and TypeScript. It helps Vue developers decide which state belongs in a store, so Pinia holds only shared client state while components, routes and the data layer keep the rest.

What it does

Component-only state stays in ref, reactive or computed, shareable navigation state lives in route params and queries, and server data comes from Nuxt useFetch, TanStack Query for Vue or the API layer. Setup stores use defineStore with one file per domain under stores/. Getters stay pure, and components use storeToRefs() when destructuring.

How to use it

The globs match .ts and .vue files.

Requirements and limits

Server data should not be copied into Pinia except for drafts, offline caches or similar documented cases.

More in Rules and the Cursor library.

What it covers

  • State Ownership
  • Store Structure
  • Component Usage
  • TypeScript
  • Actions and Side Effects
  • SSR, Nuxt, and Router Guards
  • Persistence
  • Testing and Tooling
  • Anti-Patterns

The full text is in the members library

Book a call and we will give you access to the full Cursor library: every entry in full, search by meaning, copy and download.

Source and license

Source: https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/vue-pinia-cursorrules-prompt-file.mdc

Author: PatrickJS, Awesome cursorrules. License: CC0-1.0.

Related entries