vue

A set of coding rules for Vue 3, a JavaScript framework for building web interfaces. It specifies how to structure components and manage state with the Composition API, Pinia, and script setup.

In plain words
What is it for?
For writing and reviewing Vue 3 components, choosing between ref, reactive, computed, watch, and watchEffect, defining typed props and events, and organizing component files.
Why use it?
It gives the coding agent consistent conventions for reactive data, derived values, side effects, component structure, and typed properties and events. This reduces inconsistent Vue code across a project.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/nedcodes-ok/cursor-doctor/vue
Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctor
Per session 866 This file is loaded in full into every session.
When invoked 866 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00866 $0.00866
Opus 5 $0.00433 $0.00433
Sonnet 5 $0.00173 $0.00173
Haiku 4.5 $0.00087 $0.00087

Measured 2d ago against content hash 7052ccca3d7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

vue scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to vue — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

pro-kit/templates/frameworks/vue.mdc · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vue Cursor Rules

You are an expert Vue 3 developer (v3.4+). Follow these rules:

Composition API

  • Use <script setup> for all components — it's the default, compiles away boilerplate, and auto-exposes everything to template
  • ref() for primitives and values you reassign. reactive() for objects you mutate in place. Don't destructure a reactive() object — you lose reactivity. Use toRefs() if you must destructure
  • computed() for derived state — it caches until dependencies change. Don't use methods in templates for derived values, they re-run every render
  • watchEffect() for side effects that auto-track dependencies. watch() when you need the old value, explicit deps, or lazy execution
  • shallowRef() for large objects where you replace the whole value instead of mutating nested properties — avoids deep reactivity overhead

Components

  • SFC block order: <script setup><template><style scoped>
  • PascalCase for component names in script, kebab-case or PascalCase in templates (both work, pick one per project and stick to it)
  • defineProps with TypeScript interface for type safety. defineEmits with typed event signatures
  • Never mutate props — emit events to parent. Vue warns in dev but silently fails in prod
  • defineModel() (v3.4+) for two-way binding — replaces the modelValue + update:modelValue boilerplate
  • Use defineExpose() only when a parent genuinely needs to call a child method — don't expose by default

Composables

  • Extract reusable stateful logic into use* composables (useAuth, useDebounce, useFetch)
  • Always return refs, not raw values — callers need to maintain reactivity
  • Handle cleanup in onUnmounted or return a cleanup function for manual teardown
  • One concern per composable. useUser() that also manages notifications is doing too much
  • Composables must be called at the top level of setup — not inside conditionals or callbacks (same rule as React hooks, same reason)

State (Pinia)

  • Use setup syntax stores (defineStore('id', () => { ... })) for full Composition API — options syntax exists but limits composable reuse
  • Actions for async operations and mutations, getters for derived/computed state
  • Local component state is fine for UI-only concerns (isOpen, isHovered) — not everything belongs in a store
  • storeToRefs() when destructuring store state — plain destructuring loses reactivity
  • Stores are singletons — don't create store instances per component, that defeats the purpose

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 52 lines · 866 tokens per session scan A 7052ccca3d7b

Subscribe to this mod's changes

vue is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 5mo ago), licensed MIT. It adds 866 tokens to every session, about $0.0043 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to vue, differing in 0 lines, and is treated as a copy.