К основному содержанию
скилл CX Codex

lsp-verify — скилл для Claude Code: что делает и как установить

Трёхуровневая верификация изменений в коде: сборка компилятором, LSP-диагностика и запуск тестов перед коммитом.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add blackwell-systems/agent-lsp --skill lsp-verify -a claude-code
Открыть на GitHub

Что делает lsp-verify

Скилл проверяет проект после правок кода. Делает это на трёх уровнях. Он собирает диагностику LSP для изменённых файлов, компилирует проект и запускает тесты. Сбои сборки и упавшие тесты считаются критическими ошибками, а предупреждения LSP попадают в отчёт как рекомендательные замечания.

Когда передан список файлов, скилл сначала находит связанные с ними тесты через mcp__lsp__get_tests_for_file. Затем запускаются проверки. Во время верификации любые изменения файлов запрещены. Инструменты форматирования и исправления вроде mcp__lsp__format_document предлагаются агентом только после успешного завершения всех проверок.

Для работы обязательно нужен запущенный MCP-сервер agent-lsp. Без него вызовы инструментов вернут ошибку.

Какие задачи решает

  • проверить проект перед коммитом на ошибки компиляции
  • сопоставить изменённые файлы с подходящими тестами
  • собрать диагностику LSP по затронутым файлам
  • отформатировать отредактированный код после прохождения тестов

Примеры запросов агенту

  • Проверь проект через lsp-verify перед коммитом
  • Запусти трёхслойную верификацию для изменённых файлов в src/
  • Выполни lsp-verify и покажи отчёт по тестам и LSP

Как установить lsp-verify

1Через Skills CLI (Vercel)

npx skills add blackwell-systems/agent-lsp --skill lsp-verify -a claude-code

2Вручную: положить файлы

~/.claude/skills/lsp-verify/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/lsp-verify/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о lsp-verify

Как установить lsp-verify в Claude Code?

Выполните команду npx skills add blackwell-systems/agent-lsp --skill lsp-verify -a claude-code. Альтернативный путь — сохранить файл вручную по пути ~/.claude/skills/lsp-verify/SKILL.md.

Что делает скилл lsp-verify?

Он параллельно запускает проверку сборки, сбор диагностических сообщений от LSP и прогон тестов. В итоге формируется структурированный отчёт со статусом CLEAN или NEEDS ATTENTION.

Что нужно для работы lsp-verify?

Требуется настроенный MCP-сервер agent-lsp. Скилл взаимодействует с компилятором и тестами только через инструменты этого сервера.

Исходный текст

SKILL.md · MIT
---
name: lsp-verify
description: Full three-layer verification after any change — LSP diagnostics + compiler build + test suite, ranked by severity. Use after completing any edit, refactor, or feature to confirm nothing is broken before committing.
user-invocable: true
allowed-tools: mcp__lsp__get_diagnostics mcp__lsp__run_build mcp__lsp__run_tests mcp__lsp__get_tests_for_file mcp__lsp__suggest_fixes mcp__lsp__format_document mcp__lsp__apply_edit
license: MIT
compatibility: Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
metadata:
  optional-capabilities: codeActionProvider documentFormattingProvider
  tool_permissions:
    phases:
      test_correlation:
        description: "Pre-step: map changed source files to their test files"
        allowed:
          - "mcp__lsp__get_tests_for_file"
        forbidden:
          - "mcp__lsp__apply_edit"
          - "Edit"
          - "Write"
      diagnostics:
        description: "Layer 1: collect LSP diagnostics for changed files"
        allowed:
          - "mcp__lsp__start_lsp"
          - "mcp__lsp__get_diagnostics"
        forbidden:
          - "mcp__lsp__apply_edit"
          - "Edit"
          - "Write"
      build:
        description: "Layer 2: run compiler build"
        allowed:
          - "mcp__lsp__run_build"
        forbidden:
          - "mcp__lsp__apply_edit"
          - "Edit"
          - "Write"
      tests:
        description: "Layer 3: run test suite"
        allowed:
          - "mcp__lsp__run_tests"
          - "Bash"                         # scoped test commands for large repos
        forbidden:
          - "mcp__lsp__apply_edit"
          - "Edit"
          - "Write"
      fix_and_format:
        description: "Post-verification: apply code action fixes and format"
        allowed:
          - "mcp__lsp__suggest_fixes"
          - "mcp__lsp__apply_edit"
          - "mcp__lsp__format_document"
          - "mcp__lsp__get_diagnostics"    # re-check after fixes
        forbidden:
          - "mcp__lsp__simulate_*"
          - "mcp__lsp__run_build"          # re-run full verify instead
          - "mcp__lsp__run_tests"          # re-run full verify instead
    global_forbidden:
      - "mcp__lsp__simulate_*"             # verify is post-edit, not speculative
      - "mcp__lsp__rename_symbol"          # verify does not make semantic changes
