---
name: lsp-setup
description: Use when a required language server is missing, unavailable, broken, or needs configuration; skip working servers and general dependency setup; produce one minimum verified configuration.
---

# LSP Setup

Worker owns the minimum project-local language-server setup. Input is the language, repository root, existing configuration, diagnostic error, and authorization boundary.

## Procedure

1. Detect language, root, package manager, existing server, and config so setup extends the repository's current seam.
2. Run `scripts/detect-lsp.ts` or inspect `scripts/lsp-server-table.ts` for server, command, extensions, and install hint.
3. Prefer a maintained project-local server and preserve existing config. Use `request_user_input` before a machine or network change unless setup was already authorized.
4. Add only required command, arguments, extensions, and root markers.
5. Verify executable and version, start the server, and diagnose one representative file.

Avoid duplicate servers for one extension without explicit priority, global installation when a local server works, and broad editor changes.

## Proof and stop

Proof is the server, version, config path, startup result, and representative diagnostics. Escalate missing authorization, duplicate server priority, unsupported language, or broad editor changes to Root. Stop when one configuration works, setup is unavailable, or the minimum safe change cannot be proved.
