sveltekit-remote-functions

Creates type-safe remote functions for SvelteKit client-server calls.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/sandalsoft/agent-skills --skill sveltekit-remote-functions-sandalsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sveltekit-remote-functions
Source: https://github.com/sandalsoft/agent-skills/tree/main/sveltekit-remote-functions
Command: npx skills add https://github.com/sandalsoft/agent-skills --skill sveltekit-remote-functions-sandalsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Solves the problem of creating reliable, type-safe remote procedures between SvelteKit client components and server handlers, reducing boilerplate and preventing unsafe data exchange.

Core Features & Use Cases

  • Supports command() for one-time server actions (writes/updates)
  • Supports query() for repeated reads and batched requests
  • Supports form() for progressive enhancement forms
  • Validates inputs with StandardSchemaV1 and handles JSON-serializable data
  • Provides guidance and examples to jumpstart development with .remote.ts files

Quick Start

Create a new file ending in .remote.ts and export a function using command() or query(), then call it from the client.

Frequently Asked Questions about sveltekit-remote-functions

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

FAQPage Schema
How do I create type-safe remote function calls in SvelteKit server actions?

Type-safe remote function calls in SvelteKit are created by exporting functions using command(), query(), or form() within .remote.ts files, which you then invoke directly from client components to ensure end-to-end type safety.

When should I use command() versus query() for SvelteKit server actions?

Use command() for one-time server actions like writes or updates in SvelteKit. Use query() for repeated reads or batched data fetches, and use form() for progressive enhancement forms that maintain type safety.

Can I use StandardSchemaV1 validation for SvelteKit server action inputs?

This approach enforces JSON-serializable inputs and outputs and uses StandardSchemaV1 for input validation, preventing unsafe data exchange between SvelteKit client components and server handlers.

How do I access cookies and headers inside SvelteKit remote functions?

Yes, you can access request event data like cookies and headers by calling the exposed getRequestEvent function within your remote server-side handlers.

Does SvelteKit type-safe RPC support non-JSON-serializable data?

No, this approach is strictly limited to JSON-serializable inputs and outputs to ensure reliable data exchange between SvelteKit client components and server-side handlers.