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★ 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.jsstate 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.jsendpoints - 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
- Reactivity comes from
$state, not from assignment. In runes mode a barelet count = 0never re-renders no matter how you assign it — the compiler emitsnon_reactive_update.let count = $state(0)thencount++orobj.items.push(x)both work:$stateon a plain object or array is a deep proxy. $derivedfor values,$effectfor 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 ofeffect_update_depth_exceeded.- Effects track only synchronous reads. Dependencies are collected while the effect body runs to its first
await; anything read after anawait, in asetTimeout, or in a.then()is invisible to the tracker and the effect will not rerun. Read your dependencies at the top, then await. - Module-level state on the server belongs to every user at once. A
let user = $state(null)exported from a.svelte.jsmodule is one value per Node process, not per request — request A writes it, request B renders it. Per-request data goes inevent.locals(server) andsetContext/props (components). - 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. - Secrets and the database live behind
+page.server.js. Universal+page.jsruns 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 thetransporthook). - A load function reruns only for what it read. Rerun happens when: a
paramsorurlproperty it accessed changes, OR aninvalidate(key)matches something itdepends()on or a URL it fetched, OR a parent itawait parent()-ed reran, ORinvalidateAll()fire
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _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), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…