Command Palette

Search for a command to run...

Назад к скиллам
скилл № 36486

Svelte

Builds, debugs, and reviews Svelte and SvelteKit apps: runes, stores, snippets, load functions, form actions, adapters. Use when the UI does not update after…

БесплатноБез исполняемых скриптов
clawicот clawic★ 23 звезды на GitHub

Установить Svelte в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

User preferences and memory live in ~/Clawic/data/svelte/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/svelte/ or ~/clawic/svelte/), move it to ~/Clawic/data/svelte/, and say in one line that you moved it and from where.

When To Use

  • Writing or reviewing Svelte components, .svelte.js state modules, or SvelteKit routes
  • Reactivity failures: UI not updating, effect loops, bindings that stop propagating, stale derived values
  • SvelteKit request-layer work: load functions, invalidation, form actions, hooks, +server.js endpoints
  • Server-only failures: hydration mismatch, window is not defined, state shared between requests, adapter build errors
  • Migrating a Svelte 4 codebase to Svelte 5 runes, or maintaining a mixed legacy/runes codebase
  • Not for Vue or Nuxt (vue, nuxt), React (react), or language-level JavaScript semantics (javascript)

Quick Reference

Situation Play
UI does not update after a change Is the variable $state? Destructured? A Map/Set/class instance? → Reactivity Model table, then debug.md
effect_update_depth_exceeded An effect writes state it also reads — convert to $derived, or untrack() the read (rule 2)
Value computed from other state $derived / $derived.by; never $effect + assignment (rule 2)
Deep dive on $state, $derived, $effect, $props runes.md
Shared state across files, context, legacy stores stores.md
Snippets, bindings, callback props, attachments, wrapping an imperative library components.md
Scoped CSS not applying, unused-selector warning, transitions, motion styling.md
Typing props, snippets, route data, app.d.ts typescript.md
Symptom-first debugging and the error-code catalog debug.md
Svelte 4 → 5: export let, $:, slots, on:click, new Component() migration.md
Routes, layouts, groups, param matchers, navigation, shallow routing routing.md
load, invalidate, streaming, depends, serialization data-loading.md
Form actions, use:enhance, validation, uploads, remote functions forms.md
window is not defined, hydration mismatch, per-request state, env vars ssr.md
Login, sessions, cookies, route guards, roles, CSRF, XSS, CSP, leaked secrets security.md
Bundle size, slow lists, rerender cost, preloading performance.md
Vitest, component tests, mocking $app/*, Playwright, svelte-check testing.md
Adapters, prerendering, CSP, service workers, self-hosting deployment.md
Packaging components for npm, custom elements, library API design library.md
Anything else Apply Core Rules; reproduce in a single component with no props before blaming the framework

Core Rules

  1. Reactivity comes from $state, not from assignment. In runes mode a bare let count = 0 never re-renders no matter how you assign it — the compiler emits non_reactive_update. let count = $state(0) then count++ or obj.items.push(x) both work: $state on a plain object or array is a deep proxy.
  2. $derived for values, $effect for the outside world. Decision rule: if the new value is a pure function of other state → $derived; if it touches the DOM, network, storage, or a non-Svelte library → $effect. An effect that assigns state costs an extra render pass and is the direct cause of effect_update_depth_exceeded.
  3. Effects track only synchronous reads. Dependencies are collected while the effect body runs to its first await; anything read after an await, in a setTimeout, or in a .then() is invisible to the tracker and the effect will not rerun. Read your dependencies at the top, then await.
  4. Module-level state on the server belongs to every user at once. A let user = $state(null) exported from a .svelte.js module is one value per Node process, not per request — request A writes it, request B renders it. Per-request data goes in event.locals (server) and setContext/props (components).
  5. Key every {#each} whose items can move. {#each rows as row (row.id)}. Unkeyed, Svelte maps DOM to array index: delete row 0 and the input, focus, and component state of index 0 stay attached to what is now a different row. This is a correctness bug, not an optimization.
  6. Secrets and the database live behind +page.server.js. Universal +page.js runs in the browser too, so anything it imports ships. Server load output crosses the wire through devalue serialization: Date, Map, Set, BigInt, and cycles survive; class instances and functions do not (register them with the transport hook).
  7. A load function reruns only for what it read. Rerun happens when: a params or url property it accessed changes, OR an invalidate(key) matches something it depends() on or a URL it fetched, OR a parent it await parent()-ed reran, OR invalidateAll() fire
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • _meta.json
  • components.md
  • data-loading.md
  • debug.md
  • deployment.md
  • forms.md
  • library.md
  • memory-template.md
  • migration.md
  • performance.md
  • routing.md
  • runes.md
  • security.md
  • setup.md
  • ssr.md
  • stores.md
  • styling.md
  • testing.md
  • typescript.md

FAQ

Что делает скилл Svelte?

Builds, debugs, and reviews Svelte and SvelteKit apps: runes, stores, snippets, load functions, form actions, adapters. Use when the UI does not update after a state change, an effect loops forever ("effect_update_depth_exceeded"), props or bindings stop reacting, a Map or class field is not tracked, state leaks between users on the server, "window is not defined" breaks the build, markup mismatches on hydration, data stays stale after a mutation, a form action does nothing or returns 403, scoped CSS is pruned as an unused selector, transitions never fire, or a Node, Vercel, Cloudflare, or static adapter build fails. Also for migrating Svelte 4 to Svelte 5 runes, converting export let to $props, $: to $derived, createEventDispatcher to callback props, slots to snippets and on:click to onclick, typing props and route data in TypeScript, testing components with Vitest or Playwright, and cutting bundle size and rerender cost. Not for Vue or Nuxt, React, or plain browser JavaScript semantics.

Как установить скилл Svelte?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Svelte запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Svelte с