Svelte runes

From spences10/skills · View interactive version

Svelte runes is an AI agent skill from the GitHub repository spences10/skills. Implement Svelte 5 runes correctly. Use for reactive state, props, effects, $state.raw, $derived.by, $props, and $bindable.

How to use this skill

Skill file

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

to use each rune

patterns

snippet syntax

with fixes

For @attach and other template directives, see the

svelte-template-directives skill.

Notes

<!--

PROGRESSIVE DISCLOSURE GUIDELINES:

LLM WORKFLOW (when editing this file):

  1. Write/edit SKILL.md
  2. Format (if formatter available)
  3. Run: npx skills add . --list
  4. If the skill is not discovered, check SKILL.md frontmatter formatting
  5. Validate again to confirm

-->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.