A comprehensive Claude Code skill for building type-safe SvelteKit applications using remote functions. This skill provides AI assistants with patterns, best practices, and complete examples for implementing client-server communication in SvelteKit.
This skill helps AI assistants write correct code for:
cd ~/.claude/skills/
git clone https://github.com/wiesson/svelte-remote-functions
Create the directory:
mkdir -p ~/.claude/skills/svelte-remote-functions
Download the skill files from this repository
Place them in ~/.claude/skills/svelte-remote-functions/
The skill should appear in Claude Code's available skills. The skill will automatically activate for SvelteKit projects.
svelte-remote-functions/
├── SKILL.md # Main entry point for AI
├── README.md # This file (for humans)
└── references/
├── quick-reference.md # Syntax and common patterns
├── query.md # Complete query function documentation
├── form.md # Form functions with progressive enhancement
├── command.md # Imperative command functions
└── invalidation.md # Data refresh and optimistic updates
query(async ({}) or missing validationThe skill includes a dedicated "Common Mistakes" section highlighting:
❌ Query without validation schema
// DON'T
export const getPost = query(async (slug) => { ... });
// DO
export const getPost = query(z.string(), async (slug) => { ... });
❌ Invalid empty object syntax
// DON'T
export const getPosts = query(async ({}) => { ... });
// DO
export const getPosts = query(async () => { ... });
❌ Missing arguments when calling
// DON'T
const post = getPost(); // Missing slug!
// DO
const post = getPost(params.slug);
❌ Using event as parameter
// DON'T
export const getUser = query(z.string(), async (id, event) => {
const session = event.cookies.get('session');
...
});
// DO
import { getRequestEvent } from '$app/server';
export const getUser = query(z.string(), async (id) => {
const { cookies } = getRequestEvent();
const session = cookies.get('session');
...
});
See SKILL.md for complete anti-pattern documentation.
This skill is designed to be consumed by Claude Code. The main content is in SKILL.md, which provides:
This skill assumes:
Contributions welcome! Please ensure:
MIT License - See LICENSE file for details
Based on official SvelteKit remote functions documentation from https://svelte.dev/docs/kit/remote-functions/