svelte-code-writer

作者: sveltejs

用于Svelte 5文档查找和代码分析的CLI工具。在创建、编辑或分析任何Svelte组件(.svelte)或Svelte…时,必须使用。

npx skills add https://github.com/sveltejs/ai-tools --skill svelte-code-writer

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

来自 sveltejs 的更多技能

performance-investigation
sveltejs
调查性能回退并寻找优化机会
official
svelte-code-writer
sveltejs
用于Svelte 5文档查询和代码分析的CLI工具,内置自动修复功能。三个核心命令:list-sections浏览可用文档,get-documentation获取特定主题的完整文档,svelte-autofixer分析代码并建议修复。自动修复器通过--svelte-version标志支持Svelte 4和5目标,通过--async选项支持异步模式。接受内联代码(含转义$字符)和文件路径进行分析。设计用于...
official
svelte-core-bestpractices
sveltejs
编写快速、健壮、现代Svelte代码的指南。在Svelte项目中,当被要求编写/编辑或分析Svelte组件或……时,请加载此技能。
official
svelte-core-bestpractices
sveltejs
Guidance on writing fast, robust, modern Svelte code. Load this skill whenever in a Svelte project and asked to write/edit or analyze a Svelte component or…
official
scenario-writer
sveltejs
根据用户的描述选择一个要创建的新场景,将编写工作委托给 ai-scenario-writer 子代理并验证其正确性。
official
performance-investigation
sveltejs
调查性能回归问题,并寻找优化机会
official
writing-opencode-plugins
sveltejs
OpenCode插件,@opencode-ai/plugin,@opencode-ai/plugin/tui,插件钩子,自定义工具,TUI路由,插槽,键位映射,以及打包。在创建时使用…
official
scenario-writer
sveltejs
根据用户的描述选择要创建的新场景,将其写作任务委托给 ai-scenario-writer 子代理,并验证其正确性。
official