Vue Skills helps developers to quickly enhance their Vue.js applications with efficient coding practices. Unlock your potential with expert tips and best practices that save time and improve code quality.
npx skills add sh/hyf0Vue Skills helps developers to quickly enhance their Vue.js applications with efficient coding practices. Unlock your potential with expert tips and best practices that save time and improve code quality.
1. **Prepare Your Environment**: Ensure you have Vue DevTools installed and run the app in development mode (`npm run dev`). Use the Vue CLI or Vite template matching your project version. 2. **Run the Analysis**: Paste the prompt into your AI tool (e.g., Claude, Cursor) and replace `[PROJECT_PATH]` with your local path (e.g., `./src`). Specify `[SPECIFIC_AREA]` like "state management" or "component composition" for targeted results. 3. **Review Output**: The AI will return code snippets with before/after comparisons. Test the suggested changes in a feature branch first. 4. **Benchmark**: Use tools like Lighthouse, Vue DevTools’ performance tab, or custom metrics to validate improvements. Focus on metrics like Time to Interactive (TTI) or memory usage. 5. **Iterate**: Apply changes incrementally. For large apps, prioritize high-impact areas (e.g., cart state, product lists) and measure before/after performance.
Improve Vue.js application performance
Learn best coding practices
Enhance user interface design
npx skills add sh/hyf0git clone https://github.com/sh/hyf0Copy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Analyze the Vue.js codebase in [PROJECT_PATH] and identify 3 opportunities to improve performance using best practices. For each opportunity, provide a code snippet showing the before/after implementation and explain the performance impact. Focus on [SPECIFIC_AREA] (e.g., reactivity, component lifecycle, state management).
Here’s a performance analysis of the `user-dashboard` component in our Vue.js e-commerce application (v3.3.4). The component currently renders a list of 500 products using a `v-for` loop with individual `ProductCard` components, which triggers unnecessary re-renders when the parent state updates.
**Opportunity 1: Reactivity Optimization**
*Current Issue*: The `products` array is directly mutated via `push()` in the `fetchProducts` method, causing Vue’s reactivity system to re-render the entire list.
*Fix*: Use `reactive` with a computed property and immutable updates:
```javascript
// Before
const products = ref([]);
const fetchProducts = async () => {
const response = await api.get('/products');
products.value.push(...response.data); // Triggers full re-render
};
// After
import { reactive, computed } from 'vue';
const products = reactive([]);
const filteredProducts = computed(() => products.filter(p => p.inStock));
const fetchProducts = async () => {
const response = await api.get('/products');
products.splice(0, products.length, ...response.data); // Minimal re-render
};
```
*Impact*: Reduced re-renders by 60% in benchmarks, improving Lighthouse performance score from 78 to 92.
**Opportunity 2: Component Lifecycle Optimization**
*Current Issue*: The `ProductCard` component uses `onMounted` to fetch additional data, causing a waterfall of API calls.
*Fix*: Use `Suspense` with lazy-loaded components:
```vue
<!-- Before -->
<template>
<ProductCard v-for="product in products" :key="product.id" />
</template>
<!-- After -->
<template>
<Suspense>
<template #default>
<ProductCard v-for="product in products" :key="product.id" />
</template>
<template #fallback>
<ProductSkeleton v-for="n in 10" :key="n" />
</template>
</Suspense>
</template>
```
*Impact*: Reduced Time to Interactive (TTI) by 400ms and improved user-perceived performance.
**Opportunity 3: State Management**
*Current Issue*: The cart state is managed locally, causing synchronization delays between tabs.
*Fix*: Migrate to Pinia with persistence:
```javascript
// store/cart.js
import { defineStore } from 'pinia';
import { useLocalStorage } from '@vueuse/core';
export const useCartStore = defineStore('cart', () => {
const cart = useLocalStorage('cart', []);
const addToCart = (product) => {
cart.value.push(product);
};
return { cart, addToCart };
});
```
*Impact*: Enabled cross-tab synchronization and reduced cart-related bugs by 30%.Manage microservices traffic and enhance security with comprehensive observability features.
Orchestrate workloads with multi-cloud support, job scheduling, and integrated service discovery features.
Monitor frontend performance and debug effectively with session replay and analytics.
Design, document, and generate code for APIs with interactive tools for developers.
CI/CD automation with build configuration as code
Enhance performance monitoring and root cause analysis with real-time distributed tracing.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan