skills/svelte/SKILL.md
Build, review, refactor, and debug modern Svelte 5 components. Use for `.svelte` component design, runes, props, snippets, events, styling, context, local/shared reactive state, and Svelte reactivity gotchas, including SvelteKit apps when the issue is component-level rather than route/server-level.
npx skillsauth add sjunepark/custom-skills svelteInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Work from current Svelte 5 idioms. Optimize for components and reactive state that stay easy to reason about as they grow.
Do not spend time explaining basic syntax unless the user asks. Focus on best practices, sharp edges, and the shortest correct implementation.
Use this skill when the problem is mostly inside components or shared reactive view logic.
load, form actions, auth, cookies, SSR navigation behavior, or invalidation, switch to the sveltekit skill.package.json.$state, $derived, $props, snippets, and current event attributes such as onclick={...}.$state only for values that truly need reactivity. Keep plain variables plain.$state.raw for large objects or arrays that are usually replaced wholesale rather than mutated in place.$derived for computed values. Use $derived.by(...) when the derivation needs multiple statements.$derived are not made deeply reactive.$effect as an escape hatch for DOM APIs, timers, analytics, imperative libraries, or external subscriptions.$effect to keep one piece of state in sync with another when a clearer source of truth exists.{@attach ...}, or createSubscriber(...) before reaching for an effect.$inspect and $inspect.trace(...) to debug reactive churn instead of leaving logging effects in place.<script> when that is clearer than creating a tiny helper component.<svelte:window> and <svelte:document> for global listeners instead of wiring them up manually in onMount or $effect.{#each} blocks for stable identity. Do not use array index as the key.style:--token={value} for JS-to-CSS handoff and parent-controlled styling.:global(...) only when styling third-party output or a boundary you do not control.createContext over ad hoc setContext/getContext pairs when context is the right tool.$state fields is often simpler.createEventDispatcher.$derived instead of computing it once in plain script.$effect to mirror state. If you write x from y in an effect, you probably want a derived value or a different source of truth.$state(...) to a function passes the current value, not a live reference. Pass an updater or a container object when mutation must flow back.$derived before building downstream derived state.$state is convenient, but proxying large graphs has a cost. Prefer smaller state shapes or $state.raw when mutation granularity is not needed.$derived affects the original object only if that original object is already reactive upstream. Do not assume $derived deepens reactivity.window, document, storage, observers, and media APIs must be guarded behind onMount or an explicit browser check when SSR is in play.$state or $derived rather than a one-time plain variable.$inspect.trace(...) to the relevant $derived.by(...) or $effect.$: and export let, snippets over slots, current event attributes over on:click, direct component references over <svelte:component>, and reactive classes or objects over stores when sharing local reactive state.Consult the current Svelte docs when behavior matters or seems version-sensitive:
https://svelte.dev/docs/svelte/best-practiceshttps://svelte.dev/docs/svelte/$statehttps://svelte.dev/docs/svelte/$derivedhttps://svelte.dev/docs/svelte/$effecthttps://svelte.dev/docs/svelte/$propsdevelopment
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, empty states, UX review, visual hierarchy, information architecture, accessibility, performance, responsive behavior, theming, typography, spacing, layout, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, design systems, tokens, live browser iteration, and ambitious visual effects. Not for backend-only or non-UI tasks.
development
Manually integrate Git branch work without blind mechanical merges. Use when merging, transplanting, or refactoring branch work; resolving conflicts; preserving source-branch intent in a clean current-branch structure; or auditing that source additions, removals, tests, and docs landed intentionally.
testing
Prepare, audit, set up, and guide Release Please releases. Use when releasing, preparing or reviewing a release PR, adding Release Please, classifying SemVer impact or breaking changes, writing Release Please-compatible Conventional Commit guidance, or documenting release criteria. Release work requires existing Release Please config; setup requires an explicit setup request.
development
Teach how code, a subsystem, architecture area, feature flow, module, API/data boundary, or relevant technical concept works for reviewers and maintainers. Use when the user asks to understand code or concepts; focus on design, responsibilities, contracts, data flow, invariants, tradeoffs, and maintenance implications, not syntax or line-by-line execution. Use `change-explainer` for diffs, commits, or patches.