svelteAvoid common Svelte mistakes — reactivity triggers, store subscriptions, and SvelteKit SSR gotchas.
Install via ClawdBot CLI:
clawdbot install ivangdavila/svelteRequires:
arr = arr after push, or use arr = [...arr, item]arr.push() needs reassignment: arr = arrobj.key = val; obj = obj or spread: obj = {...obj, key: val}$: reactive statements run on dependency change — but only top-level assignments tracked$: runs when dependencies change — list all dependencies used$: { } block for multiple statements — all run together$: order matters — later statements can depend on earlier$: — prefer derived values, use onMount for effects$store auto-subscribes in component — automatic unsubscribe on destroyconst unsub = store.subscribe(v => ...); onDestroy(unsub)writable for read/write — readable for external data sourcesderived for computed values — derived(store, $s => $s * 2)onMount runs after first render — return cleanup functiononMount — document etc. not available in SSRbeforeUpdate / afterUpdate for DOM sync — rarely neededtick() to wait for DOM update — await tick() after state changeexport let propName to declare — required by defaultexport let propName = default for optional — default value if not passed$$props and $$restProps for pass-through — but explicit props preferredcreateEventDispatcher for custom events — dispatch('eventName', data)on:eventName to listen — on:click, on:customEventon:click|preventDefault modifiers — |stopPropagation, |onceon:click without handler — forwards to parent+page.svelte for pages — +page.server.ts for server-only loadload function for data fetching — runs on server and client navigation$app/stores for page, navigating, etc. — $page.params, $page.urlform actions for mutations — progressive enhancement, works without JSbrowser from $app/environment — check before using window/documentonMount only runs client-side — safe for browser APIsfetch in load is special — relative URLs work, credentials handled$state() replaces let for reactivity — let count = $state(0)$derived replaces $: for computed — let doubled = $derived(count * 2)$effect for side effects — replaces $: with side effectslet { prop } = $props() in Svelte 5, or don't destructure in 4$store for value, store for subscribe/set{#if show} not on wrapper
- Key block for re-render —
{#key value}...{/key} destroys and recreates
Generated Mar 1, 2026
Develop a dynamic product filtering interface where users can select categories, price ranges, and attributes. Use Svelte's reactivity triggers to update product lists instantly without full page reloads, ensuring a smooth user experience. Implement stores to manage filter state across components, with SSR support in SvelteKit for fast initial load and SEO.
Build a dashboard that displays live data updates from APIs, such as sales metrics or user activity. Leverage Svelte's reactive statements and derived stores to compute aggregated values and automatically reflect changes. Use onMount and tick() to handle client-side DOM updates and animations, with SvelteKit load functions for server-side data fetching.
Create an educational app with interactive quizzes and progress tracking. Utilize Svelte's component lifecycle and event handling for user interactions like answering questions and navigating lessons. Employ Svelte 5 runes like $state and $derived for simplified reactivity management, ensuring responsive UI updates as learners progress.
Design a WYSIWYG editor for managing blog posts or articles, with features like drag-and-drop elements and live previews. Apply Svelte's props and events for modular components, and use stores to synchronize content state between editor and preview panels. Address SSR gotchas by checking browser environment before accessing DOM APIs.
Offer a subscription-based web application using SvelteKit for fast, scalable frontends with built-in SSR and routing. Monetize through tiered pricing plans based on features like advanced analytics or custom integrations. Leverage Svelte's performance to reduce client-side load and support high user concurrency.
Provide custom development and consulting services for businesses needing Svelte-based web applications, focusing on optimizing reactivity and SSR for improved SEO and user engagement. Charge project-based fees or retainer models for ongoing maintenance and updates. Utilize Svelte's component reusability to accelerate delivery.
Sell pre-built Svelte components, templates, and themes to developers and agencies, reducing development time for common use cases like dashboards or e-commerce sites. Generate revenue through one-time purchases or subscription access to premium libraries. Emphasize Svelte's simplicity and performance in marketing materials.
💬 Integration Tip
Integrate Svelte with existing backends by using fetch in load functions for server-side data handling, and ensure compatibility by checking OS and bin requirements from metadata before deployment.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Expert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.
Use when building UI with shadcn/ui components, Tailwind CSS layouts, form patterns with react-hook-form and zod, theming, dark mode, sidebar layouts, mobile navigation, or any shadcn component question.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when building web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed. Generates bold, memorable designs from plain text requirements with anti-AI-slop aesthetics, mobile-first responsive patterns, and single-file bundling. Use when building landing pages, marketing sites, portfolios, dashboards, or any static web UI. Supports both Vite (pure static) and Next.js (Vercel deploy) workflows.
AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.