vue

vue is a cursor rule for Cursor from oyjt/uniapp-vue3-template. It costs 0 tokens per session (766 once invoked), scanned A, original, MIT.

A set of Vue 3 and uni-app coding rules covering components, naming, props, APIs, TypeScript, and Pinia state management.

In plain words
What is it for?
Use it when building Vue or uni-app pages, components, composable functions, props, and shared application state.
Why use it?
It gives Vue code a consistent structure and style, reducing disagreements and mistakes when adding or reviewing features.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when building Vue or uni-app pages, components, composable functions, props…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/oyjt/uniapp-vue3-template/vue
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.

Clone the repo
git clone --depth 1 https://github.com/oyjt/uniapp-vue3-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vue

README.md
[![agentmods](https://agentmods.dev/badge/rules/oyjt/uniapp-vue3-template/vue.svg)](https://agentmods.dev/rules/oyjt/uniapp-vue3-template/vue)
Your own site
<a href="https://agentmods.dev/rules/oyjt/uniapp-vue3-template/vue"><img src="https://agentmods.dev/badge/rules/oyjt/uniapp-vue3-template/vue.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00766
Opus 5 $0.00000 $0.00383
Sonnet 5 $0.00000 $0.00153
Haiku 4.5 $0.00000 $0.00077

Measured 3d ago against content hash a6a623623930, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 3d 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.

.cursor/rules/vue.mdc · 64 lines

What it actually says

Vue 开发规范

  • 你是一位前端开发专家,精通 Uniapp、Vue、Pinia、Uview Plus 等前端框架

代码风格

  • 组件: 使用单文件组件 (SFC)
  • API: 使用组合式 API (Composition API) 并搭配 <script setup> 语法糖
  • 语法: 没有特殊说明则使用 TS 进行开发 <script setup lang="ts">

命名

  • 组件 (Component) 命名: 始终采用单词大写开头 (PascalCase) 的命名方式, 并且避免与 HTML 元素冲突
  • 组件 (Component) 命名示例: 以全局的 lang-select 组件 @/components/lang-select/index.vue@/components/agree-privacy/index.vue 作为参考,注意 index 是不需要遵循大驼峰格式的
  • 页面 (Page) 命名: 始终采用短横线连接 (kebab-case) 的命名方式
  • 页面 (Page) 命名示例: 以 home 页面作为参考 @/pages/tab/home/index.vue
  • 组合式函数 (Composable) 命名: 始终采用小驼峰 (camelCase) 的命名方式
  • 组合式函数 (Composable) 命名示例: 以剪贴板组合式函数作为参考 @/hooks/use-clipboard/index.ts
  • Props 命名: 在声明 prop 的时候,其命名应该始终采用小驼峰 (camelCase),而在模板应该始终采用短横线连接 (kebab-case)
  • Props 命名示例: 声明时 const { isActive = false } = defineProps<Props>() 和传递时 <Demo :is-active="true" />
  • TS 或 JS 文件命名: 始终采用短横线连接 (kebab-case) 的命名方式
  • TS 或 JS 文件命名示例: @/utils/index.ts

API

  • 定义响应式变量时优先使用 ref 而非 reactive
  • 复杂的模板表达式则应该重构为计算属性或方法
  • 尽量避免侦听器的循坏触发,防止进入死循环

Props

  • Prop 定义应该尽量详细,包括类型、必传、默认值
  • 如果是使用了 TS 那么应该使用「基于类型的声明」,示例: const props = defineProps<Props>()

状态管理

  • 对应目录: @/store
  • 使用 Pinia
  • Store 应该按模块划分
  • 优先使用 Setup store 语法,而不是 Option Store 语法
  • 避免无脑使用全局状态管理

样式

  • 优先使用 Scoped CSS,示例: <style scoped lang="scss">
  • 尽可能避免使用 !important
  • 优先使用 UnoCSS 内联样式

其他

  • 避免直接操作 DOM
  • 尽可能编写原子化组件
  • 使用 v-for 时必须提供唯一的 key (不要轻易使用数组下标 index 当做 key)
  • 不要在同一元素上同时使用 v-ifv-for

参考示例文件

@/pages/tab/home/index.vue

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. 3d ago First seen · 64 lines · 766 tokens per session scan A a6a623623930

Subscribe to this mod's changes

vue is a cursor rule published in the GitHub repository oyjt/uniapp-vue3-template (626 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 766 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.