svelte-code-writer

bởi sveltejs

Công cụ CLI để tra cứu tài liệu Svelte 5 và phân tích mã với trình tự sửa lỗi tích hợp. Ba lệnh chính: list-sections để duyệt tài liệu có sẵn, get-documentation để lấy tài liệu đầy đủ cho các chủ đề cụ thể, và svelte-autofixer để phân tích mã và đề xuất sửa lỗi. Trình tự sửa lỗi hỗ trợ nhắm mục tiêu Svelte 4 và 5 qua cờ --svelte-version và chế độ async qua tùy chọn --async. Chấp nhận cả mã nội tuyến (với ký tự $ được thoát) và đường dẫn tệp để phân tích. Được thiết kế để sử dụng trong...

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

Thêm skills từ sveltejs

performance-investigation
sveltejs
Điều tra suy giảm hiệu suất và tìm cơ hội tối ưu hóa
official
svelte-core-bestpractices
sveltejs
Hướng dẫn viết mã Svelte nhanh, mạnh mẽ, hiện đại. Tải kỹ năng này bất cứ khi nào đang trong dự án Svelte và được yêu cầu viết/chỉnh sửa hoặc phân tích một thành phần Svelte hoặc…
official
svelte-code-writer
sveltejs
Công cụ CLI để tra cứu tài liệu Svelte 5 và phân tích mã. PHẢI được sử dụng khi tạo, chỉnh sửa hoặc phân tích bất kỳ thành phần Svelte (.svelte) hoặc 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
Chọn một kịch bản mới để tạo dựa trên mô tả của người dùng, giao việc viết kịch bản cho tiểu tác nhân ai-scenario-writer và xác minh tính chính xác.
official
performance-investigation
sveltejs
Điều tra các vấn đề suy giảm hiệu suất và tìm cơ hội tối ưu hóa
official
writing-opencode-plugins
sveltejs
Plugin OpenCode, @opencode-ai/plugin, @opencode-ai/plugin/tui, hook plugin, công cụ tùy chỉnh, tuyến TUI, slot, keymap và đóng gói. Sử dụng khi tạo,…
official
scenario-writer
sveltejs
Chọn một kịch bản mới để tạo dựa trên mô tả của người dùng, ủy quyền viết kịch bản đó cho tiểu tác nhân ai-scenario-writer và xác minh tính chính xác.
official