# Svelte AI tools: official Svelte 5 skills and docs server (sveltejs/ai-tools) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-21 against commit d3e755b (version 1.0.11).
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/sveltejs/ai-tools/

## Explain it to a non-programmer
The Svelte team's own add-on for AI coding assistants. Your assistant writes modern Svelte 5 code instead of old Svelte 4 habits. It looks up the official Svelte and SvelteKit docs when it is unsure, and checks each component before it hands the code to you.

## Who it is for
- You build a site or app with Svelte or SvelteKit using Claude Code, Codex, Cursor, GitHub Copilot, OpenCode or Pi
- Your assistant writes outdated Svelte (on:click, export let, slots) or guesses at syntax
- You want the assistant to check each component and fix what the checker finds before you see it
- Not for: Your project does not use Svelte or SvelteKit
- Not for: You want help with a framework in general: these skills only cover Svelte components and modules

## What it is
- Kind: knowledge, scripts, always-on
- License: MIT
- Repository: https://github.com/sveltejs/ai-tools

## What it does
- svelte-core-bestpractices: when to use $state, $derived and $effect, props, events, snippets, keyed each blocks, styling, context and async Svelte
- A list of legacy Svelte 4 features to avoid and their Svelte 5 replacements
- svelte-code-writer: how to call the @sveltejs/mcp command line tool to list doc sections, fetch docs and run the autofixer
- svelte-file-editor helper (plugins): gathers docs, edits the file, runs the autofixer, fixes and re-checks, then reports
- Plugins also add the local Svelte docs server (MCP), and the Claude Code plugin registers the Svelte language server
- svelte-mcp-feedback (opt-in, installed separately): turns your correction of a Svelte mistake into a GitHub issue for the autofixer

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| svelte-core-bestpractices | loads by itself in a Svelte project when writing, editing or analysing a component | yes | Rules for writing fast, modern Svelte 5 code |
| svelte-code-writer | loads by itself for any .svelte file or .svelte.ts / .svelte.js module | yes | Teaches the assistant to look up the official docs and check its Svelte code with the Svelte command line tool |
| svelte-mcp-feedback | opt-in; triggers after you correct a Svelte mistake the assistant made | no | Turns your correction into a short public bug report for the Svelte checker, or a ready form for you to send |

### svelte-core-bestpractices
- Asks for: A Svelte component or module to write, edit or review
- Gives: Code that follows the Svelte 5 rules: $derived instead of $effect for computed values, keyed each blocks, onclick events, snippets, createContext
- Say: "Write a Svelte 5 component for a todo list with a filter"

### svelte-code-writer
- Asks for: The Svelte code or file path to check
- Asks for: Optionally the Svelte version from package.json
- Gives: Doc sections fetched for the topics in question
- Gives: Autofixer issues and suggestions for the component
- Say: "Check src/lib/Component.svelte with the Svelte autofixer and fix what it finds"

### svelte-mcp-feedback
- Asks for: Your correction of a Svelte or SvelteKit mistake the assistant made
- Gives: A minimal before/after example
- Gives: An issue titled 'Autofixer: detect <incorrect pattern>' in sveltejs/ai-tools, or a prefilled issue form for you to submit
- Say: "That $effect should be a $derived, please report it to the Svelte autofixer"

## Know before installing
- It switches on by itself: the skills say they must be used for any Svelte component or module, and the plugin helper is marked to be used proactively.
- The plugins start the Svelte docs server with npx, which downloads the @sveltejs/mcp package from npm when it runs.
- Docs come live from svelte.dev, so the docs lookup needs an internet connection.
- The feedback skill files public GitHub issues and is not part of any plugin; install it only if you want that.
- In Cursor the plugin adds a rule that is always on and tells the model how to use the Svelte docs tools.
- The OpenCode plugin updates itself by default: it checks npm and removes its cached copy so OpenCode installs the newest one.

