Sveltekit Data Flow
SvelteKit data flow guidance. Use for load functions, form actions, and server/client data. Covers +page.server.ts vs +page.ts, serialization, fail(), redirect(), error().
Install
npx skills add spences10/svelte-claude-skills --skill sveltekit-data-flowgit clone --depth 1 https://github.com/spences10/svelte-claude-skills.git /tmp/svelte-claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/svelte-claude-skills/.claude/skills/sveltekit-data-flow ~/.claude/skills/sveltekit-data-flowPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# 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
```typescript
// +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](references/load-functions.md) - Server vs
universal
- [form-actions.md](references/form-actions.md) - Form handling
patterns
- [serialization.md](references/serialization.md) - What can/can't
serialize
- [error-redirect-handling.md](references/error-redirect-handling.md) -
fail/redirect/error
## 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-11Details
- Skill name
sveltekit-data-flow- Repository
- spences10/svelte-claude-skills
- Path
.claude/skills/sveltekit-data-flow/SKILL.md- Repo updated
- 18 November 2026
FAQ
What does the Sveltekit Data Flow skill do?
SvelteKit data flow guidance. Use for load functions, form actions, and server/client data. Covers +page.server.ts vs +page.ts, serialization, fail(), redirect(), error().
How do I install the Sveltekit Data Flow skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add spences10/svelte-claude-skills --skill sveltekit-data-flow. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Sveltekit Data Flow popular?
It lives in spences10/svelte-claude-skills, which has 217 GitHub stars and 20 forks.
Related skills
Research
217spences10/svelte-claude-skills
Research topics by verifying actual source content. Use when asked to research or study links and documentation.
Svelte Components
217spences10/svelte-claude-skills
Svelte component patterns. Use for web components, component libraries (Bits UI, Ark UI, Melt UI), form patterns, or third-party integration.
Svelte Deployment
217spences10/svelte-claude-skills
Svelte deployment guidance. Use for adapters, Vite config, pnpm setup, library authoring, PWA, or production builds.
Sveltekit Remote Functions
217spences10/svelte-claude-skills
SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.
Svelte Runes
217spences10/svelte-claude-skills
Svelte runes guidance. Use for reactive state, props, effects, attachments, or migration. Covers $state, $derived, $effect, @attach. Prevents reactivity mistakes.
Sveltekit Structure
217spences10/svelte-claude-skills
SvelteKit structure guidance. Use for routing, layouts, error handling, SSR, or svelte:boundary. Covers file naming, nested layouts, error boundaries, pending UI, and hydration.
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.