---

> Requires the agent-lsp MCP server.

# lsp-verify: Three-Layer Verification

## When to Use

Run this skill after any significant change to verify correctness at every level:

- After editing source files (logic changes, refactors, new functions)
- After merging or rebasing branches
- After dependency updates or configuration changes
- Before committing or pushing code

## Input

- `workspace_dir` (required): absolute path to the workspace root (e.g. `/Users/you/code/myproject`)
- `changed_files` (optional): list of files you edited — used for targeted diagnostics

## Execution

### Pre-step: Test correlation (when `changed_files` is provided)

Before running the three layers, call `get_tests_for_file` for each changed
source file to build a source → test file map:

```
mcp__lsp__get_tests_for_file({ "file_path": "<changed/source/file>" })
```

Returns the test files that correspond to each source file. Store this map —
it is used in Layer 3 to focus failure analysis. If `changed_files` is unknown,
skip this step.

**Run all three layers in parallel** — they are independent and do not need to
be sequenced. Issue all three calls in the same message to minimize wall time.

### Layer 1: LSP Diagnostics

Call `mcp__lsp__get_diagnostics` with `file_path` set to each changed file.
`get_diagnostics` takes a file path, not a workspace directory.

Note: requires LSP to be initialized. If not yet running, call `start_lsp`
with the workspace root first.

```
mcp__lsp__get_diagnostics({ "file_path": "<path/to/changed/file>" })
```

Call once per changed file. If you don't know which files changed, call it on
the primary files touched in this session. Rank results by severity: errors
first, then warnings.

### Layer 2: Build

```
mcp__lsp__run_build({ "workspace_dir": "<workspace_dir>" })
```

Returns `{ "success": bool, "errors": [...] }`. A failed build means the code
does not compile. Build errors are blocking — must be resolved before shipping.

### Layer 3: Tests

```
mcp__lsp__run_tests({ "workspace_dir": "<workspace_dir>" })
```

Does NOT require `start_lsp`. Returns `{ "passed": bool, "failures": [...] }`.

**Large output warning:** `run_tests` on large repos can return hundreds of
thousands of characters and exceed the context window. If the result is saved
to a file rather than returned inline, do NOT attempt to read the whole file.
Instead, search it for failures:

```bash
grep -E "^(FAIL|--- FAIL)" <output_file>
```

Or scope tests to the correlated test files from the pre-step to avoid the
size issue entirely:

```bash
GOWORK=off go test -count=1 -short ./internal/mypackage/... 2>&1 | grep -E "FAIL|ok"
```

**Using test correlation:** If the pre-step produced a source → test file map,
cross-reference failing test names against that map. For each failure, note
whether it is in a correlated test file (directly covers the changed code) or
an unrelated test file (collateral failure from a shared dependency). This
distinction guides where to investigate first.

Test failures are blocking — they indicate regressions or unmet contracts.

## Output Format

After running all three layers, produce a structured report:

```
## Verification Report

### Layer 1: LSP Diagnostics
[CLEAN / N errors, M warnings]

<details if N > 0 or M > 0>
Errors:
- file:line - message

Warnings:
- file:line - message
</details>

### Layer 2: Build
[PASSED / FAILED - N errors]

<details if FAILED>
- error message (file:line)
</details>

### Layer 3: Tests
[PASSED / FAILED - N failures]

<details if FAILED>
- test name: message (file:line) [correlated / unrelated]
</details>

<if test correlation map exists>
Test files covering changed source:
  changed/source/file.go → test/source_file_test.go
</if>

### Summary
Overall: CLEAN / NEEDS ATTENTION
Blocking issues: [errors that must be fixed before shipping]
```

- **CLEAN**: no errors in any layer (warnings are advisory only)
- **NEEDS ATTENTION**: one or more blocking issues found

## Blocking vs Advisory

| Layer | Errors | Warnings |
|-------|--------|----------|
| LSP Diagnostics | Blocking | Advisory |
| Build | All blocking | N/A |
| Tests | All blocking | N/A |

Build errors and test failures block shipping. LSP warnings and style
suggestions are advisory — document them but do not treat as blockers unless
they indicate logical errors.