## Install (official commands)
- Claude Code: `/plugin marketplace add sveltejs/ai-tools` && `/plugin install svelte` — Gives the local docs server, the skills and the svelte-file-editor helper. The language server entry expects a svelteserver command on your PATH.
- Codex CLI: `codex plugin marketplace add sveltejs/ai-tools` && `codex` && `/plugins` — In /plugins choose the Svelte marketplace, select the svelte plugin and install it.
- GitHub Copilot CLI: `copilot plugin marketplace add sveltejs/ai-tools` && `copilot plugin install svelte@ai-tools` — In VS Code, run 'Install plugin from source' with the repository URL instead.
- Cursor: `/add-plugin svelte` — From the Cursor Marketplace; adds the docs server, skills, an always-on rule and the helper. The Cursor CLI does not support plugins yet.
- OpenCode: `opencode plugin add @sveltejs/opencode` — OpenCode 2 or newer; with OpenCode 1.3.4 to 1.x run opencode plugin @sveltejs/opencode.
- Pi: `pi install npm:@sveltejs/pi` — Pi 0.99.0 or newer; add -l for the current project only. No helper subagent in Pi.
- Any agent (skills CLI): `npx skills add sveltejs/ai-tools --skill svelte-code-writer` && `npx skills add sveltejs/ai-tools --skill svelte-core-bestpractices` — Skills only, no docs server. The opt-in feedback skill is npx skills add sveltejs/ai-tools --skill svelte-mcp-feedback.
- Skills folder (manual): Copy the folders from tools/skills into .claude/skills, .copilot/skills or .opencode/skills.

