svelte-remote-functions

Standardize type-safe remote functions for SvelteKit client-server communication.

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/gzp79/shine-web-v2 --skill svelte-remote-functions-gzp79
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte-remote-functions
Source: https://github.com/gzp79/shine-web-v2/tree/main/.claude/skills/svelte-remote-function
Command: npx skills add https://github.com/gzp79/shine-web-v2 --skill svelte-remote-functions-gzp79

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured, type-safe approach to client-server communication in SvelteKit by standardizing remote functions (query, form, command, prerender) and enabling automatic data synchronization and validation.

Core Features & Use Cases

  • Four Function Types: query, form, command, prerender
  • Type-safe end-to-end: TypeScript support across client-server boundary with validation via Standard Schema
  • Automatic serialization for Date, Map, Set and robust data handling
  • Progressive enhancement: forms work with or without JavaScript
  • Optimistic updates and single-flight mutations for efficient UI updates
  • Isolated form instances via form.for(id) for multiple concurrent forms
  • Easy adoption patterns: classic data fetching, forms submission, and imperative actions

Quick Start

Define a getPosts query in data.remote.ts and call getPosts() from +page.svelte to render a list.

Frequently Asked Questions about svelte-remote-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe remote functions in SvelteKit for server mutations and data fetching?

Type-safe remote functions in SvelteKit are built using standardized query, form, command, and prerender routines that enforce validation via Standard Schema. This approach ensures end-to-end TypeScript safety and automatic data serialization across the client-server boundary.

What is the best way to handle progressive forms and optimistic updates in SvelteKit?

Progressive forms in SvelteKit work with or without JavaScript by utilizing a dedicated form remote function. This pattern supports single-flight mutations, optimistic updates for efficient UI rendering, and isolated form instances to manage multiple concurrent submissions safely.

How do I validate SvelteKit form actions and server queries using Standard Schema?

SvelteKit server queries and form actions are validated using Standard Schema implementations like Zod, Valibot, or Arktype. The remote functions automatically enforce these validation rules on the server and propagate the structured types to the client.

Does SvelteKit remote function validation support complex data types like Date and Map?

SvelteKit remote function validation supports complex data types like Date, Map, and Set through automatic serialization. This built-in data handling ensures robust type-safe transmission of structured objects between the server and client without manual conversion.

Can I run multiple isolated instances of the same SvelteKit form on a single page?

Multiple isolated instances of the same SvelteKit form can run on a single page using the form.for(id) pattern. This creates concurrent form instances, preventing state collisions and enabling independent progressive submissions across different UI components.

How do cache invalidation and structured refresh strategies work for SvelteKit data fetching?

Cache invalidation for SvelteKit data fetching works by applying structured refresh strategies across standard app workflows. When imperative command mutations modify server state, the query cache is automatically invalidated to synchronize client data.