Skip to main content
skill CX Codex

svelte-development · travisjneuman — Claude Code skill for Svelte and setup

The svelte-development Claude Code skill covers Svelte 5 and SvelteKit development. It applies to reactive components, SvelteKit routing and server functions, and upgrades from Svelte 4.

MIT 139 installs ★ 114 updated 2026-11-10

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add travisjneuman/.claude --skill svelte-development -a claude-code
Open on GitHub

What svelte-development does

The skill explains Svelte 5 runes for state, derived values and side effects, along with component props and two-way bindings. It also covers patterns for shared reactive state.

SvelteKit material includes project structure, data loading, form actions, API routes and hooks. Separate reference files cover event handling, Vitest component tests, and the Svelte 4 migration. The listed stack includes Svelte 5.0+, SvelteKit 2.0+, TypeScript 5.0+, Vite 5.0+ and Vitest 1.0+.

The guide’s stated versions start at SvelteKit 2.0+ and Vitest 1.0+.

What it helps with

  • model component state and computed values with Svelte 5 runes
  • set up component props and two-way bindings
  • add data loading, form actions or API routes in SvelteKit
  • move a project from Svelte 4 to Svelte 5
  • write Svelte component tests with Vitest

Example prompts for the agent

  • Build a Svelte 5 component using $state and $derived.
  • Add data loading and a form action to this SvelteKit project.
  • Help migrate this component from Svelte 4 to Svelte 5.

How to install svelte-development

1Skills CLI (Vercel)

npx skills add travisjneuman/.claude --skill svelte-development -a claude-code

2Manually: put the files in place

~/.claude/skills/svelte-development/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/svelte-development/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about svelte-development

How do I install svelte-development in Claude Code?

Run npx skills add travisjneuman/.claude --skill svelte-development -a claude-code. The skill file is at ~/.claude/skills/svelte-development/SKILL.md.

What does svelte-development do?

It provides guidance for Svelte 5 and SvelteKit, including runes, components, shared state, routing, forms and testing.

Which tool versions does svelte-development cover?

The listed stack is Svelte 5.0+, SvelteKit 2.0+, TypeScript 5.0+, Vite 5.0+ and Vitest 1.0+.

Source text

SKILL.md · MIT
---
name: svelte-development
description: Svelte 5 development with runes ($state, $derived, $effect), SvelteKit full-stack framework, and modern reactive patterns. Use when building Svelte applications, implementing fine-grained reactivity, or working with SvelteKit routing and server functions.
---

# Svelte 5 Development

Comprehensive guide for building modern Svelte applications with runes and SvelteKit.

## Stack Overview

| Tool       | Purpose              | Version |
| ---------- | -------------------- | ------- |
| Svelte 5   | Core framework       | 5.0+    |
| SvelteKit  | Full-stack framework | 2.0+    |
| TypeScript | Type safety          | 5.0+    |
| Vite       | Build tool           | 5.0+    |
| Vitest     | Testing              | 1.0+    |

---

## Svelte 5 Runes (Core Reactivity)

### The Rune System

Runes are compile-time macros prefixed with `$` that provide explicit, fine-grained reactivity.

| Rune        | Purpose               | Replaces                    |
| ----------- | --------------------- | --------------------------- |
| `$state`    | Reactive state        | `let` declarations          |
| `$derived`  | Computed values       | `$:` reactive statements    |
| `$effect`   | Side effects          | `$:` side effect statements |
| `$props`    | Component props       | `export let`                |
| `$bindable` | Two-way binding props | `export let` with bind:     |

### Basic Component Structure

```svelte
<script lang="ts">
  // Props with TypeScript
  interface Props {
    title: string
    count?: number
    onUpdate?: (value: number) => void
  }

  let { title, count = 0, onUpdate }: Props = $props()

  // Reactive state
  let localCount = $state(count)
  let items = $state<string[]>([])

  // Derived values (auto-update when dependencies change)
  let doubled = $derived(localCount * 2)
  let total = $derived(items.reduce((sum, i) => sum + i.length, 0))

  // Side effects
  $effect(() => {
    console.log(`Count changed to: ${localCount}`)
    onUpdate?.(localCount)
  })

  // Methods
  function increment() {
    localCount++
  }
</script>

<div class="component">
  <h1>{title}</h1>
  <p>Count: {localCount} (Doubled: {doubled})</p>
  <button onclick={increment}>Increment</button>
</div>

<style>
  .component {
    padding: 1rem;
  }
</style>
```

### State Patterns

```typescript
// Primitives
let count = $state(0);
let name = $state("");

// Objects (deeply reactive)
let user = $state({
  name: "John",
  email: "[email protected]",
  preferences: { theme: "dark" },
});

// Arrays
let items = $state<Item[]>([]);

// Direct mutation works!
user.name = "Jane"; // Reactive
user.preferences.theme = "light"; // Reactive (deep)
items.push({ id: 1, name: "New" }); // Reactive

// Frozen state (shallow reactivity)
let frozenList = $state.frozen([1, 2, 3]);
```

### Derived Values

```typescript
// Simple derived
let doubled = $derived(count * 2);

// Complex derived (use $derived.by for multi-line)
let stats = $derived.by(() => {
  const total = items.reduce((sum, i) => sum + i.value, 0);
  const average = items.length ? total / items.length : 0;
  return { total, average, count: items.length };
});

// Derived from multiple sources
let summary = $derived(`${user.name} has ${items.length} items`);
```

### Effects

```typescript
// Basic effect (runs when dependencies change)
$effect(() => {
  console.log(`Count is now: ${count}`);
});

// Effect with cleanup
$effect(() => {
  const interval = setInterval(() => {
    count++;
  }, 1000);

  // Cleanup function (returned)
  return () => clearInterval(interval);
});

// Pre-effect (runs before DOM updates)
$effect.pre(() => {
  console.log("About to update DOM");
});

// Root effect (doesn't track dependencies)
$effect.root(() => {
  // Manual dependency management
});
```

---

## Reference files

Detailed material is in separate files so this overview stays short. Read only the file whose topic matches the task; each one is self-contained. Paths are relative to the folder that holds this `SKILL.md` (in the full toolkit install, `~/.claude/skills/svelte-development/`).

| Topic | File | Covers |
| --- | --- | --- |
| Component Patterns | [`references/component-patterns.md`](references/component-patterns.md) | Props with Defaults and Spreading; Two-Way Binding with $bindable; Snippets (Replacing Slots); Snippets with Parameters |
| Shared State with .svelte.ts Files | [`references/shared-state-with-svelte-ts-files.md`](references/shared-state-with-svelte-ts-files.md) | Creating Shared State; Class-Based State; Using Shared State |
| SvelteKit (Full-Stack) | [`references/sveltekit-full-stack.md`](references/sveltekit-full-stack.md) | Project Structure; Load Functions; Form Actions; API Routes; Middleware (Hooks) |
| Event Handling (Svelte 5) | [`references/event-handling-svelte-5.md`](references/event-handling-svelte-5.md) | DOM Events (New Syntax); Component Events (Callback Props) |
| Testing with Vitest | [`references/testing-with-vitest.md`](references/testing-with-vitest.md) | Setup; Component Testing; Testing Stores |
| Migration from Svelte 4 | [`references/migration-from-svelte-4.md`](references/migration-from-svelte-4.md) | Migration Script |
| Anti-Patterns to Avoid | [`references/anti-patterns-to-avoid.md`](references/anti-patterns-to-avoid.md) | 12 lines |

## Performance Benefits

| Metric              | Improvement                   |
| ------------------- | ----------------------------- |
| Bundle size         | 40-60% smaller than React/Vue |
| Runtime performance | No virtual DOM overhead       |
| Time to interactive | Minimal JavaScript hydration  |
| Memory usage        | Lower due to compiled output  |

---

## Related Resources

