sveltekit-remote-functions

Execute client-initiated remote functions in SvelteKit via command(), query(), and form().

Updated Dec 15, 2025
One-click install
npx skills add https://github.com/spences10/claudefiles --skill sveltekit-remote-functions-spences10
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sveltekit-remote-functions
Source: https://github.com/spences10/claudefiles/tree/main/skills/sveltekit-remote-functions
Command: npx skills add https://github.com/spences10/claudefiles --skill sveltekit-remote-functions-spences10

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.

Core Features & Use Cases

  • command(): One-time server actions (writes, updates, deletes)
  • query(): Repeated reads with batching
  • form(): Progressive enhancement form props

Quick Start

Define a remote function in a *.remote.ts file and invoke it from a client component.

Frequently Asked Questions about sveltekit-remote-functions

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

FAQPage Schema
How do I call server functions from SvelteKit client components?▼

Remote functions in SvelteKit let you call server logic directly from the client using typed, JSON-serializable calls. Define functions in *.remote.ts files and invoke them from client components; the framework handles serialization, validation via StandardSchemaV1, and error propagation automatically.

What's the difference between command(), query(), and form() in SvelteKit remote functions?▼

command() executes one-time server actions like writes or deletes; query() handles repeated reads with batching support; form() provides progressive enhancement for form submissions. Each pattern suits different interaction types and server-side requirements.

Can I access the SvelteKit request context in remote functions?▼

Yes. Remote functions support getRequestEvent() to access the underlying SvelteKit request context, enabling you to read headers, cookies, sessions, and other request data within your server-side function logic.

Do remote functions in SvelteKit support input validation?▼

Remote functions enforce StandardSchemaV1 validation for JSON-serializable inputs and outputs. Define schemas to validate data before execution and ensure type safety across the client-server boundary.

How are remote function calls serialized in SvelteKit?▼

Remote functions use deterministic serialization to convert client inputs and server outputs to JSON. This ensures consistent, predictable data transformation and reliable error propagation across network calls.

Can I batch multiple query() calls in SvelteKit remote functions?▼

Yes. The query() pattern supports batching, allowing multiple read requests to be grouped and executed efficiently on the server, reducing round trips and improving performance in client-heavy applications.