vue-3

A set of coding guidelines for Vue 3, a JavaScript framework for building web interfaces. It recommends Composition API with script setup, Pinia for shared state, TypeScript, and Vite for building the app.

In plain words
What is it for?
Use it when building or reviewing Vue 3 applications with typed code, reusable components, and shared application state.
Why use it?
It gives the project consistent choices for writing components, managing data, and compiling the application.

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/renvia-code/best-cursor-rules/vue-3
Clone the repo
git clone --depth 1 https://github.com/Renvia-code/best-cursor-rules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,758 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found 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.00000 $0.01758
Opus 5 $0.00000 $0.00879
Sonnet 5 $0.00000 $0.00352
Haiku 4.5 $0.00000 $0.00176

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

Security

Grade A, and why

vue-3 scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url)
rules/frameworks/vue-3.mdc · 365 lines

How it starts

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

Vue 3 Best Practices

Overview

Aspect Recommendation
API Style Composition API with <script setup>
State Management Pinia
Language TypeScript
Build Tool Vite

✅ DO: Use <script setup> syntax

<script setup lang="ts">
import { ref, computed } from 'vue'
import type { User } from '@/types'

// Props
const props = defineProps<{
  user: User
  showEmail?: boolean
}>()

// Emits
const emit = defineEmits<{
  (e: 'update', value: string): void
  (e: 'delete'): void
}>()

// Reactive state
const count = ref(0)
const doubled = computed(() => count.value * 2)

// Methods
function increment() {
  count.value++
}
</script>

<template>
  <div>
    <h2>{{ user.name }}</h2>
    <p v-if="showEmail">{{ user.email }}</p>
    <button @click="increment">Count: {{ count }}</button>
  </div>
</template>

Props and Emits

Props with Defaults

<script setup lang="ts">
interface Props {
  title: string
  count?: number
  items?: string[]
}

const props = withDefaults(defineProps<Props>(), {
  count: 0,
  items: () => []
})
</script>

Typed Emits

<script setup lang="ts">
const emit = defineEmits<{
  (e: 'change', id: number): void
  (e: 'update:modelValue', value: string): void
}>()

function handleChange(id: number) {
  emit('change', id)
}
</script>

Reactivity

ref vs reactive

import { ref, reactive } from 'vue'

// ✅ Use ref for primitives
const count = ref(0)
const name = ref('')

// ✅ Use reactive for objects (optional)
const state = reactive({
  users: [],
  loading: false
})

// ✅ Access ref values with .value in script
count.value++

// Template auto-unwraps refs
// <span>{{ count }}</span>  ← No .value needed

Computed Properties

<script setup lang="ts">
import { ref, computed } from 'vue'

const firstName = ref('John')
const lastName = ref('Doe')

// Read-only computed
const fullName = computed(() => `${firstName.value} ${lastName.value}`)

// Writable computed
const fullNameWritable = computed({
  get: () => `${firstName.value} ${lastName.value}`,
  set: (value: string) => {
    const [first, last] = value.split(' ')
    firstName.value = first
    lastName.value = last
  }
})
</script>

Read the full file on GitHub · 365 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 · 365 lines · 0 tokens per session scan A 8d26fcd311fe

Subscribe to this mod's changes

vue-3 is a cursor rule published in the GitHub repository Renvia-code/best-cursor-rules (12 stars, last pushed 9mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 1,758 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.