svelte

Svelte compile-time framework with reactive declarations. Use for .svelte files.

7 stars

Best use case

svelte is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Svelte compile-time framework with reactive declarations. Use for .svelte files.

Teams using svelte should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/svelte/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/frameworks/svelte/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/svelte/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How svelte Compares

Feature / AgentsvelteStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Svelte compile-time framework with reactive declarations. Use for .svelte files.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Svelte

Svelte is a component framework that compiles your code to tiny, framework-less vanilla JS. Svelte 5 (2025) introduces "Runes" for explicit reactivity.

## When to Use

- **High Performance defaults**: Svelte apps are tiny and fast by default.
- **Embedded Apps**: Great for widgets/embeds because of small bundle size.
- **Simplicity**: HTML, CSS, and JS in one file, with very little boilerplate.

## Quick Start (Runes)

```svelte
<script>
  let count = $state(0);
  let double = $derived(count * 2);

  function increment() {
    count += 1;
  }
</script>

<button onclick={increment}>
  Count: {count} / Double: {double}
</button>
```

## Core Concepts

### Runes

Svelte 5 reactivity markers.

- **`$state`**: Declares reactive state.
- **`$derived`**: Declares a value that updates when dependencies change.
- **`$effect`**: Runs code when dependencies change (side effects).
- **`$props`**: Declares component props.

### Snippets

Reusable chunks of markup within a component.

```svelte
{#snippet figure(src, caption)}
  <figure>
    <img {src} alt={caption} />
    <figcaption>{caption}</figcaption>
  </figure>
{/snippet}

{@render figure(imageSrc, "A nice image")}
```

## Best Practices (2025)

**Do**:

- **Use Runes**: Migrate from `let` + `$` syntax to `$state` and `$derived` for explicit reactivity.
- **Use `onclick`**: Svelte 5 prefers native attributes (`onclick`) over `on:click` directives.
- **Use Snippets**: Replace `slots` with Snippets for better type safety and flexibility.

**Don't**:

- **Don't rely on auto-reactivity (Legacy)**: In Svelte 5 settings, opting into Runes disables the "magic" assignment tracking of Svelte 3/4. This is good for predictability.

## References

- [Svelte 5 Preview](https://svelte.dev/blog/runes)
- [Svelte Documentation](https://svelte.dev/)