svelte-core-bestpractices
Guidance on writing fast, robust, modern Svelte code. Load this skill whenever in a Svelte project and asked to write/edit or analyze a Svelte component or module. Covers reactivity, event handling, styling, integration with libraries and more.
Install
With your agent
Install OMGSkills skill "sveltejs/ai-tools:svelte-core-bestpractices" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.
Manual command
git clone https://github.com/sveltejs/ai-tools /tmp/ai-tools && ln -s /tmp/ai-tools/tools/skills/svelte-core-bestpractices ~/.claude/skills/svelte-core-bestpractices
From README
$state Only use the $state rune for variables that should be reactive — in other words, variables that cause an $effect, $derived or template expression to update. Everything else can be a normal variable. Objects and arrays ($state({...}) or $state([...])) are made deeply reactive, meaning mutation will trigger updates. This has a trade-off: in exchange for fine-grained reactivity, the objects must be proxied, which has performance overhead. In cases where you're dealing with large objects that are only ever reassigned (rather than mutated), use $state.raw instead. This is often the case with API responses, for example. $derived To compute something from state, use $derived rather than $effect: [!NOTE] $derived is given an expression, not a function. If you need to use a function (because the expression is complex, for example) use $derived.by. Deriveds are writable — you can assign to them, just like $state, except that they will re-evaluate when their expression changes.