- [Svelte 5 Documentation](https://svelte.dev/docs)
- [SvelteKit Documentation](https://svelte.dev/docs/kit)
- [Svelte 5 Migration Guide](https://svelte.dev/docs/svelte/v5-migration-guide)
- [Svelte Testing Docs](https://svelte.dev/docs/svelte/testing)
- [Joy of Code Tutorials](https://joyofcode.xyz/)

---

## When to Use This Skill

- Building new Svelte 5 applications with runes
- Migrating from Svelte 4 to Svelte 5
- Full-stack development with SvelteKit
- Creating reactive shared state
- Implementing form actions and API routes
- Testing Svelte components with Vitest

© travisjneuman · MIT · travisjneuman/.claude

Similar skills

All skills for Frontend and UI →

svelte-development by other authors comes first.

svelte-development manutej svelte-development guides coding assistants on Svelte 5 conventions, focusing on reactivity runes, scoped styling, and component props. CX Codex +1 437installs svelte Claude MPM Team Get Svelte 5 guidance for reactive components and SvelteKit apps. Use it when building UI state, bindings, routes, or data-loading flows. CX Codex +1 360installs svelte-deployment spences10 The svelte-deployment skill for Claude Code provides notes for shipping SvelteKit apps: choosing an adapter, fixing pnpm and Vite versions, publishing a library, and adding PWA support. CX Codex +1 253installs svelte-test davila7 The svelte-test command creates tests for Svelte components and SvelteKit routes, from component behavior to end-to-end flows. Use it to cover user actions, form handling, and error states. CX Codex +1 124installs svelte-testing qdhenry The svelte-testing subagent helps test Svelte and SvelteKit apps, from component behavior to end-to-end flows. Use it when you need coverage for UI interactions or server-side functions. CX Codex ★ 1,357repo stars svelte-scaffold davila7 svelte-scaffold is a Claude Code command that scaffolds SvelteKit projects, modules, or component libraries. Run it to create a project structure or add a feature. CX Codex +1 127installs tauri-svelte-typescript-guide-cursorrules-prompt-f PatrickJS tauri-svelte-typescript-guide-cursorrules-prompt-f — a Cursor rule that sets how the agent writes desktop apps with Tauri: Svelte on the frontend, TypeScript for types. CX Codex +1 ★ 41,178repo stars

From the same set117

The whole set →
tdd-workflow tdd-workflow — a skill for Claude Code, Codex, Cursor and other platforms that enforces test-driven development: first a failing test (RED), then minimal code to pass (GREEN), then refactoring. CX Codex +1 141installs core-workflow core-workflow is a skill with working protocols for agents: Git conventions, security and accessibility checklists, and task sizing. It loads for complex work or when a specific pattern is requested. CX Codex +1 141installs newsletter-creator newsletter-creator builds a company newsletter from a fixed outline: section order, a scoring pass over the links, and email layout rules to follow. CX Codex +1 140installs generic-react-feature-developer generic-react-feature-developer is a Claude Code skill that defines React feature architecture, including directory layout, Zustand, React Query, IndexedDB, and lazy loading. CX Codex +1 139installs llm-app-development llm-app-development — a skill for Claude Code guides the design of RAG pipelines, autonomous agents, and structured schemas. Triggers when building chatbots, retrieval systems, or LLM-driven tools. CX Codex +1 139installs product-analytics product-analytics architects event tracking, funnels, cohorts, and privacy-compliant instrumentation for PostHog, Amplitude, Mixpanel, and Segment. CX Codex +1 139installs payment-integration The payment-integration skill covers Stripe and RevenueCat integrations, subscription flows, and webhook handling. Use it when building payments or reviewing PCI scope. CX Codex +1 139installs generic-static-feature-developer generic-static-feature-developer guides feature work on plain HTML, CSS and JS sites: vanilla patterns, a GitHub Actions deploy and checks before you commit. CX Codex +1 139installs

Project sponsors

Companies that keep this analytics open