Index of every page on this site: llms.txt
All skills
sveltejs avatar

/svelte-code-writer

@f9d22f2 official
by Sveltesveltejs/ai-tools344 stars
50
Run it yourself

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` subagent for optimal results.

Use this Skill: https://skilld.dev/gh/sveltejs/ai-tools/svelte-code-writer

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈80 tokens for metadata: the name and description. ≈437 when used: this file.

Description uses 4.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈320 characters, or 4.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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, ideally the full version from package.json (e.g. 5.16.0) so version-specific suggestions are enabled. The major must be 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

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides official Svelte 5 development tools and documentation access through the @sveltejs/mcp package. It is a standard developer toolset for analyzing and fixing Svelte code.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    1 file scanned · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f9d22f2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for sveltejs/ai-tools/svelte-code-writer

Provides CLI access to Svelte 5 documentation lookup and a code analyzer (svelte-autofixer) that detects issues in .svelte components and modules. Use this skill when writing, editing, or debugging Svelte components to check syntax and fetch relevant API docs on runes like $state and $derived.

Generated from the current SKILL.md.

Does this skill work with Svelte 4 or only Svelte 5?
It targets Svelte 5 by default, but the svelte-autofixer tool accepts a --svelte-version flag to analyze code for Svelte 4.
Can I use this skill to look up SvelteKit documentation?
Yes. The list-sections command includes both Svelte 5 and SvelteKit documentation sections.
What does svelte-autofixer do?
It analyzes Svelte code and suggests fixes for common issues. You can pass either inline code or a file path.
How do I pass Svelte runes like $state to the CLI?
When passing code with runes via the terminal, escape the $ character as \$ to prevent shell variable substitution.
Should I use this skill with a specific agent?
The skill recommends executing it within the svelte-file-editor agent for optimal results, though it works standalone.

Generated from the current SKILL.md. These answers refresh after source changes.