Help us improve
Share bugs, ideas, or general feedback.
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-svelteHow this command is triggered — by the user, by Claude, or both
Slash command
/commands-framework-svelte:svelte-optimizeThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /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.
/svelteAssesses and scaffolds Svelte/SvelteKit projects with Svelte 5 runes reactivity, stores, routing, load functions, form actions, SSR, adapters, hooks, and Vitest tests. Supports flags like --audit, --migrate, --component.
/auditAudits the current codebase for SvelteKit and Svelte 5 best practice violations, reporting file/line locations, explanations, correct patterns, and severity ratings (critical/warning/info).
/optimizeApplies performance optimizations for images, bundles, code, and network based on analysis results, producing optimized assets and before/after metrics report.
/optimizeAnalyzes Next.js app for performance issues in components, data fetching, bundles, images, and caching; generates optimization report with recommendations.
/optimize-bundle-sizeAnalyzes bundle size and composition, configures webpack or vite optimizations like splitChunks and manualChunks, implements React code splitting and lazy loading.
Share bugs, ideas, or general feedback.
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: