svelte
Svelte 5 and SvelteKit framework patterns. Covers runes ($state, $derived, $effect, $props, $bindable, $inspect), snippets, fine-grained reactivity, component composition, and event handling. SvelteKit coverage includes file-based routing, server and universal load functions, form actions, hooks, adapters, and error handling. Includes Svelte 4 to 5 migration guidance (stores to runes, on:event to onevent, slots to snippets). Use when building Svelte 5 components, configuring SvelteKit routing, implementing form actions, migrating from Svelte 4, or debugging reactivity issues.
What this skill does
# Svelte
## Overview
Svelte is a **compiler-based UI framework** that shifts work from runtime to build time, producing minimal JavaScript with no virtual DOM. Svelte 5 introduces runes for explicit, fine-grained reactivity. SvelteKit is the full-stack framework built on Svelte, providing file-based routing, server-side rendering, and deployment adapters.
**When to use:** Full-stack web apps, static sites, progressive enhancement, SSR/SSG, projects needing small bundle sizes, migration from Svelte 4 to 5.
**When NOT to use:** React/Vue ecosystem lock-in, projects requiring extensive third-party component libraries only available for other frameworks, teams with no Svelte experience on tight deadlines.
## Quick Reference
| Pattern | API / Syntax | Key Points |
| ------------------ | ------------------------------------------------------- | -------------------------------------------------- |
| Reactive state | `let count = $state(0)` | Replaces `let` reactivity from Svelte 4 |
| Derived state | `const double = $derived(count * 2)` | Replaces `$:` reactive declarations |
| Complex derivation | `const value = $derived.by(() => { ... })` | Multi-statement derived computations |
| Side effects | `$effect(() => { ... })` | Runs after DOM update, auto-tracks dependencies |
| Component props | `let { name, age = 25 } = $props()` | Replaces `export let`, supports defaults |
| Bindable props | `let { value = $bindable() } = $props()` | Two-way binding with `bind:value` |
| Debug inspection | `$inspect(value)` | Dev-only logging, stripped in production |
| Snippets | `{#snippet name(params)}...{/snippet}` | Replaces slots, reusable template blocks |
| Render snippet | `{@render name(args)}` | Invoke a snippet with arguments |
| Event handling | `<button onclick={handler}>` | Properties replace `on:click` directive |
| Each blocks | `{#each items as item (item.id)}...{/each}` | Keyed iteration for efficient updates |
| Await blocks | `{#await promise}...{:then}...{:catch}...` | Inline async rendering |
| Server load | `export function load({ params })` in `+page.server.ts` | Runs server-side only, accesses DB/secrets |
| Universal load | `export function load({ fetch })` in `+page.ts` | Runs on server and client |
| Form actions | `export const actions` in `+page.server.ts` | Progressive enhancement with `use:enhance` |
| Layout | `+layout.svelte` / `+layout.server.ts` | Shared UI and data across child routes |
| Server hooks | `handle()` in `src/hooks.server.ts` | Request middleware, auth, redirects |
| Error page | `+error.svelte` | Per-route error boundaries |
| Adapters | `adapter-auto`, `adapter-node`, `adapter-static` | Deploy to Vercel, Node, static hosting |
| API routes | `+server.ts` with `GET`, `POST`, etc. | Standalone endpoints, not tied to pages |
| Page options | `export const prerender = true` | Per-route SSR, CSR, prerender control |
| Shared state | `$state()` in `.svelte.ts` modules | Replaces writable stores for cross-component state |
| Raw state | `$state.raw(data)` | Opts out of deep proxying for large datasets |
## Svelte 4 to 5 Migration
| Svelte 4 (Legacy) | Svelte 5 (Current) |
| ----------------------------------------- | ----------------------------------------------- |
| `let count = 0` (reactive) | `let count = $state(0)` |
| `$: double = count * 2` | `const double = $derived(count * 2)` |
| `$: { sideEffect() }` | `$effect(() => { sideEffect() })` |
| `export let name` | `let { name } = $props()` |
| `<slot />` | `{#snippet children()}{/snippet}` + `{@render}` |
| `on:click={handler}` | `onclick={handler}` |
| `createEventDispatcher()` | Callback props: `let { onclick } = $props()` |
| `import { writable } from 'svelte/store'` | `$state()` in `.svelte.ts` modules |
| `$store` auto-subscription | Direct value access from rune-based state |
## Common Mistakes
| Mistake | Correct Pattern |
| --------------------------------------------- | ---------------------------------------------------------------------------- |
| Using `$state` on non-primitives without care | `$state` deeply proxies objects; use `$state.raw()` for large read-only data |
| Destructuring `$props()` loses reactivity | Destructure at declaration only: `let { x } = $props()` |
| Reading `$effect` dependencies conditionally | Ensure all tracked reads happen unconditionally |
| Returning cleanup from `$effect` incorrectly | Return a function: `$effect(() => { return () => cleanup() })` |
| Mixing `on:click` and `onclick` in Svelte 5 | Use `onclick` exclusively in Svelte 5 components |
| Using stores in new Svelte 5 code | Use `$state()` in `.svelte.ts` modules for shared state |
| Forgetting `(key)` in `{#each}` blocks | Always key: `{#each items as item (item.id)}` |
| Exporting load from `.svelte` files | Load functions belong in `+page.ts` or `+page.server.ts` |
| Not awaiting parent `load` in layouts | Use `await parent()` when child load depends on layout |
| Using `goto()` in server load functions | Use `redirect(303, '/path')` from `@sveltejs/kit` |
## Delegation
- **Pattern discovery**: Use `Explore` agent
- **Code review**: Delegate to `code-reviewer` agent
- **Build configuration**: Delegate to `Task` agent
> If the `tailwind` skill is available, delegate Tailwind CSS utility class patterns and configuration to it.
> If the `vitest-testing` skill is available, delegate Svelte component unit testing patterns to it.
> If the `playwright` skill is available, delegate end-to-end testing of SvelteKit routes and form actions to it.
> If the `drizzle-orm` skill is available, delegate database schema and query patterns used in SvelteKit server load functions to it.
> If the `vite` skill is available, delegate Vite build configuration and plugin setup to it.
## References
- [Runes and reactivity patterns ($state, $derived, $effect, $props)](references/runes-reactivity.md)
- [Snippets, rendering, and component composition](references/component-patterns.md)
- [SvelteKit routing, load functions, and layouts](references/sveltekit-routing.md)
- [Form actions, progressive enhancement, and validation](references/form-actions.md)
- [Hooks, middleware, and error handling](references/hooks-errors.md)
- [Svelte 4 to 5 migration patterns](references/migration-guide.md)
- [SvelteKit adapters and deRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.