US

using-remote-functions

Outlines configuration, query handling, and data mapping for implementing SvelteKit component-level Remote Functions.

Install

mkdir -p .claude/skills/using-remote-functions && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4964" && unzip -o skill.zip -d .claude/skills/using-remote-functions && rm skill.zip

Installs to .claude/skills/using-remote-functions

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Create SvelteKit components using Remote Functions for type-safe client-server communication. Use when building components that need to fetch data, submit forms, or execute server commands. Remote Functions work at the component level, not page level.
251 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Define type-safe server-side Remote Functions
  • Execute component-level data fetching with query functions
  • Handle server-side form submissions
  • Map server-side data types directly to Svelte components

How it works

It enables an experimental configuration flag in SvelteKit to allow server-side code execution triggered directly from UI components.

Inputs & outputs

You give it
Remote function definition file
You get back
Type-safe interface for client-server interaction

When to use using-remote-functions

  • Fetching data in Svelte components
  • Handling form submissions
  • Executing server-side commands
  • Implementing remote-first architecture

About this skill

Using Remote Functions

Remote Functions are a SvelteKit feature for type-safe client-server communication. They run on the server but can be called from any component.

Key Concepts

  • Component-level: Unlike load functions, Remote Functions work in any component
  • Type-safe: Full TypeScript support between client and server
  • Progressive enhancement: Forms work without JavaScript
  • Experimental: Requires config flags (see below)

Configuration

Add to svelte.config.js:

const config = {
	kit: {
		experimental: {
			remoteFunctions: true
		}
	},
	compilerOptions: {
		experimental: {
			async: true // Optional: enables await in components
		}
	}
}

Remote-First Architecture

Put as little as possible in +page.svelte, as much as possible in data.remote.ts.

Build final data structures server-side. Pages should be pure renderers that map types to components.

See REMOTE-FIRST.md for patterns and examples.

Four Types of Remote Functions

TypePurposeReference
queryRead dynamic dataQUERY.md
formHandle form submissionsFORM.md
commandProgrammatic mutations, avoid if possible. Always prefer formCOMMAND.md
prerenderStatic data at build time(not covered)

Combining Functions

For refreshing queries after mutations, see SINGLE-FLIGHT.md.

Code Templates

For starter code blocks, see TEMPLATES.md.

When to Use Remote Functions vs Load Functions

Use Remote Functions when:

  • Data is needed at the component level, not page level
  • You want colocated data fetching with the component
  • Building reusable components with their own data needs

Use Load Functions when:

  • Never

When not to use it

  • When the project requires classic Load functions for page-level data
  • When the project cannot enable experimental configuration flags

Prerequisites

SvelteKit frameworkTypeScript

Limitations

  • Experimental feature; API may change
  • Requires explicit experimental configuration in svelte.config.js

How it compares

It promotes a remote-first architecture where data logic lives in components rather than page-load pipelines.

Compared to similar skills

using-remote-functions side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
using-remote-functions (this skill)17moNo flagsAdvanced
svelte-ui-design239moNo flagsIntermediate
tanstack-form162moNo flagsIntermediate
tanstack-query72moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry