Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
spences10 avatar

Sveltekit Data Flow

  • 374 installs
  • 92 repo stars
  • Updated April 29, 2026
  • spences10/svelte-skills-kit

sveltekit-data-flow is a Claude Code skill that wires SvelteKit loaders, actions, forms, and server endpoints for correct fetch, mutate, and cache behavior for developers building SSR, CSR, and edge-deployed SvelteKit ap

About

sveltekit-data-flow is a SvelteKit-focused agent skill from svelte-skills-kit that guides wiring loaders, actions, forms, and server endpoints so pages fetch, mutate, and cache data correctly. It covers the full SvelteKit request lifecycle across server-side rendering, client-side navigation, and edge deployments where load functions, form actions, and +server.ts handlers must stay consistent. Developers reach for it when data flashes on navigation, mutations fail silently, or cache invalidation breaks between SSR and CSR modes. The skill emphasizes correct patterns for progressive enhancement with native forms, typed load dependencies, and action redirects rather than ad-hoc fetch calls scattered through components.

  • Loaders and actions
  • Form mutations
  • SSR CSR caching
  • +server route patterns
  • Error and redirect handling

Sveltekit Data Flow by the numbers

  • 374 all-time installs (skills.sh)
  • +10 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #675 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/spences10/svelte-skills-kit --skill sveltekit-data-flow

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs374
repo stars92
Last updatedApril 29, 2026
Repositoryspences10/svelte-skills-kit

How do SvelteKit loaders and actions share data correctly?

Wire SvelteKit loaders, actions, forms, and server endpoints so pages fetch, mutate, and cache data correctly across SSR, CSR, and edge deployments.

Who is it for?

Full-stack developers shipping SvelteKit apps who need loaders, actions, and server routes to behave consistently across SSR, CSR, and edge.

Skip if: Teams on plain Svelte without SvelteKit routing or projects that only need static marketing pages with no server data layer.

When should I use this skill?

User asks about SvelteKit loaders, form actions, +server.ts endpoints, SSR/CSR data mismatches, or edge deployment caching.

What you get

Correctly wired +page.server.ts loaders, form actions, +server.ts endpoints, and cache-safe SSR/CSR data flows.

  • wired loader functions
  • form action handlers
  • server endpoint routes

Files

SKILL.mdMarkdownGitHub ↗

SvelteKit Data Flow

Quick Start

Which file? Server-only (DB/secrets): +page.server.ts | Universal (runs both): +page.ts | API: +server.ts

Load decision: Need server resources? → server load | Need client APIs? → universal load

Form actions: Always +page.server.ts. Return fail() for errors, throw redirect() to navigate, throw error() for failures.

Example

// +page.server.ts
import { fail, redirect } from '@sveltejs/kit';

export const load = async ({ locals }) => {
	const user = await db.users.get(locals.userId);
	return { user }; // Must be JSON-serializable
};

export const actions = {
	default: async ({ request }) => {
		const data = await request.formData();
		const email = data.get('email');

		if (!email) return fail(400, { email, missing: true });

		await updateEmail(email);
		throw redirect(303, '/success');
	},
};

Reference Files

  • load-functions.md - Server vs

universal

  • form-actions.md - Form handling

patterns

  • serialization.md - What can/can't

serialize

  • error-redirect-handling.md -

fail/redirect/error

  • client-auth-invalidation.md -

invalidateAll() after client-side auth

Notes

  • Server load → universal load via data param | ALWAYS

throw redirect()/error()

  • No class instances/functions from server load (not serializable)
  • Last verified: 2025-01-11

<!-- PROGRESSIVE DISCLOSURE GUIDELINES:

  • Keep this file ~50 lines total (max ~150 lines)
  • Use 1-2 code blocks only (recommend 1)
  • Keep description <200 chars for Level 1 efficiency
  • Move detailed docs to references/ for Level 3 loading
  • This is Level 2 - quick reference ONLY, not a manual

LLM WORKFLOW (when editing this file): 1. Write/edit SKILL.md 2. Format (if formatter available) 3. Run: npx skills add . --list 4. If the skill is not discovered, check SKILL.md frontmatter formatting 5. Validate again to confirm -->

Related skills

How it compares

Pick this over generic Svelte docs when debugging loader-action-endpoint interactions across SSR, CSR, and edge rather than component styling alone.

FAQ

What SvelteKit files does sveltekit-data-flow cover?

sveltekit-data-flow covers SvelteKit loaders in +page.server.ts, form actions, and +server.ts endpoints. Together these files define how pages fetch data on SSR, mutate via forms, and expose HTTP handlers across CSR and edge deployments.

When should I use sveltekit-data-flow?

Use sveltekit-data-flow when SvelteKit pages show stale data after navigation, form submissions fail without clear server wiring, or SSR and client renders disagree. The skill targets loader, action, and endpoint patterns that keep fetch and mutate paths consistent.

Frontend Developmentfrontendbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.