svelte-code-navigation
Use when locating Svelte symbol definitions or references, tracing callers, checking types or diagnostics, or assessing a Svelte rename or deletion.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-01
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- svelte-code-navigation
- description
- Use when locating Svelte symbol definitions or references, tracing callers, checking types or diagnostics, or assessing a Svelte rename or deletion.
03 SKILL.md 正文
Svelte code navigation
When LSP Intelligence's lsp_ MCP tools are available, prefer them for supported semantic queries. Pass the current task's absolute workspace_root and source path; check diagnostic availability and freshness before interpreting an empty result. Retain this plugin's documentation, autofixer and project-check workflows. The helper below remains the fallback when the MCP is unavailable; its empty diagnostics alone do not establish a clean file.
Use the packaged local LSP client for semantic questions when svelteserver is available on PATH. It starts the server for one query, opens a .svelte document, prints JSON, and exits. It defaults the Svelte server's file watcher to polling to avoid EMFILE in constrained Codex subprocesses; an existing CHOKIDAR_USEPOLLING value takes precedence. Node.js and svelte-language-server are user-installed requirements; this plugin does not install them.
Query
Resolve the installed plugin root from this skill's location, then run:
node <plugin-root>/scripts/svelte-lsp.mjs --root <app-root> --file src/lib/Widget.svelte --operation references --line 12 --character 8
The position is one-based (first line and first character are 1) and characters count UTF-16 code units, as in LSP. A character after an emoji can therefore have a higher column than its visual code-point count. The JSON result uses the same one-based convention. Operations are definition, references, hover, document-symbols, workspace-symbols (add --query NAME), incoming-calls, outgoing-calls, and diagnostics. For symbol operations, put the position on the symbol's name. Start from a .svelte file even when references lead into TypeScript. The helper does not modify files.
Before a rename or delete: find the symbol, query references, and search text for route filenames, dynamic import strings, import.meta.glob patterns, CSS classes, and route paths. Those are not guaranteed to appear as semantic references. Check the project's own check script after an edit.
Full-project verification
Use the project's check script when present (npm run check, pnpm check, or the project's package manager). If absent, run the already-installed svelte-check binary with the project's TypeScript configuration; SvelteKit may first need its existing sync command to regenerate .svelte-kit types. State that generated files may change. Do not install dependencies merely to make a check command available.
diagnostics waits for a notification about the opened file; it is narrower than a full project check. Empty or failed LSP results require checking the file and position, then trying document-symbols. If svelteserver is absent or unresponsive, say so and use rg for text matches plus project checks for errors. Describe text matches as text matches, not as complete symbol references.
04 同仓库更多 Skills
example-workflow
Use when the user needs the specific workflow supplied by this plugin.
svelte-docs-and-autofixer
Use when a Svelte or SvelteKit task needs current official API documentation, a Svelte compiler check, autofixer feedback, or a Svelte playground link.
svelte-component-editor
Use when creating, editing, fixing, or migrating Svelte components, Svelte modules, SvelteKit routes, forms, loads, hooks, or related integration code.
svelte-code-auditor
Use when reviewing or auditing Svelte or SvelteKit code, a pull request, a migration, or framework-related security and accessibility concerns without editing source files.
svelte-best-practices
Use when implementing, reviewing, or migrating Svelte components, SvelteKit routes, Svelte CLI setup, Astro Svelte islands, or Tailwind styling in a Svelte project.
lsp-setup
Use when installing, verifying, updating, or troubleshooting the LSP Intelligence plugin and its local mcpls language-server runtime.