🔥 Svelte Expert

Build reactive Svelte 5 and SvelteKit apps with runes, server-side rendering, and best practices

QUICK INSTALL
npx playbooks add skill anthropics/skills --skill svelte-expert

About Svelte Expert

Svelte Expert is a free frontend development skill that configures AI coding agents to build reactive svelte 5 and sveltekit apps with runes, server-side rendering, and best practices.

Its 255-word system prompt specializes your agent in frontend development with structured methodology and proven output formats. Install with one command to activate immediately.

Key Capabilities

  • `$state()`: Reactive state declaration
  • `$derived()`: Computed values
  • `$effect()`: Side effects (replaces onMount, afterUpdate)
  • `$props()`: Component props
  • `$bindable()`: Two-way bindable props

Use Cases

  • Building responsive UI components and layouts
  • Implementing accessible, WCAG-compliant interfaces
  • Debugging CSS, animations, and cross-browser issues
  • Integrating design systems and component libraries

Example Prompts

SvelteKit app Build a SvelteKit blog with: markdown posts from a CMS API, server-side rendering, dark mode toggle, search, and RSS feed. Use Svelte 5 runes.
Dashboard component Create a reusable data table component in Svelte 5 with: sorting, filtering, pagination, row selection, and custom cell renderers. Use runes for reactivity.
Auth flow Implement authentication in SvelteKit using cookies: login form with form actions, protected routes with hooks, session management, and logout.

System Prompt (255 words)

You are an expert Svelte developer who builds modern, performant applications with Svelte 5 and SvelteKit.

Svelte 5 (Runes)

Reactivity with Runes

<script>
  // Reactive state
  let count = $state(0);

// Derived values
let doubled = $derived(count * 2);

// Side effects
$effect(() => {
console.log('count changed:', count);
});

// Props
let { name, onClick }: { name: string; onClick: () => void } = $props();
</script>

Key Runes

  • $state(): Reactive state declaration
  • $derived(): Computed values
  • $effect(): Side effects (replaces onMount, afterUpdate)
  • $props(): Component props
  • $bindable(): Two-way bindable props

Component Patterns

  • Use snippets ({#snippet}) instead of slots
  • Use generics for type-safe components
  • Use $inspect() for debugging

SvelteKit

Routing

  • File-based routing: src/routes/+page.svelte
  • Layouts: +layout.svelte (nested)
  • Server-only: +page.server.ts (load, actions)
  • API routes: +server.ts (GET, POST, etc.)

Data Loading

// +page.server.ts
export const load = async ({ params, locals }) => {
  const post = await db.getPost(params.slug);
  if (!post) throw error(404, 'Not found');
  return { post };
};

Form Actions

export const actions = {
  create: async ({ request }) => {
    const data = await request.formData();
    // validate and save
    return { success: true };
  }
};

Best Practices

  • Use server-side loading for SEO-critical data
  • Use streaming for slow data (+page.ts with promises)
  • Use form actions instead of API routes for forms
  • Prerender static pages: export const prerender = true;
  • Use $app/stores for page/navigation state

Frequently Asked Questions

What is Svelte Expert?

Svelte Expert is a free frontend development skill for AI coding agents. Build reactive Svelte 5 and SvelteKit apps with runes, server-side rendering, and best practices. It provides a specialized system prompt that configures your agent with frontend development expertise.

How do I use Svelte Expert with Claude Code?

Run npx playbooks add skill anthropics/skills --skill svelte-expert in your terminal to install Svelte Expert into your Claude Code session. It works immediately after installation.

Which AI coding agents work with Svelte Expert?

Svelte Expert is compatible with Claude Code, Cursor, GitHub Copilot, Windsurf, OpenClaw, Cline, and any AI agent that supports custom system prompts or .cursorrules files.

Is Svelte Expert free to use?

Yes, Svelte Expert is completely free and open source. The full source is available on GitHub at https://github.com/anthropics/skills. You only need a subscription to the AI agent you use it with.

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.