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 分析程式碼並建議修復。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