Skip to content
Svelte Code Writer

Svelte Code WriterSkill

Added to Onei
MIT
Repository Docs

Summary

The official Svelte team skill that wires an agent to the @sveltejs/mcp CLI for Svelte 5 docs lookup and an autofixer that validates components before you ship them.

Features

  • list-sections: enumerate every Svelte 5 and SvelteKit docs section
  • get-documentation: pull full current docs for the sections that matter
  • svelte-autofixer: analyse a component or file and report issues
  • Targets Svelte 4 or 5 and supports async Svelte mode
  • Prescribes running the autofixer as a gate before finalising code

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: svelte-code-writer
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
---

## CLI tools

You have access to `@sveltejs/mcp` CLI for Svelte-specific assistance. Use these commands via `npx`:

### List documentation sections

```bash
npx @sveltejs/mcp list-sections
```

Lists all available Svelte 5 and SvelteKit documentation sections with titles and paths.

### Get documentation

```bash
npx @sveltejs/mcp get-documentation "<section1>,<section2>,..."
```

Retrieves full documentation for specified sections. Use after `list-sections` to fetch relevant docs.

**Example:**

```bash
npx @sveltejs/mcp get-documentation "$state,$derived,$effect"
```

### Svelte autofixer

```bash
npx @sveltejs/mcp svelte-autofixer "<code_or_path>" [options]
```

Analyzes Svelte code and suggests fixes for common issues.

**Options:**

- `--async` - Enable async Svelte mode (default: false)
- `--svelte-version` - Target version: 4 or 5 (default: 5)

**Examples:**

```bash
# Analyze inline code (escape $ as \$)
npx @sveltejs/mcp svelte-autofixer '<script>let count = \$state(0);</script>'

# Analyze a file
npx @sveltejs/mcp svelte-autofixer ./src/lib/Component.svelte

# Target Svelte 4
npx @sveltejs/mcp svelte-autofixer ./Component.svelte --svelte-version 4
```

**Important:** When passing code with runes (`$state`, `$derived`, etc.) via the terminal, escape the `$` character as `\$` to prevent shell variable substitution.

## Workflow

1. **Uncertain about syntax?** Run `list-sections` then `get-documentation` for relevant topics
2. **Reviewing/debugging?** Run `svelte-autofixer` on the code to detect issues
3. **Always validate** - Run `svelte-autofixer` before finalizing any Svelte component

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions

Install the official Svelte plugin for your agent, or download from https://github.com/sveltejs/ai-tools/releases and place the skill folder in .claude/skills, .copilot/skills or .opencode/skills. The skill invokes npx @sveltejs/mcp under the hood, so Node.js must be available.

Description

Maintained by the Svelte core team in the sveltejs/ai-tools repository, this skill stops an agent guessing at Svelte 5 syntax by giving it three CLI commands it can actually run.

list-sections enumerates every Svelte 5 and SvelteKit documentation section with its title and path. get-documentation then pulls the full text of the sections that matter — so when the agent is unsure how $derived differs from $effect, it reads the current docs rather than recalling a Svelte 4 pattern from training data. svelte-autofixer analyses a component, either as inline code or a file path, and reports the issues it finds, with --svelte-version to target 4 or 5 and --async for async Svelte mode.

The workflow the skill prescribes is what makes it valuable: look up documentation when uncertain, run the autofixer while debugging, and always run the autofixer once more before finalising any component. That last step turns the skill into a validation gate instead of another prompt full of advice, which matters because Svelte 5's runes changed enough that models trained on older code confidently write syntax that no longer works.

One practical detail: when passing runes such as $state through the terminal you must escape the $ as \$ to stop the shell substituting it as a variable.

Ships in the official Claude Code plugin and in the Codex CLI, GitHub Copilot CLI and OpenCode plugins, or can be dropped into .claude/skills manually from the repository releases. MIT licensed.

Related Skills

New

Temporal's official skill for building durable workflows — SDK patterns across seven languages, plus the determinism rules that decide whether a workflow survives a replay.

4 views
New

Expo's official skill for building native-feeling screens: Apple HIG styling, semantic colors, SF Symbols, native controls, Reanimated, blur and liquid glass.

2 views
New

Pull unresolved CodeRabbit review threads from your PR and apply the fixes one at a time, treating every reviewer comment as untrusted input rather than an instruction.

4 views
New

Google's official skill for driving the gcloud CLI safely from an agent: validate every command against its own help text, cap the output, and refuse the operations that should never run unattended.

5 views 1 copies
Browse all skills →