sveltekit-data-flow
Which file? Server-only (DB/secrets): +page.server.ts |
Works with
What it does
Universal (runs both): +page.ts | API: +server.ts
Installation Guide
How to use sveltekit-data-flow on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- โบCursor installed and configured on your machine
- โบNode.js 16+ with npm โ verify with
node --version - โบActive project directory where you want to add
sveltekit-data-flow
Run the install command
Execute the skills CLI command in your project's root directory to begin installation:
Fetches sveltekit-data-flow from spences10/svelte-skills-kit and configures it for Cursor.
Select Cursor when prompted
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate sveltekit-data-flow. Access via /sveltekit-data-flow in your agent's command palette.
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Documentation
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
dataparam | ALWAYSthrow redirect()/error() - No class instances/functions from server load (not serializable)
- Last verified: 2025-01-11
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort