svelte

Fix reactivity and data flow in Svelte 5 and SvelteKit codebases.

16|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill svelte-jcetools-petra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte
Source: https://github.com/JCETools-Petra/JCE-Opencode-Tools/tree/main/config/skills/svelte
Command: npx skills add https://github.com/JCETools-Petra/JCE-Opencode-Tools --skill svelte-jcetools-petra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Svelte projects often suffer from reactivity mistakes, unclear runes usage, and inconsistent data loading patterns that lead to bugs and hard-to-reproduce UI behavior.

Core Features & Use Cases

  • Svelte 5 runes guidance: chooses the correct rune for state, derived values, and side effects, including lifecycle timing via effect hooks.
  • Svelte 5 component patterns: uses $props, $bindable, and snippet-based composition to replace older slot/event patterns.
  • SvelteKit data-flow patterns: recommends the right place for server-only vs universal loading, form actions, invalidation keys, and route handlers for APIs.
  • UI correctness & performance checks: helps avoid common anti-patterns that cause stale UI, unnecessary tracking, or incorrect mutations.

Quick Start

Ask the assistant to review your Svelte 5 component and refactor its reactivity and data loading to use the correct runes, snippets, and SvelteKit load/actions patterns.

Frequently Asked Questions about svelte

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix incorrect reactivity and data flow in Svelte 5 components?

Fix Svelte 5 reactivity by refactoring code to use $state for local variables, $derived for computed values, and $effect for side effects, ensuring verifiable UI behavior and avoiding common stale UI anti-patterns.

When should I use SvelteKit form actions versus route handlers for API endpoints?

Use SvelteKit form actions for progressive enhancement and data mutation, and route handlers in +server modules for custom API endpoints, combining both with depends/invalidation patterns to maintain correct data flow.

What is the best way to replace Svelte 4 slots and event dispatchers in Svelte 5?

Replace Svelte 4 slots and event dispatchers by adopting Svelte 5 component patterns: use $props for data passing, $bindable for two-way binding, and snippet-based composition for flexible UI distribution.

How do I manage side effects and lifecycle timing with Svelte 5 runes?

Manage Svelte 5 side effects using the $effect rune for standard post-render operations and $effect.pre for pre-render updates, utilizing untrack to prevent unnecessary reactive tracking and performance issues.

How do I structure universal and server-only load functions in SvelteKit?

Structure SvelteKit data loading by using server-only load functions for backend data fetching and universal load functions for shared client logic, applying depends/invalidation to refresh route data correctly.

Why does my Svelte 5 derived value show stale UI data?

Stale UI data in Svelte 5 often results from incorrect $derived usage or unnecessary tracking, which can be fixed by verifying reactive dependencies and using untrack to isolate non-reactive mutations.