Modern Svelte Best Practices

•
289
•

Implements modern Svelte 5 patterns and performance optimizations using runes and updated component syntax.

This skill equips Claude with the official Svelte guidelines for building fast, robust applications using the latest Svelte 5 features. It prioritizes the use of runes like $state, $derived, and $effect over legacy patterns, ensuring that code is reactive, type-safe, and performant. Whether you are refactoring older components or architecting new modules, this skill provides precise instructions on event handling, snippet usage, and scoped styling to follow the framework's recommended path.

主な機能

01Implements reusable UI logic with snippets and @render tags instead of legacy slots.
02Ensures robust event handling via standard attribute-style listeners.
03289 GitHub stars
04Leverages Svelte 5 runes ($state, $derived, $props) for fine-grained reactivity.
05Optimizes DOM performance with keyed each blocks and $state.raw for large objects.
06Provides expert guidance on component styling using CSS custom properties and :global overrides.

ユースケース

01Migrating legacy Svelte 4 projects to modern Svelte 5 runes and modern component syntax.
02Debugging reactivity bottlenecks using $inspect.trace to identify redundant DOM updates.
03Refactoring complex side-effect logic into cleaner, more predictable derived state.