mcpField
S
svelte-runes

svelte-runes

github.com/spences10Development16192 installsUpdated 16w ago
Repository

About svelte-runes

svelte-runes is a reference skill for Svelte developers using Svelte Runes. It explains rune choices, component patterns, common pitfalls, and reactivity debugging.

Key features

  1. 01Explains each rune's role
  2. 02Documents reactivity patterns
  3. 03Covers component API patterns
  4. 04Lists mistakes and fixes
  5. 05Offers reactivity debugging guidance

Use cases

  1. 01Choosing runes for state or derivation
  2. 02Implementing component props and bindings
  3. 03Troubleshooting reactivity

Install

Copy the command and run it in a terminal.

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

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

Bundled files

References and scripts installed along with SKILL.md.

examples/
bindable-props.svelte
effect-vs-derived.svelte
references/
common-mistakes.md
component-api.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). Objects/arrays are deeply reactive by default; use $state.raw for large data replaced wholesale.

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 event properties like onclick, and {@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
  • Prefer $derived.by for multi-line derivations
  • Avoid state updates inside $effect; effects are an escape hatch
  • Effects do not run on the server; don't wrap effect bodies in if (browser)
  • Last verified: 2026-05-14

Comments

Markdown supported