بنقرة واحدة
svelte-core-bestpractices
// Svelte 5 core best practices. Use when creating, editing, or reviewing .svelte, .svelte.ts, or .svelte.js files. Routes to deeper Svelte skills.
// Svelte 5 core best practices. Use when creating, editing, or reviewing .svelte, .svelte.ts, or .svelte.js files. Routes to deeper Svelte skills.
Build Svelte LayerChart components. Use for tooltip snippets, Chart context access, gradients, highlights, axes, and Svelte 5 snippet patterns.
Svelte template directive guidance. Use when working with snippets, attachments, dynamic HTML, declaration tags, debugging tags, or global DOM events.
Implement SvelteKit remote functions. Use for query(), query.live(), form(), command(), and prerender() patterns in .remote.ts files.
SvelteKit structure guidance. Use for routing, layouts, error handling, SSR, or svelte:boundary. Covers file naming, nested layouts, error boundaries, pending UI, and hydration.
Build Svelte components. Use for Svelte custom elements, component libraries (Bits UI, Ark UI, Melt UI), form patterns, or third-party integration.
Implement Svelte 5 runes correctly. Use for reactive state, props, effects, $state.raw, $derived.by, $props, and $bindable.
| name | svelte-core-bestpractices |
| description | Svelte 5 core best practices. Use when creating, editing, or reviewing .svelte, .svelte.ts, or .svelte.js files. Routes to deeper Svelte skills. |
| metadata | {"last_updated":"2026-05-31","verified_against":"Svelte 5 official docs and sveltejs/svelte#18282"} |
Use this as the baseline for any Svelte 5 component/module work, then load the focused skill for details.
$state, $derived, $effect, $props, $bindable.$state for values that affect template output, $derived, or $effect.$state.raw for large objects/arrays that are replaced wholesale, especially API payloads.$derived/$derived.by over writing state inside $effect.$derived.onclick={...} and other event properties, not legacy event directives.{@render ...} for component content.{let ...} / {const ...} declaration tags for local markup variables; {@const ...} is legacy syntax.{#each} blocks; never use array indexes as keys.style: for dynamic styling.class={...} for conditional classes.createContext for typed context instead of module-level shared state.{@attach ...} for DOM/third-party integrations tied to an element.svelte-runes{@attach}, global events, each blocks → svelte-template-directivessvelte-stylingsvelte-componentssveltekit-data-flow, sveltekit-structuresveltekit-remote-functionssvelte-deploymentif (browser).$inspect.trace(label) to debug unexpected reactivity.