From commands-framework-svelte
Analyzes and optimizes Svelte/SvelteKit app performance — bundle size, rendering, loading, and Core Web Vitals — with actionable recommendations and code transformations.
How 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...
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:
2plugins reuse this command
First indexed Jan 8, 2026
npx claudepluginhub davepoon/buildwithclaude --plugin commands-framework-svelte/svelte-optimizeAnalyzes and optimizes Svelte/SvelteKit app performance — bundle size, rendering, loading, and Core Web Vitals — with actionable recommendations and code transformations.
/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).
/optimizeAnalyzes application architecture, code, and infrastructure to generate prioritized performance optimization recommendations with an implementation roadmap.
/optimizeAnalyzes a Next.js application for common performance issues and generates an optimization report covering component boundaries, data fetching, bundle size, images, and caching.
/react-optimizeAnalyzes a React component for performance issues like re-renders, missing memoization, and video element problems, then provides optimized code with explanations.