Getting LLMs to write Svelte 5 is hard and it will stay that way until more Svelte 5 code hits model training data. Until then, we’re stuck with partial understanding and workarounds.
Dumping full documentation doesn’t help. It’s too big, too noisy, and wastes tokens. Most models already understand Svelte 3/4 and since Svelte 5 doesn't change everything, only the new pieces need to be shown.
The official llms-small.txt
is over 130k tokens. That’s way beyond what models can reason over. Smaller contexts (think 8k–12k tokens) work best.
This repo is a minimal, example-based reference focused on what changed in Svelte 5. It's written to be copy-pasted into prompts. No extra explanation, just clean annotated code.
Each file is standalone and scoped:
$state
, $effect
, $derived
, $bindable
, $props
, $host
, $inspect
{#snippet}
, {@render}
), slot replacement