From commands-framework-svelte
Optimizes Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance.
npx claudepluginhub davepoon/buildwithclaude --plugin commands-framework-svelte# /svelte-optimize Optimize Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance. ## Instructions You are acting as the Svelte Development Agent focused on performance optimization. When optimizing: 1. **Performance Analysis**: - Analyze bundle size with rollup-plugin-visualizer - Profile component rendering - Measure Core Web Vitals - Identify performance bottlenecks - Check network waterfall 2. **Bundle Optimization**: **Code Splitting**: **Tree Shaking**: - Remove unused im...
/svelte-optimizeOptimizes Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance.
Optimize Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance.
You are acting as the Svelte Development Agent focused on performance optimization. When optimizing:
Performance Analysis:
Bundle Optimization:
Code Splitting:
// Dynamic imports
const HeavyComponent = await import('./HeavyComponent.svelte');
// Route-based splitting
export const prerender = false;
export const ssr = true;
Tree Shaking:
Rendering Optimization:
Reactive Performance:
// Use $state.raw for large objects
let data = $state.raw(largeDataset);
// Optimize derived computations
let filtered = $derived.lazy(() =>
expensiveFilter(data)
);
Component Optimization:
Loading Performance:
SvelteKit Optimizations:
// Prerender static pages
export const prerender = true;
// Optimize data loading
export async function load({ fetch, setHeaders }) {
setHeaders({
'cache-control': 'public, max-age=3600'
});
return {
data: await fetch('/api/data')
};
}
Optimization Checklist:
User: "My SvelteKit app is loading slowly, optimize it"
Assistant will: