mcpField
S
svelte-runes

svelte-runes

github.com/spences10Development941.0k installsUpdated 2w ago
Repository

About svelte-runes

svelte-runes is a development skill for developers building components with Svelte 5. It explains rune usage, reactivity rules, and considerations for migrating from Svelte 4.

Key features

  1. 01Explains common uses for each rune
  2. 02Covers top-level use and reactivity rules
  3. 03Provides migration and component API references
  4. 04Addresses common mistakes and debugging

Use cases

  1. 01Choosing runes for state management
  2. 02Writing component props and derived values
  3. 03Troubleshooting reactivity or translating syntax

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/spences10/svelte-skills-kit --skill svelte-runes

After installing, type/svelte-runesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
examples/
bindable-props.svelte
effect-vs-derived.svelte
references/
common-mistakes.md
component-api.md
migration-gotchas.md
reactivity-patterns.md
snippets-vs-slots.md

Details

From the project README

Svelte Runes

Quick Start

Which rune? Props: $props() | Bindable: $bindable() | Computed: $derived() | Side effect: $effect() | State: $state()

Key rules: Runes are top-level only. $derived can be overridden (use const for read-only). Don't mix Svelte 4/5 syntax. Objects/arrays are deeply reactive by default.

Example

<script>
	let count = $state(0); // Mutable state
	const doubled = $derived(count * 2); // Computed (const = read-only)

	$effect(() => {
		console.log(`Count is ${count}`); // Side effect
	});
</script>

<button onclick={() => count++}>
	{count} (doubled: {doubled})
</button>

Reference Files

For @attach and other template directives, see the svelte-template-directives skill.

Notes

  • Use onclick not on:click, {@render children()} in layouts
  • $derived can be reassigned (5.25+) - use const for read-only
  • Use createContext over setContext/getContext for type safety
  • Use $inspect.trace to debug reactivity issues
  • Last verified: 2026-03-12

Comments

Markdown supported