## What runs on the user's machine
- Code on the machine: yes (plugin installs and when the assistant calls the @sveltejs/mcp tool; the skill folders alone are text)
- Network: True
- Plugin installs (Claude Code: The plugin starts the local Svelte docs server with npx -y @sveltejs/mcp, which npx fetches from npm.
- Claude Code plugin: Registers the Svelte language server for .svelte files (svelteserver --stdio).
- list-sections / get-documentation: The docs server reads the section list and docs from svelte.dev.
- svelte-autofixer: Static analysis of the code or file you pass; reads the file if the argument is a path.
- Remote option: If you choose the remote server, your code goes to https://mcp.svelte.dev/mcp; the Svelte team says it does not log, store or inspect it.
- OpenCode plugin start: Checks npm for a newer version; with autoupdate on (default) it deletes its own cache folder at shutdown. Its settings dialog writes .opencode/svelte.json or ~/.config/opencode/svelte.json.
- svelte-mcp-feedback (opt-in): The assistant runs gh issue list / gh issue create against sveltejs/ai-tools, or opens a prefilled issue page in the browser.

## Settings
- `--svelte-version`: autofixer target version, major 4 or 5 (default 5)
- `--async`: autofixer: enable async Svelte mode (default false)
- `OpenCode svelte.json: mcp.type`: local (default) or remote
- `OpenCode svelte.json: subagent / skills / instructions .enabled`: turn each part on or off (all on by default)
- `OpenCode svelte.json: autoupdate`: false keeps only the update warning
- `Pi svelte.json: mcp.exposure`: direct (default), codemode, deferred or hidden

## Examples (from the pack's own files)
- Compute from state with $derived, not $effect: output format defined in tools/skills/svelte-core-bestpractices/SKILL.md
- The svelte-file-editor report: output format defined in tools/agents/svelte-file-editor.md

## Steps only the person can do
- In Codex, open /plugins, choose the Svelte marketplace and install the svelte plugin (documentation/docs/60-plugins/50-codex-plugin.md) Then: Codex has the docs server, skills and helper
- For svelte-mcp-feedback, log in to the GitHub CLI (gh auth login), or submit the prefilled issue form yourself (tools/skills/svelte-mcp-feedback/SKILL.md) Then: The assistant files the issue with gh, or hands you the form link
- Make sure Node.js (npx) is available, and for the Claude Code language server a svelteserver command on PATH (plugins/claude/svelte/.claude-plugin/plugin.json) Then: The docs server, autofixer and language server start without errors

## Mistakes to avoid
- Not: Pass component code with runes to the command line tool unescaped. Instead: Escape $ as \$ in inline code, or pass a file path instead. Why: The shell replaces $state and $derived with empty variables
- Not: Expect svelte-mcp-feedback to come with the plugin. Instead: Install it separately with npx skills add sveltejs/ai-tools --skill svelte-mcp-feedback, only if you want issues filed. Why: It is opt-in and not bundled with any plugin
- Not: Install the Cursor plugin for the Cursor CLI or Cloud Agents and expect skills and the helper. Instead: Use the Cursor editor; in Cloud Agents only the docs server works. Why: The Cursor CLI has no plugin support, and Cloud Agents only load MCP servers
- Not: Run the autofixer with the default version on a Svelte 4 project. Instead: Pass --svelte-version with the version from package.json. Why: The default target is Svelte 5, and version-specific suggestions need the full version
- Not: Expect the svelte-file-editor helper in Pi. Instead: Ask Pi to spawn another instance of itself for isolated work. Why: The Pi package does not include the subagent

## What leaves the machine
- Requests for the docs section list and the doc pages → svelte.dev, When the assistant calls list-sections or get-documentation. Opt out: Do not install the docs server; use only svelte-core-bestpractices
- The code the assistant sends to the tools (autofixer, docs, playground link) → mcp.svelte.dev, Only if you set up the remote server instead of the local one. Opt out: Use the local server (the plugin default)
- A minimal before/after code example and your Svelte, SvelteKit and model versions, as a public issue → github.com/sveltejs/ai-tools issues, Only with the opt-in svelte-mcp-feedback skill, after you correct a Svelte mistake. Opt out: Do not install svelte-mcp-feedback
- A version check for @sveltejs/opencode → npm registry, When the OpenCode plugin starts. Opt out: No opt-out documented; autoupdate false only stops the self-removal

## Lines in the pack aimed at agents (ask the person first)
- "If the skill is not available you can run `npx @sveltejs/mcp@latest -y --help` to learn how to use it." (tools/agents/svelte-file-editor.md): Runs whatever npm serves as latest without a prompt; ask the person before the first npx run
- "MUST BE USED PROACTIVELY when creating, editing, or reviewing any .svelte file or .svelte.ts/.svelte.js module" (tools/agents/svelte-file-editor.md): The helper takes over Svelte edits without being asked; fine for Svelte work, tell the person it is active
- "gh issue create --repo sveltejs/ai-tools --title 'Autofixer: detect <incorrect pattern>' --body-file '<temporary-body-file>'" (tools/skills/svelte-mcp-feedback/SKILL.md): Posts publicly from the person's GitHub account; show the draft and get a yes before creating the issue

## May I use it like this?
- commercial-app: yes (MIT: keep the license notice)
- redistribute-files: yes (MIT: keep the copyright and permission notice in copies)
- client-work: yes (MIT allows use in work for others)

## Which one to pick
- If You build with Svelte or SvelteKit and want official rules, live docs and a code checker: skill:sveltejs/ai-tools
- If You build with React or Next.js and want framework best-practice skills: skill:vercel-labs/agent-skills
- If You want framework-neutral, current web platform guidance: skill:GoogleChrome/modern-web-guidance

## Works well with
- tool:svelte: The skills and autofixer are written for Svelte 5 and SvelteKit projects
- tool:svelte-check: Type checking for Svelte components alongside the autofixer's suggestions
- agent:claude-code: The repository is a Claude Code plugin marketplace with the svelte plugin
- agent:opencode: The @sveltejs/opencode plugin sets up the docs server, skills and helper

## Works in and needs
- Works in Claude Code: plugin
- Works in Codex: plugin
- Works in GitHub Copilot CLI: plugin
- Works in Cursor: plugin (editor only)
- Works in OpenCode: plugin
- Works in Pi: package
- Works in Claude Desktop, VS Code, Zed, Antigravity CLI: MCP server only
- Needs Node.js (npx): The docs server and the svelte-code-writer commands run @sveltejs/mcp through npx
- Needs svelteserver (Svelte language server): Only for the Claude Code plugin's language server entry
- Needs gh CLI with a GitHub account: Only for the opt-in svelte-mcp-feedback skill; otherwise it opens a browser form

## How to tell it works
Install the plugin, then ask for a Svelte 5 component that shows a count and its double. Code that uses $derived for the double (not $effect) and onclick (not on:click), plus a note that the autofixer found no issues, shows it is on.

## Safety
The plugins and skills run the npm package @sveltejs/mcp through npx without a pinned version, so each run uses what npm serves. Install only from github.com/sveltejs/ai-tools or the @sveltejs npm packages. The feedback skill writes public GitHub issues: it asks the assistant to strip project code and secrets first, but read the draft before it is sent.
