sveltekit-data-flow — Claude Code skill: what it does, how to install
Teaches your AI coding assistant proper SvelteKit data flow patterns, from form actions and load functions to serialization and cache invalidation.
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a claude-codeWhat sveltekit-data-flow does
This skill guides coding agents through SvelteKit data management conventions. It instructs the assistant when to isolate code in +page.server.ts, when to rely on universal +page.ts scripts, and when to create +server.ts endpoints. Sensitive database logic stays strictly on the server side.
The instructions specify standard handling for form submissions, handling validation errors via fail() while requiring throw redirect() and throw error() for status navigation. Server load outputs must remain JSON-serializable: attempting to return class instances or functions from +page.server.ts breaks the contract.
What it helps with
- pick the appropriate file between
+page.server.ts,+page.ts, and+server.ts - implement form actions returning
fail()and redirecting withthrow redirect() - avoid non-serializable objects inside server
loadfunctions - trigger cache refreshes with
invalidateAll()after client authentication
Example prompts for the agent
- Set up a SvelteKit form action that validates inputs and redirects on success
- Refactor this data fetch into +page.server.ts so database secrets stay hidden
- Show how to invalidate page data using invalidateAll after client sign-in
How to install sveltekit-data-flow
1Skills CLI (Vercel)
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a claude-code2Manually: put the files in place
~/.claude/skills/sveltekit-data-flow/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/sveltekit-data-flow/
1Skills CLI (Vercel)
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a codex2Manually: put the files in place
.agents/skills/sveltekit-data-flow/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a cursor2Manually: put the files in place
.cursor/skills/sveltekit-data-flow/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install spences10/svelte-skills-kit sveltekit-data-flow2Manually: put the files in place
.github/skills/sveltekit-data-flow/SKILL.md1Skills CLI (Vercel)
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a gemini-cli2Platform CLI
gemini skills install https://github.com/spences10/svelte-skills-kit --path plugins/svelte-skills/skills/sveltekit-data-flowManually: put the files in place
.devin/skills/sveltekit-data-flow/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about sveltekit-data-flow
How do I install sveltekit-data-flow in Claude Code?
Run npx skills add spences10/svelte-skills-kit --skill sveltekit-data-flow -a claude-code. Alternatively, save the skill file directly to ~/.claude/skills/sveltekit-data-flow/SKILL.md.
What does sveltekit-data-flow do?
It provides guidelines for handling SvelteKit data pipelines. The agent learns how to structure server and universal load functions, process form actions, and manage errors accurately.
What cannot be returned from a server load function?
Any data returned from +page.server.ts must be serializable to JSON. You cannot return class instances or functions to the client.