vue-best-practices
Vue 3 and Vue.js best practices for TypeScript, vue-tsc, and Volar. This skill should be used when writing, reviewing, or refactoring Vue components to ensure correct typing patterns. Triggers on tasks involving Vue components, props extraction, wrapper components, template type checking, or Volar configuration.
- License 许可
- MIT
- 最近更新
- 2026-04-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- vue-best-practices
- license
- MIT
- metadata
- { "author": "hyf0", "version": "8.0.0" }
- description
- Vue 3 and Vue.js best practices for TypeScript, vue-tsc, and Volar. This skill should be used when writing, reviewing, or refactoring Vue components to ensure correct typing patterns. Triggers on tasks involving Vue components, props extraction, wrapper components, template type checking, or Volar configuration.
02 资源文件 20
- 许可证LICENSE.md1.0 KB
- 参考文档rules/codeactions-save-performance.md1.8 KB
- 参考文档rules/data-attributes-config.md1.8 KB
- 参考文档rules/deep-watch-numeric.md2.6 KB
- 参考文档rules/define-model-update-event.md2.4 KB
- 参考文档rules/duplicate-plugin-detection.md2.7 KB
- 参考文档rules/extract-component-props.md1.5 KB
- 参考文档rules/fallthrough-attributes.md1.7 KB
- 参考文档rules/hmr-vue-ssr.md2.9 KB
- 参考文档rules/module-resolution-bundler.md2.1 KB
- 参考文档rules/pinia-store-mocking.md3.7 KB
- 参考文档rules/script-setup-jsdoc.md1.9 KB
- 参考文档rules/strict-css-modules.md1.6 KB
- 参考文档rules/volar-3-breaking-changes.md1.8 KB
- 参考文档rules/vue-directive-comments.md1.6 KB
- 参考文档rules/vue-router-typed-params.md2.5 KB
- 参考文档rules/vue-tsc-strict-templates.md2.0 KB
- 参考文档rules/with-defaults-union-types.md2.5 KB
- 参考文档skill-report.json17.2 KB
- 参考文档SYNC.md164 B
03 SKILL.md 正文
Capability Rules
| Rule | Keywords | Description |
|---|---|---|
| extract-component-props | get props type, wrapper component, extend props, inherit props, ComponentProps | Extract types from .vue components |
| vue-tsc-strict-templates | undefined component, template error, strictTemplates | Catch undefined components in templates |
| fallthrough-attributes | fallthrough, $attrs, wrapper component | Type-check fallthrough attributes |
| strict-css-modules | css modules, $style, typo | Catch CSS module class typos |
| data-attributes-config | data-*, strictTemplates, attribute | Allow data-* attributes |
| volar-3-breaking-changes | volar, vue-language-server, editor | Fix Volar 3.0 upgrade issues |
| module-resolution-bundler | cannot find module, @vue/tsconfig, moduleResolution | Fix module resolution errors |
| define-model-update-event | defineModel, update event, undefined | Fix model update errors |
| with-defaults-union-types | withDefaults, union type, default | Fix union type defaults |
| deep-watch-numeric | watch, deep, array, Vue 3.5 | Efficient array watching |
| vue-directive-comments | @vue-ignore, @vue-skip, template | Control template type checking |
| vue-router-typed-params | route params, typed router, unplugin | Fix route params typing |
Efficiency Rules
| Rule | Keywords | Description |
|---|---|---|
| hmr-vue-ssr | hmr, ssr, hot reload | Fix HMR in SSR apps |
| pinia-store-mocking | pinia, mock, vitest, store | Mock Pinia stores |
Reference
04 同仓库更多 Skills
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
vue-testing-best-practices
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
vue-router-best-practices
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
vue-pinia-best-practices
Pinia stores, state management patterns, store setup, and reactivity with stores.
vue-options-api-best-practices
Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.
vue-development-guides
A collection of best practices and tips for developing applications using Vue.js. This skill MUST be apply when developing, refactoring or reviewing Vue.js or Nuxt projects.