All skills
sveltejs avatar

/svelte-code-writer

@022324b official
by Sveltesveltejs/mcp331 stars
40

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.

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

This session only. Nothing lands on disk.

SKILL.md

≈77 tokens always: the name and description. ≈406 when used: this file.

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

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides CLI commands using the official `@sveltejs/mcp` package to look up Svelte 5 documentation and analyze Svelte components. No security issues were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub last week.

Activeupdated 2 months ago

README badge

README badge for sveltejs/mcp/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.