Skip to content
spences10 avatar

Sveltekit Remote Functions

Experimental SvelteKit guidance for choosing and using query(), form(), command(), and prerender() in .remote.ts files.

CCM score
65 of 100
skills.sh installs
441
GitHub stars
96
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the four remote function types, with a decision guide for dynamic reads, progressive forms, mutations, and build-time data
  • Includes a worked posts example that pairs a validated query with a command that refreshes it, plus client-side usage
  • Enforces rules such as Standard Schema validation, the devalue argument limits, and a required limit on requested() refreshes
  • Designed for SvelteKit 2.58 projects that opt into the remoteFunctions experimental flag

Install

$ npx -y skills add spences10/svelte-skills-kit --skill sveltekit-remote-functions -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

SvelteKit Remote Functions

Current Status

Remote functions are experimental in SvelteKit 2.58. Enable them in svelte.config.js:

export default {
	kit: { experimental: { remoteFunctions: true } },
	compilerOptions: { experimental: { async: true } } // only for await in components
};

Quick Start

File naming: export remote functions from *.remote.ts or *.remote.js. Remote files can live anywhere under src except src/lib/server.

Which function?

  • Dynamic reads → query()
  • Progressive forms → form()
  • Event-handler mutations → command()
  • Build-time/static reads → prerender()

Example

// posts.remote.ts
import { command, query, requested } from '$app/server';
import * as v from 'valibot';

export const getPosts = query(v.object({ tag: v.optional(v.string()) }), async (filter) => {
	return db.posts.find(filter);
});

export const createPost = command(v.object({ title: v.string() }), async (data) => {
	await db.posts.create(data);

	for (const { query } of requested(getPosts, 5)) {
		void query.refresh();
	}
});

Client:

<script lang="ts">
	import { createPost, getPosts } from './posts.remote';

Details

Repository
github.com/spences10/svelte-skills-kit
Categories
Frontend & UI Code, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the sveltekit-remote-functions skill do?

The sveltekit-remote-functions skill gives SvelteKit guidance for query(), form(), command() and prerender() patterns in .remote.ts files. It explains which function to pick for dynamic reads, progressive forms, event-handler mutations and build-time reads.

How do I install the sveltekit-remote-functions skill?

Run npx -y skills add spences10/svelte-skills-kit --skill sveltekit-remote-functions -y in a project. Once installed, the agent can write remote functions that follow the sveltekit-remote-functions rules, such as validating inputs and using form() where progressive enhancement matters.

What do I need before using sveltekit-remote-functions?

The sveltekit-remote-functions skill targets SvelteKit 2.58, where remote functions are experimental and must be enabled with kit.experimental.remoteFunctions in svelte.config.js. It also recommends a Standard Schema library such as valibot or zod to validate exposed inputs.

Where does sveltekit-remote-functions sit among other skills in its category?

The sveltekit-remote-functions skill is in the Frontend & UI Code category, next to vercel-react-best-practices, web-design-guidelines and design-taste-frontend. Its focus is narrower than those, covering only SvelteKit remote functions and their server-side rules.

More from spences10/svelte-skills-kit

All 7

Similar to Sveltekit Remote Functions

More Frontend & UI Code