SvelteKit remote functions guidance. Use for command(), query(), form() patterns in .remote.ts files.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdreferences/remote-functions.mdFile naming: *.remote.ts for remote function files
Which function? One-time action → command() | Repeated reads →
query() | Forms → form()
// 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' });
getRequestEvent() available for cookies/headers access