Vue.js best practices and patterns for modern web applications
Add this skill
npx mdskills install PatrickJS/cursor-vueComprehensive Vue.js guidelines but lacks specificity and actionable instructions for agents
1---2description: Vue.js best practices and patterns for modern web applications3globs: **/*.vue, **/*.ts, components/**/*4---56# Vue.js Best Practices78## Component Structure9- Use Composition API over Options API10- Keep components small and focused11- Use proper TypeScript integration12- Implement proper props validation13- Use proper emit declarations14- Keep template logic minimal1516## Composition API17- Use proper ref and reactive18- Implement proper lifecycle hooks19- Use composables for reusable logic20- Keep setup function clean21- Use proper computed properties22- Implement proper watchers2324## State Management25- Use Pinia for state management26- Keep stores modular27- Use proper state composition28- Implement proper actions29- Use proper getters30- Handle async state properly3132## Performance33- Use proper component lazy loading34- Implement proper caching35- Use proper computed properties36- Avoid unnecessary watchers37- Use proper v-show vs v-if38- Implement proper key management3940## Routing41- Use Vue Router properly42- Implement proper navigation guards43- Use proper route meta fields44- Handle route params properly45- Implement proper lazy loading46- Use proper navigation methods4748## Forms49- Use v-model properly50- Implement proper validation51- Handle form submission properly52- Show proper loading states53- Use proper error handling54- Implement proper form reset5556## TypeScript Integration57- Use proper component type definitions58- Implement proper prop types59- Use proper emit declarations60- Handle proper type inference61- Use proper composable types62- Implement proper store types6364## Testing65- Write proper unit tests66- Implement proper component tests67- Use Vue Test Utils properly68- Test composables properly69- Implement proper mocking70- Test async operations7172## Best Practices73- Follow Vue style guide74- Use proper naming conventions75- Keep components organized76- Implement proper error handling77- Use proper event handling78- Document complex logic7980## Build and Tooling81- Use Vite for development82- Configure proper build setup83- Use proper environment variables84- Implement proper code splitting85- Use proper asset handling86- Configure proper optimization
Full transparency — inspect the skill content before installing.