bobmatnyc avatar

Svelte5 Runes Static

If you're shipping a static SvelteKit site with Svelte 5 runes and hitting frozen state after prerendering, this walks you through the hybrid pattern that actually works. Keep global state in traditional writable() stores, bridge them to component-local $state() via $effect() subscriptions, then use $derived() for computed values. The critical insight is that runes in module scope don't survive adapter-static hydration, but the manual subscription dance does. Includes the full TypeScript setup for typed props, store bridges, and browser guards to avoid hydration mismatches. Written for developers who've already burned an afternoon debugging why their counter stopped working after SSG.

skills.sh installs
373
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill svelte5-runes-static --agent claude-code

Installs into .claude/skills of the current project.

Files

Svelte 5 Runes with adapter-static (SvelteKit)

Overview

Build static-first SvelteKit applications with Svelte 5 runes without breaking hydration. Apply these patterns when using adapter-static (prerendering) and combining global stores with component-local runes.

Related Skills

  • svelte (Svelte 5 runes core patterns)
  • sveltekit (adapters, deployment, SSR/SSG patterns)
  • typescript-core (TypeScript patterns and validation)
  • vitest (unit testing patterns)

Core Expertise

Building static-first Svelte 5 applications using runes mode with proper state management patterns that survive prerendering and hydration.

Critical Compatibility Rules

❌ NEVER: Runes in Module Scope with adapter-static

Problem: Runes don't hydrate properly after static prerendering

// ❌ BROKEN - State becomes frozen after SSG
export function createStore() {
  let state = $state({ count: 0 });
  return {
    get count() { return state.count; },
    increment: () => { state.count++; }
  };
}

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Category
Frontend Development
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 158
1syncfusion avatarsyncfusion-blazor-smart-textareasyncfusion/blazor-ui-components-skillsSet up and configure the Syncfusion Blazor Smart TextArea for AI-powered inline or popup text autocompletion. Covers OpenAI, Azure OpenAI, Ollama, and custom IC371skills.sh installs
2bobmatnyc avatarbetter-auth-integrationsbobmatnyc/claude-mpm-skillsBetter Auth framework integrations for TypeScript. Use when wiring route handlers in Next.js, SvelteKit, Remix, Express, Hono, or other web frameworks.363skills.sh installs
3bobmatnyc avatarheadlessuibobmatnyc/claude-mpm-skillsHeadless UI - Unstyled, fully accessible UI components for React and Vue with built-in ARIA patterns355skills.sh installs
4davila7 avatarartifacts-builderdavila7/claude-code-templatesSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for355skills.sh installs
5jezweb avatarauto-animatejezweb/claude-skillsZero-config animations for React, Vue, Solid, Svelte, Preact with @formkit/auto-animate (3.28kb). Prevents 15 documented errors including React 19 StrictMode bu355skills.sh installs
6bobmatnyc avatarenv-managerbobmatnyc/claude-mpm-skillsEnvironment variable validation, security scanning, and management for Next.js, Vite, React, and Node.js applications350skills.sh installs