## When Verification Passes: Optional Format

If all three layers are CLEAN and `changed_files` is known, offer to format
the changed files before committing:

```
mcp__lsp__format_document({ "file_path": "<changed-file>" })
```

Apply the returned `TextEdit[]` via `apply_edit` if non-empty. Run once per
changed file. Skip if the user did not request formatting.

---

## When Errors Are Found: Applying Code Actions

If Layer 1 returns errors, the LSP may offer quick fixes. For each error
location, call `suggest_fixes` to surface available fixes:

```
mcp__lsp__suggest_fixes({
  "file_path": "<file>",
  "line": <error line>,
  "column": <error column>
})
```

Returns a list of available actions (e.g. "Add missing import", "Implement
interface methods", "Remove unused variable"). Pick the most appropriate one
and apply it:

```
mcp__lsp__apply_edit({
  "file_path": "<file>",
  "old_text": "<text to replace>",
  "new_text": "<replacement>"
})
```

Or if the code action returns a `workspace_edit`, pass it directly to
`apply_edit` via the `workspace_edit` parameter.

After applying, **re-run Layer 1** on the affected file to confirm the error
is resolved before moving on. Do not apply multiple code actions in bulk
without verifying each one — they may interact.

**When to use:** Compile errors from missing imports, unimplemented interface
methods, or type mismatches often have one-click fixes available. Manual
reasoning is still required for logic errors.

© blackwell-systems · MIT · blackwell-systems/agent-lsp

Похожие скиллы

Все скиллы по теме «Тесты и QA» →
improve-codebase-architecture Matt Pocock Скилл ищет архитектурные узкие места в кодовой базе и показывает варианты углубления модулей в HTML-отчёте. Подойдёт для ревью перед рефакторингом. 1 163 035установок design-taste-frontend Leonxlnx Скилл задаёт арт-дирекцию для публичных страниц и рабочих экранов, а затем проверяет результат в браузере по скриншотам. Нужен, когда интерфейс выглядит шаблонным или недоработанным. CX Codex +1 678 700установок tdd Matt Pocock Скилл управляет циклом красный-зелёный в TDD: проверяет, что тесты пишутся до кода, держит их на уровне публичных интерфейсов и не завязывает на внутреннюю структуру. 1 141 062установок skill-creator официальный anthropics Помогает создать новый скилл, доработать существующий и проверить результат через тестовые промпты и оценки. 414 180установок agent-browser vercel-labs Скилл управляет браузером через CLI: открывает страницы, заполняет формы, нажимает кнопки и проверяет веб-приложения. Подходит для задач, где агенту нужно действовать в интерфейсе. CX Codex +1 1 200 000установок prototype Matt Pocock Создаёт временный прототип, чтобы проверить логику, модель состояния или вид интерфейса до работы над основным кодом. 986 201установок

Из того же набора25

lsp-understand Исследует символ или файл и собирает карту типов, реализаций, вызовов и ссылок. Пригодится, когда нужно разобраться, как устроен незнакомый модуль. CX Codex +1 ★ 165звёзд репо lsp-test-correlation Находит тесты, которые покрывают изменённый файл, и запускает только их. Пригодится, когда правишь один файл и не хочешь гонять весь набор. CX Codex +1 ★ 165звёзд репо lsp-simulate Скилл моделирует правки в оперативной памяти и проверяет ошибки через LSP перед записью на диск. Пригодится при рискованном рефакторинге или изменениях сразу в нескольких файлах. CX Codex +1 ★ 165звёзд репо lsp-safe-edit Скилл сравнивает диагностику до и после правки и сначала проверяет изменение в памяти. Пригодится для правок одного или нескольких файлов. CX Codex +1 ★ 165звёзд репо lsp-rename Переименовывает функции, методы, переменные и типы по всему проекту в два этапа: сначала показывает все затронутые места, потом меняет их после подтверждения. CX Codex +1 ★ 165звёзд репо lsp-refactor Организует цепочку безопасного рефакторинга кода через LSP: оценивает охват изменений, симулирует правки в памяти, вносит их на диск, проверяет сборку и запускает тесты. CX Codex +1 ★ 165звёзд репо lsp-onboard Исследует новый проект через LSP и собирает профиль с языками, сборкой, тестами, точками входа и архитектурными связями. CX Codex +1 ★ 165звёзд репо lsp-local-symbols Показывает, какие функции и типы объявлены в файле, где используется переменная и какой у неё тип. Пригодится перед правкой одного файла. CX Codex +1 ★ 165звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой