programming-svelte

Guide Svelte 5 and SvelteKit development with runes and server boundaries.

3|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Muvon/octomind-tap --skill programming-svelte
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: programming-svelte
Source: https://github.com/Muvon/octomind-tap/tree/main/skills/programming-svelte
Command: npx skills add https://github.com/Muvon/octomind-tap --skill programming-svelte

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires svelte-check.

What problem does it solve?

This Skill helps you design and implement correct, maintainable Svelte 5 and SvelteKit applications without falling into common pitfalls around reactivity, state, and server/client boundaries.

Core Features & Use Cases

  • Runes-first reactivity: Use $state, $derived, and $effect with guidance on when to use each and how to avoid loops.
  • SvelteKit architecture clarity: Structure routes, layouts, server-only vs universal code, and shared loading patterns with +page.* and hooks.server.ts.
  • Progressive-enhancement forms: Implement mutations using +page.server.ts actions and upgrade with use:enhance while returning validation errors properly.
  • Practical performance and testing practices: Favor compiler optimizations, code-splitting patterns, and test strategies using Vitest, Testing Library, and Playwright.

Quick Start

Ask the skill to review your planned SvelteKit page and tell you where to put server-only logic, what runes to use for state and derived values, and how to implement the mutation with progressive-enhancement-friendly form actions.

Frequently Asked Questions about programming-svelte

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

FAQPage Schema
How do I use Svelte 5 runes for state and reactivity without creating infinite loops?

Svelte 5 runes like $state, $derived, and $effect provide reactivity by explicitly declaring reactive values. To avoid infinite loops, use $derived for computed values instead of $effect, reserving $effect strictly for synchronous side effects that sync with external systems.

What is the best way to structure server-only logic in a SvelteKit application?

Structure SvelteKit server-only logic by placing sensitive code in +page.server.ts or +server.ts files and using server-only modules. This ensures secrets and database queries execute exclusively on the server, maintaining a clean server-client boundary.

How do I implement progressive enhancement form actions in SvelteKit?

Implement progressive enhancement in SvelteKit by defining mutations in +page.server.ts form actions and applying the use:enhance directive. This upgrades forms with client-side fetching while returning validation errors properly for users without JavaScript.

Can I use Svelte 5 runes with SvelteKit load functions and shared layouts?

Yes, Svelte 5 runes work seamlessly within SvelteKit +page.svelte and +layout.svelte files. You can use $state and $derived to manage local component reactivity for data passed from universal and server load functions.

Why does my Svelte 5 $effect rune run continuously when my component mounts?

The $effect rune runs continuously when it reads reactive state that it also writes to, creating a loop. Extract the computed value into a $derived rune to break the cycle and ensure the effect only triggers necessary side effects.