sveltekit-remote-functions

spences10/svelte-skills-kit · updated Apr 8, 2026

$npx skills add https://github.com/spences10/svelte-skills-kit --skill sveltekit-remote-functions
0 commentsdiscussion
summary

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

skill.md

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

Notes

  • Remote functions execute on server when called from browser
  • Args/returns must be JSON-serializable (RegExp is forbidden — throws)
  • Schema validation via StandardSchemaV1 (Valibot/Zod)
  • getRequestEvent() available for cookies/headers access
  • In components: No-param query() works with {#await}. Parameterized queries with $derived return Query objects — use .ready/.current or $derived(await ...) with experimental async
  • Reactive context required: .current/.error/.loading/.ready only work in reactive contexts (component top-level, $derived, $effect). Outside (event handlers, universal load), use .run() instead
  • Hydration: Queries rendered during hydration must also render on server. Use onMount for client-only queries, not browser guards
  • Warning: <svelte:boundary> + {@const await} causes infinite navigation loops with shared queries (sveltejs/svelte#17717)
  • Single-flight mutations: .updates() accepts query functions (getPosts) or instances. Server must opt-in via requested() from $app/server
  • Refresh queries: Call query().refresh() - updates without flicker. No-op if no cached instance
  • Polling safety: Always .catch() on query().refresh() in intervals — errors reject the Promise and evict the query from cache
  • Server handlers: Use void (not await) for .refresh() inside command/form handlers
  • Cache keys: Object property order doesn't matter for queries — keys are sorted alphabetically
  • Last verified: 2026-04-06

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.855 reviews
  • Yusuf Sharma· Dec 24, 2024

    Registry listing for sveltekit-remote-functions matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Layla Yang· Dec 20, 2024

    sveltekit-remote-functions has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Li Jackson· Dec 16, 2024

    Solid pick for teams standardizing on skills: sveltekit-remote-functions is focused, and the summary matches what you get after install.

  • Li Haddad· Dec 8, 2024

    sveltekit-remote-functions fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Valentina Garcia· Nov 27, 2024

    sveltekit-remote-functions has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Layla Wang· Nov 23, 2024

    Keeps context tight: sveltekit-remote-functions is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Charlotte Martin· Nov 11, 2024

    sveltekit-remote-functions fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Camila Johnson· Nov 7, 2024

    We added sveltekit-remote-functions from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Fatima Lopez· Oct 26, 2024

    sveltekit-remote-functions fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Emma Liu· Oct 18, 2024

    Solid pick for teams standardizing on skills: sveltekit-remote-functions is focused, and the summary matches what you get after install.

showing 1-10 of 55

1 / 6