Token导航 LogoToken导航TokenDH.com
开发规范操作浏览器github未标认证来源可访问许可证需确认审计通过

vue3-best-practicesvue3 最佳实践

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

2,179

周安装

89

GitHub Stars

2

下载量

698
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:vue3-best-practices(vue3 最佳实践)
来源仓库:https://github.com/eva813/vue3-skills
仓库路径:skills/vue3-best-practices
安装命令:
npx skills add https://github.com/eva813/vue3-skills --skill vue3-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/eva813/vue3-skills --skill vue3-best-practices

简介

vue3-best-practices 提供 Vue 3 性能优化与开发规范指导,含 45 条规则分类。

  • 适用于新项目代码编写、旧项目重构或团队编码标准统一。
  • 覆盖响应式数据、组合式函数、异步处理等高频应用场景。
  • 建议结合 Pinia/Vuex 状态管理及构建工具链进行综合评估。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Vue 3 Best Practices

Comprehensive performance optimization and development guide for Vue 3 applications. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new Vue 3 components or composables
  • Implementing reactive data and computed properties
  • Reviewing code for performance issues
  • Refactoring from Vue 2 to Vue 3
  • Optimizing bundle size or load times
  • Working with state management (Pinia/Vuex)
  • Implementing async operations in components

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Reactivity PerformanceCRITICALreactivity-
2Component OptimizationCRITICALcomponent-
3Bundle Size & LoadingHIGHbundle-
4Composition APIMEDIUM-HIGHcomposition-
5Template PerformanceMEDIUMtemplate-
6State ManagementMEDIUMstate-
7Lifecycle OptimizationLOW-MEDIUMlifecycle-
8Advanced PatternsLOWadvanced-

Quick Reference

1. Reactivity Performance (CRITICAL)

  • reactivity-ref-vs-reactive - Use ref for primitives, reactive for objects
  • reactivity-shallow-ref - Use shallowRef for large immutable objects
  • reactivity-computed-caching - Leverage computed property caching
  • reactivity-watch-vs-watcheffect - Choose appropriate watcher
  • reactivity-unref-performance - Minimize unref calls in hot paths
  • reactivity-readonly-immutable - Use readonly for immutable data

2. Component Optimization (CRITICAL)

  • component-async-components - Use defineAsyncComponent for heavy components
  • component-functional - Use functional components for simple presentational logic
  • component-keep-alive - Cache expensive components with keep-alive
  • component-lazy-hydration - Implement lazy hydration for non-critical components
  • component-prop-validation - Use efficient prop validation
  • component-emit-performance - Optimize event emissions

3. Bundle Size & Loading (HIGH)

  • bundle-tree-shaking - Structure imports for optimal tree-shaking
  • bundle-dynamic-imports - Use dynamic imports for code splitting
  • bundle-plugin-imports - Use unplugin-auto-import for better DX
  • bundle-lodash-imports - Import lodash functions individually
  • bundle-moment-alternatives - Use day.js instead of moment.js
  • bundle-icons-optimization - Optimize icon imports and usage

4. Composition API (MEDIUM-HIGH)

  • composition-script-setup - Prefer for better performance
  • composition-composables-reuse - Extract reusable logic into composables
  • composition-provide-inject - Use provide/inject for dependency injection
  • composition-expose-selectively - Expose only necessary properties
  • composition-reactive-transform - Use reactive transform where appropriate
  • composition-auto-import - Configure auto-imports for better DX

5. Template Performance (MEDIUM)

  • template-v-once - Use v-once for static content
  • template-v-memo - Use v-memo for expensive list rendering
  • template-key-optimization - Optimize v-for keys for performance
  • template-conditional-rendering - Choose v-if vs v-show appropriately
  • template-slot-performance - Optimize slot usage and scoped slots
  • template-directive-optimization - Create efficient custom directives

6. State Management (MEDIUM)

  • state-pinia-optimization - Optimize Pinia store structure
  • state-store-composition - Use store composition patterns
  • state-persistence - Implement efficient state persistence
  • state-normalization - Normalize complex state structures
  • state-subscription - Optimize state subscriptions
  • state-devtools - Configure devtools for debugging

7. Lifecycle Optimization (LOW-MEDIUM)

  • lifecycle-cleanup - Properly cleanup resources in onUnmounted
  • lifecycle-async-setup - Handle async operations in setup
  • lifecycle-watchers-cleanup - Clean up watchers and effects
  • lifecycle-dom-access - Access DOM safely in lifecycle hooks
  • lifecycle-ssr-considerations - Handle SSR lifecycle differences

8. Advanced Patterns (LOW)

  • advanced-teleport-usage - Use Teleport for portal patterns
  • advanced-suspense-async - Implement Suspense with async components
  • advanced-custom-renderer - Create custom renderers when needed
  • advanced-compiler-macros - Use compiler macros effectively
  • advanced-plugin-development - Develop efficient Vue plugins

Framework Integration

Vite Integration

  • Utilize Vite's fast HMR and build optimizations
  • Configure proper chunk splitting strategies
  • Use Vite plugins for Vue-specific optimizations

TypeScript Integration

  • Leverage Vue 3's improved TypeScript support
  • Use proper type definitions for better DX
  • Configure TypeScript for optimal build performance

Testing Integration

  • Use Vue Test Utils with Composition API
  • Implement efficient component testing strategies
  • Optimize test performance and reliability

How to Use

Read individual rule files for detailed explanations and code examples:

rules/reactivity-ref-vs-reactive.md
rules/component-async-components.md
rules/composition-script-setup.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect Vue 3 code example with explanation
  • Correct Vue 3 code example with explanation
  • Performance impact and measurements
  • Additional context and Vue 3-specific considerations

Migration from Vue 2

Special considerations for migrating from Vue 2:

  • Composition API vs Options API patterns
  • Reactivity system changes and optimizations
  • Component definition and registration updates
  • Event handling and lifecycle changes

Performance Monitoring

Tools and techniques for monitoring Vue 3 performance:

  • Vue DevTools integration
  • Performance profiling with browser tools
  • Bundle analysis and optimization
  • Runtime performance monitoring

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.18%
按下载量换算246

Claude

30.13%
按下载量换算210

Cursor

18.54%
按下载量换算129

Gemini CLI

8.43%
按下载量换算59

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills