mcpbeat

Sveltekit Remote Functions

spences10/sveltekit-remote-functions

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

5k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
217
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/spences10/svelte-claude-skills --skill sveltekit-remote-functions

The instruction itself

5 sections, as written by the author

SvelteKit Remote Functions

Quick Start

File naming: *.remote.ts for remote function files

Which function? One-time action → command() | Repeated reads →

query() | Forms → form()

Example

// actions.remote.ts
import { command } from '$app/server';
import * as v from 'valibot';

export const delete_user = command(
	v.object({ id: v.string() }),
	async ({ id }) => {
		await db.users.delete(id);
		return { success: true };
	},
);

// Call from client: await delete_user({ id: '123' });

Reference Files

  • references/remote-functions.md -

Complete guide with all patterns

Notes

  • Remote functions execute on server when called from browser
  • Args/returns must be JSON-serializable
  • Schema validation via StandardSchemaV1 (Valibot/Zod)
  • getRequestEvent() available for cookies/headers access
  • Queries are cached - use .refresh() to get fresh data
  • No .remote files in src/lib/server/ - they won't work there
  • Last verified: 2025-12-19

<!--

PROGRESSIVE DISCLOSURE GUIDELINES:

  • Keep this file ~50 lines total (max ~150 lines)
  • Use 1-2 code blocks only (recommend 1)
  • Keep description <200 chars for Level 1 efficiency
  • Move detailed docs to references/ for Level 3 loading
  • This is Level 2 - quick reference ONLY, not a manual

LLM WORKFLOW (when editing this file):

  • Write/edit SKILL.md
  • Format (if formatter available)
  • Run: claude-skills-cli validate <path>
  • If multi-line description warning: run claude-skills-cli doctor <path>
  • Validate again to confirm

-->

How to use it

Copy the folder

Take spences10/sveltekit-remote-functions from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.