.cursorrunes for Svelte 5
Add this skill
npx mdskills install PatrickJS/cursor-svelte-5-vs-svelte-4Provides clear Svelte 4 to 5 migration rules but lacks agent instructions or trigger conditions
I'm using svelte 5 instead of svelte 4 here is an overview of the changes.
Svelte 5 introduces runes, a set of advanced primitives for controlling reactivity. The runes replace certain non-runes features and provide more explicit control over state and effects.
Snippets, along with render tags, help create reusable chunks of markup inside your components, reducing duplication and enhancing maintainability.
In Svelte 5, event handlers are treated as standard HTML properties rather than Svelte-specific directives, simplifying their use and integrating them more closely with the rest of the properties in the component.
Before (Svelte 4):
let count = 0;
$: double = count * 2;
$: {
if (count > 10) alert('Too high!');
}
count++}> {count} / {double}
After (Svelte 5):
import { $state, $effect, $derived } from 'svelte';
// Define state with runes
let count = $state(0);
// Option 1: Using $derived for computed values
let double = $derived(count * 2);
// Reactive effects using runes
$effect(() => {
if (count > 10) alert('Too high!');
});
count++}>
{count} / {double}
count++}>
{count} / {count * 2}
-->
Reactivity is Explicit:
$state() to explicitly mark reactive variables$derived() replaces $: for computed values$effect() replaces $: {} blocks for side effectsEvent Handling is Standardized:
on:click={handler}onclick={handler}Import Runes:
import { $state, $effect, $derived, $props, $slots } from 'svelte';No More Event Modifiers:
on:click|preventDefault={handler}onclick={e => { e.preventDefault(); handler(e); }}This creates clearer, more maintainable components compared to Svelte 4's previous syntax by making reactivity explicit and using standardized web platform features.
Install via CLI
npx mdskills install PatrickJS/cursor-svelte-5-vs-svelte-4Svelte 5 Vs Svelte 4 is a free, open-source AI agent skill. .cursorrunes for Svelte 5
Install Svelte 5 Vs Svelte 4 with a single command:
npx mdskills install PatrickJS/cursor-svelte-5-vs-svelte-4This downloads the skill files into your project and your AI agent picks them up automatically.
Svelte 5 Vs Svelte 4 works with Cursor. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.