svelte-runes

Explains Svelte 5 runes including $state, $derived, $effect, $props, and $bindable for reactivity and migration from Svelte 4.

Updated Oct 14, 2025
One-click install
npx skills add https://github.com/kensleDev/dotfiles --skill svelte-runes-kensledev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte-runes
Source: https://github.com/kensleDev/dotfiles/tree/main/claude/.claude/skills/svelte/svelte-runes
Command: npx skills add https://github.com/kensleDev/dotfiles --skill svelte-runes-kensledev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill demystifies Svelte 5's new reactivity system, helping developers understand and correctly implement runes for efficient and predictable UI development.

Core Features & Use Cases

  • Rune Guidance: Clear explanations and examples for $state, $derived, $effect, $props, and $bindable.
  • Reactivity Patterns: Learn when to use each rune and avoid common pitfalls.
  • Migration Support: Understand the differences from Svelte 4 and how to adapt.
  • Use Case: You're migrating a Svelte 4 app to Svelte 5 and are unsure how to handle reactive state. This Skill provides the exact syntax and best practices for $state, $derived, and $effect.

Quick Start

Explain the difference between $state and $derived in Svelte 5.

Frequently Asked Questions about svelte-runes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Svelte 5 runes for reactive state management?

Svelte 5 runes manage reactive state using `$state` for variables, `$derived` for computed values, and `$effect` for side effects. This Skill provides clear explanations and syntax examples to implement these reactive patterns correctly.

What is the difference between $state and $derived in Svelte 5?

In Svelte 5, `$state` declares reactive variables, while `$derived` calculates values based on other reactive state. This Skill explains when to use each rune and provides examples to avoid common reactivity pitfalls.

How do I migrate reactive state from Svelte 4 to Svelte 5 runes?

Migrating from Svelte 4 to Svelte 5 runes involves replacing reactive statements with `$state` and `$derived` declarations. This Skill outlines the syntax differences and best practices to adapt your component reactivity.

When should I use $effect compared to other Svelte 5 runes?

Use the `$effect` rune in Svelte 5 to handle side effects like manual DOM updates or fetching data. This Skill details reactivity patterns to ensure predictable UI development and prevent incorrect rune usage.

How do I handle component props using $props and $bindable in Svelte 5?

Handle component props in Svelte 5 using the `$props` rune for inputs and `$bindable` for two-way binding. This Skill provides exact syntax and best practices for managing component props and avoiding common mistakes.

Why is my Svelte 5 component not updating when mixing reactive syntax?

Your Svelte 5 component might not update if you mix Svelte 4 syntax with new runes. This Skill addresses common mistakes like incorrect rune usage and provides patterns for efficient, predictable UI development.