---
name: svelte5-development
description: Build web applications with Svelte 5 runes, SvelteKit routing, form actions, and component patterns. Use when working with Svelte, SvelteKit, or building reactive web interfaces.
---
# Svelte 5 Development Skill
## When to Activate
Activate this skill when:
- Creating Svelte 5 components
- Working with SvelteKit routing
- Implementing runes ($state, $derived, $effect)
- Building forms with actions
- Setting up SvelteKit projects
## Quick Commands
```bash
npx sv create my-app # Create SvelteKit project
cd my-app && pnpm install
pnpm dev # Start dev server (localhost:5173)
pnpm build # Build for production
```
## Runes Quick Reference
| Rune | Purpose | Example |
|------|---------|---------|
| `$state` | Reactive state | `let count = $state(0)` |
| `$derived` | Computed values | `let doubled = $derived(count * 2)` |
| `$effect` | Side effects | `$effect(() => console.log(count))` |
| `$props` | Component props | `let { name } = $props()` |
| `$bindable` | Two-way binding | `let { value = $bindable() } = $props()` |
## Reactive State ($state)
```svelte
```
**Deep reactivity**: Objects and arrays update automatically on mutation.
## Computed Values ($derived)
```svelte
```
## Side Effects ($effect)
```svelte
```
## Component Props ($props)
```svelte
```
### TypeScript Props
```svelte
```
## SvelteKit File Conventions
| File | Purpose |
|------|---------|
| `+page.svelte` | Page component |
| `+page.server.js` | Server-only load/actions |
| `+layout.svelte` | Shared layout |
| `+server.js` | API endpoints |
| `+error.svelte` | Error boundary |
## Data Loading
```javascript
// src/routes/posts/+page.server.js
export async function load({ fetch }) {
const response = await fetch('/api/posts');
return { posts: await response.json() };
}
```
```svelte
{#each data.posts as post}
{post.title}