Skip to content
Svelte Code Writer

Svelte Code Writer Skill

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.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from sveltejs/ai-tools.

$ npx skills add sveltejs/ai-tools --skill svelte-code-writer

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

  1. Open the skill on GitHub and download the folder that holds its SKILL.md.
  2. Put it at ~/.claude/skills/svelte-code-writer/, where Claude Code picks it up in every project.

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/svelte-code-writer/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • 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

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.

SKILL.md

The instructions your agent loads, as published by Svelte.

SKILL.md
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
npx @sveltejs/mcp list-sections

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

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

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

Example:

npx @sveltejs/mcp get-documentation "$state,$derived,$effect"
Svelte autofixer
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:

# 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
Install

The Svelte team's own guidance on writing modern Svelte 5 — when to reach for each rune, why effects are an escape hatch, and the reactivity traps models fall into.

Anthropic's official skill for distinctive UI: a design plan reviewed against the brief before code, the named tells of generated design, and a quality floor.

Browse all skills →