vue
Vue coding style and best practices.
When & Why to Use This Skill
This Claude skill automates the enforcement of modern Vue.js coding standards and best practices. It focuses on Vue 3.5+ syntax, efficient DOM management, and consistent naming conventions to ensure high-quality, maintainable, and performant front-end code. By integrating these rules, developers can reduce technical debt and align with the latest industry standards for Vue development.
Use Cases
- Modernizing Vue Components: Refactor legacy code to utilize Vue 3.5+ features such as defineModel, defineEmits named tuples, and useTemplateRef for cleaner and more type-safe logic.
- Enforcing Style Consistency: Automatically ensure all components follow PascalCase naming and props use camelCase, maintaining a professional and uniform codebase across large teams.
- Template Performance Optimization: Identify and remove unnecessary DOM wrappers (<div>), replacing them with <template v-if> fragments to minimize memory footprint and improve rendering speed.
- Standardized Error Handling: Guarantee robust user feedback by enforcing the use of toast notifications instead of silent console errors in asynchronous catch blocks.
- Clean Template Syntax: Audit templates to replace verbose bindings with shorthands and ensure v-for directives are placed directly on components rather than wrapper elements.
| name | vue |
|---|---|
| description | Vue coding style and best practices. |
| pattern | \.vue(\s|$) |
- Always use
toast.error(error.message)in catch blocks, neverconsole.error - Minimize DOM nesting by avoiding unnecessary wrappers ()
- Use modern v3.5+ syntax (e.g. defineModel, defineEmits named tuple, useTemplateRef)
- Use shorthands prop in templates (e.g.
propinstead of:prop={true}) - PascalCase for component, camelCase for prop e.g.
@update:modeValueover@update:model-value - Structure: First , then