svelte5-runes

Guide Svelte 5 rune usage and migration from Svelte 4.

4|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill svelte5-runes-linehaul-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte5-runes
Source: https://github.com/linehaul-ai/linehaulai-claude-marketplace/tree/main/.claude-plugin/svelte5-runes
Command: npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill svelte5-runes-linehaul-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance on Svelte 5's new runes system, helping you correctly implement reactive state, props, and effects, and smoothly migrate from Svelte 4 while avoiding common reactivity mistakes and syntax conflicts.

Core Features & Use Cases

  • Reactive State Management: Master $state() for mutable state, $derived() for computed values, and $effect() for side effects with automatic cleanup.
  • Component API Patterns: Learn $props() for prop declarations and $bindable() for seamless two-way data binding.
  • Svelte 4 to 5 Migration: Comprehensive translation guide for reactive statements, event handlers, and slot-to-snippet conversions.
  • Common Mistakes & Fixes: Identifies and provides solutions for anti-patterns like mixing Svelte 4/5 syntax, infinite loops, and incorrect rune usage.
  • Use Case: Migrate an existing Svelte 4 component to Svelte 5, converting export let to $props(), reactive statements to $derived() or $effect(), and on:click to onclick.

Quick Start

Use the svelte5-runes skill to explain the difference between $derived() and $effect() with clear code examples.

Frequently Asked Questions about svelte5-runes

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

FAQPage Schema
How do I migrate a Svelte 4 component to Svelte 5 runes?

Svelte 5 migration converts `export let` to `$props()`, reactive statements to `$derived()` or `$effect()`, and event handlers like `on:click` to `onclick`. Replace two-way bindings with `$bindable()` and update slot syntax to snippets for full reactivity modernization.

What's the difference between $derived() and $effect() in Svelte 5?

`$derived()` computes reactive values that update automatically when dependencies change, returning a value. `$effect()` runs side effects (API calls, DOM updates) when dependencies change and supports cleanup functions for resource management.

How do I implement two-way data binding in Svelte 5 components?

Use `$bindable()` within `$props()` to create two-way bindings on component props. This replaces Svelte 4's `bind:` directive, enabling parent-child data synchronization while maintaining reactivity through the runes system.

What are common mistakes when using Svelte 5 runes?

Common mistakes include mixing Svelte 4 and 5 syntax, creating infinite loops with circular `$effect()` dependencies, and misusing `$state()` for derived values. The Skill identifies these anti-patterns and provides corrective code examples for reactive patterns.

Can I use $state() for all reactive values in Svelte 5?

`$state()` manages mutable state only. Use `$derived()` for computed values that depend on state to avoid unnecessary recalculation, and `$effect()` for side effects triggered by state changes, not state storage itself.

How do slots convert to snippets in Svelte 5 migration?

Svelte 5 replaces named and default slots with snippets, declared as `#snippet name(args)` and passed as props. This provides better type safety and composability while maintaining component flexibility across migration from Svelte 4.