vue-typescript-patterns

vue-typescript-patterns is a cursor rule for Cursor from soaring-xiongkulu/easyaiot. It costs 381 tokens per session, scanned A, original, MIT.

A set of coding rules for Vue 3 projects using TypeScript, a language that adds type checking to JavaScript. It covers component structure, file locations, TypeScript usage, and Pinia, a library for shared application state.

In plain words
What is it for?
Use it when building or reviewing Vue single-file components, TypeScript code, API response types, and Pinia stores. It applies to .vue, .ts, and .tsx files.
Why use it?
It gives the codebase a consistent structure and catches common type and component-organization problems. This reduces decisions developers must make when adding or changing Vue files.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when building or reviewing Vue single-file components, TypeScript code, API response types, and Pinia stores. It applies to .vue, .ts, and .tsx files.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns
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/soaring-xiongkulu/easyaiot

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-typescript-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns/github.svg)](https://agentmods.dev/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns)
Your own site
<a href="https://agentmods.dev/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns"><img src="https://agentmods.dev/badge/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vue-typescript-patterns

Your own site · 80×15
<a href="https://agentmods.dev/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns"><img src="https://agentmods.dev/badge/rules/soaring-xiongkulu/easyaiot/vue-typescript-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 381 This file is loaded in full into every session.
When invoked 381 The same file — it is already loaded in full.
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.00381 $0.00381
Opus 5 $0.00191 $0.00191
Sonnet 5 $0.00076 $0.00076
Haiku 4.5 $0.00038 $0.00038

Measured 9d ago against content hash 3011d493ea2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

vue-typescript-patterns 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 9d 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.

APP/.cursor/rules/vue-typescript-patterns.mdc · 54 lines

What it actually says

Vue3 + TypeScript 开发规范

Vue 组件规范

  • 使用 Composition API 和 <script setup> 语法
  • 组件文件使用 PascalCase 命名
  • 页面文件放在 src/pages/ 目录下
  • 全局组件文件放在 src/components/ 目录下
  • 局部组件文件放在页面的 /components/ 目录下

Vue SFC 组件规范

  • <script setup lang="ts"> 标签必须是第一个子元素
  • <template> 标签必须是第二个子元素
  • <style scoped> 标签必须是最后一个子元素(因为推荐使用原子化类名,所以很可能没有)

TypeScript 规范

  • 严格使用 TypeScript,避免使用 any 类型
  • 为 API 响应数据定义接口类型
  • 使用 interface 定义对象类型,type 定义联合类型
  • 导入类型时使用 import type 语法

状态管理

  • 使用 Pinia 进行状态管理
  • Store 文件放在 src/store/ 目录下
  • 使用 defineStore 定义 store
  • 支持持久化存储

示例代码结构

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

const userInfo = ref<UserInfo | null>(null)

onMounted(() => {
  // 初始化逻辑
})
</script>

<template>
  <view class="container">
    <!-- 模板内容 -->
  </view>
</template>

<style lang="scss" scoped>
.container {
  // 样式
}
</style>
---
globs: *.vue,*.ts,*.tsx
---
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. 9d ago First seen · 54 lines · 381 tokens per session scan A 3011d493ea2f

Subscribe to this mod's changes

vue-typescript-patterns is a cursor rule published in the GitHub repository soaring-xiongkulu/easyaiot (709 stars, last pushed 5d ago), licensed MIT. It adds 381 tokens to every session, about $0.0019 per session on Opus 5. 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-08-30.