lsp-guide — скилл для Claude Code: что делает и как установить
Скилл lsp-guide учит агента спрашивать языковой сервер, где определён символ, где он используется и что сломалось после правки, вместо поиска по тексту.
Apache-2.0 ★ 5 622 обновлён 2026-10-29
npx skills add weave-os/router --skill lsp-guide -a claude-codeЧто делает lsp-guide
Скилл даёт агенту готовые рецепты для инструмента lsp — пять операций: definition, references, hover, documentSymbol и diagnostics. Работают они через настоящий языковой сервер для Go, TypeScript/JavaScript, Python и Rust, поэтому импорты, алиасы и типы разворачиваются, а не совпадают по буквам.
Вызов требует координат: path, line и column, нумерация с единицы, колонка ставится на первый символ идентификатора. Пути считаются от рабочей директории. Поиск использований идёт в два шага: сначала объявление через rg -n --column или documentSymbol, потом references.
Первый запрос в новой рабочей области ждёт индексации — до минуты в большом репозитории, и после таймаута его стоит повторить один раз. Список ссылок ограничен, по умолчанию 100. Для файла, который сервер не поддерживает, вернётся текст с советом; недостающий сервер ставится через lsp_enable с согласия пользователя. Внутри dispatch-субагентов запросы тоже работают.
Какие задачи решает
- найти все места вызова функции, а не текстовые совпадения
- посмотреть сигнатуру и доккомментарий, не открывая файл определения
- получить оглавление файла перед чтением длинного модуля
- узнать, что сломалось после правки, по диагностике сервера
- различить одноимённые символы из разных пакетов
Примеры запросов агенту
- Где определён
<symbol>и где он ещё используется? Смотри через языковой сервер, не грепом. - Прогони диагностику по
<file>после моей правки. - Дай оглавление
<file>, а потом сигнатуру и доккомментарий у<symbol>.
Как установить lsp-guide
1Через Skills CLI (Vercel)
npx skills add weave-os/router --skill lsp-guide -a claude-code2Вручную: положить файлы
~/.claude/skills/lsp-guide/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/lsp-guide/
1Через Skills CLI (Vercel)
npx skills add weave-os/router --skill lsp-guide -a codex2Вручную: положить файлы
.agents/skills/lsp-guide/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add weave-os/router --skill lsp-guide -a cursor2Вручную: положить файлы
.cursor/skills/lsp-guide/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install weave-os/router install/pi-router/skills/lsp-guide2Вручную: положить файлы
.github/skills/lsp-guide/SKILL.md1Через Skills CLI (Vercel)
npx skills add weave-os/router --skill lsp-guide -a gemini-cli2Командой платформы
gemini skills install https://github.com/weave-os/router --path install/pi-router/skills/lsp-guideВручную: положить файлы
.devin/skills/lsp-guide/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о lsp-guide
Как установить lsp-guide в Claude Code?
Выполните npx skills add weave-os/router --skill lsp-guide -a claude-code. Файл скилла окажется по пути ~/.claude/skills/lsp-guide/SKILL.md.
Что делает lsp-guide?
Он даёт агенту рецепты для инструмента lsp: переход к определению, поиск использований, сигнатура с доками, оглавление файла и диагностика компилятора.
С какими языками это работает?
С Go, TypeScript/JavaScript, Python и Rust — через соответствующий языковой сервер. Для остальных файлов остаётся поиск по тексту.
Исходный текст
SKILL.md · Apache-2.0
---
name: lsp-guide
description: Recipes for the lsp tool — resolving where a symbol is defined, every place it is used, type signatures and docs, file outlines, and compiler/type errors through a real language server (Go, TypeScript/JavaScript, Python, Rust). Use when navigating or explaining code by symbol, finding callers or usages, checking what broke after an edit, or deciding between lsp and text search.
---
# Using the lsp tool
The `lsp` tool answers *semantic* questions through the language's own server:
it resolves through imports, types, and aliases, where grep only matches text.
Reach for it whenever the question is about a **symbol**; keep grep for plain
strings, comments, and file types no server supports.
## Operations
| Operation | Answers | Needs |
|---|---|---|
| `definition` | where the symbol at a position is defined | `path`, `line`, `column` |
| `references` | every place the symbol at a position is used | `path`, `line`, `column` |
| `hover` | type signature + docs for the symbol at a position | `path`, `line`, `column` |
| `documentSymbol` | the outline (types, functions, methods) of one file | `path` |
| `diagnostics` | compiler/type errors and warnings for one file | `path` |
Positions are 1-based, and `column` must point **at the identifier** (its first
character works). All paths resolve against the working directory.
## Recipes
**"Where is X defined?"** — from any usage site of X:
`{"operation": "definition", "path": "<file>", "line": <L>, "column": <C>}`.
Don't know a usage site? Find one first (see next recipe's step 1).
**"Everywhere X is used"** — two steps, always:
1. Locate the declaration: `rg -n --column '\bX\b'` (the `--column` output is
exactly the coordinate the next call needs), or `documentSymbol` when you
already know the file.
2. `{"operation": "references", "path": "<decl file>", "line": <L>, "column": <C>}`.
A grep hit list is **not** a references answer: it includes comments and
strings, misses aliased imports, and can't distinguish same-named symbols.
Step 2 is what makes the answer authoritative.
**"What is this / what's its signature?"** — `hover` at the symbol. Prefer it
over reading the definition file when you only need the type or doc comment.
**"What's in this file?"** — `documentSymbol` before reading a large file; jump
straight to the line the outline gives you.
**"Did my edit break anything here?"** — `diagnostics` on the file after
editing. It reports the server's current analysis of the saved file.
## Behavior worth knowing
- **First query per workspace is slow** (the server indexes — up to a minute
in a big repo). Later queries on that workspace are fast; don't give up
after one timeout, retry once.
- **References are capped** (default 100, header says how many exist).
- **Unsupported file type or missing server** returns advice text, not an
error — fall back to grep for that file. A missing server can be installed
with the user's consent via `lsp_enable` (see the install-lsps skill for
toolchain prerequisites).
- Works inside dispatch subagents too (they share the parent's warm servers),
so symbol lookups are safe to fan out.
© weave-os · Apache-2.0 · weave-os/router