lsp-setup
Set up Language Server Protocol (LSP) servers for Copilot CLI by detecting the repository language stack, selecting trusted servers, and merging user or project configuration. Use when the user asks to install or configure a language server, enable code intelligence, or diagnose missing CLI definitions, references, hover, or rename support, including warnings from .memory/lsp-status.md. Do not use for routine coding, VS Code or other editor language-service configuration, MCP setup, or static-analysis indexing.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 50
- Forks
- 12
01 前言 Front Matter
- name
- lsp-setup
- description
- Set up Language Server Protocol (LSP) servers for Copilot CLI by detecting the repository language stack, selecting trusted servers, and merging user or project configuration. Use when the user asks to install or configure a language server, enable code intelligence, or diagnose missing CLI definitions, references, hover, or rename support, including warnings from .memory/lsp-status.md. Do not use for routine coding, VS Code or other editor language-service configuration, MCP setup, or static-analysis indexing.
03 SKILL.md 正文
LSP Setup for Copilot CLI
Configure language servers for the languages actually used in the repository. Keep installation and configuration changes subject to explicit approval.
Workflow
1. Establish client and current state
- Confirm that the target is Copilot CLI. If the request concerns VS Code language services, explain that CLI LSP configuration does not configure the editor and direct the user to the relevant language extension.
- Read
.memory/lsp-status.mdif present. Treat it as a session-start snapshot of configuration file presence, not server health or language coverage. - Inspect
.github/lsp.jsonand~/.copilot/lsp-config.jsonwhen present and access is permitted. Use/lspoutput to identify effective servers, including plugin-provided ones. Ask the user to run interactive slash commands if the current tools cannot execute them. - Resolve configuration precedence by server name: project configuration overrides plugin configuration, which overrides user configuration. Preserve unrelated entries and intentionally disabled servers. Report malformed configuration before attempting a merge.
- If the required languages already have working servers, report that no changes are needed. If an existing server fails, diagnose its configuration or startup error before proposing another installation.
2. Detect and confirm the language stack
- Inspect build/dependency manifests and source file extensions, excluding DevSquad scaffolding, documentation examples, templates, vendored dependencies, generated files, and build output. Do not infer a language from documentation examples alone.
- If no stack can be established and the user has neither requested setup nor explicitly selected languages, defer setup without installing software or creating configuration. Envisioning, specification, and planning can proceed without LSP. Revisit setup when implementation introduces source files or manifests.
- If the user explicitly requests setup in a repository with no stack evidence, ask which languages they intend to use. Do not choose the application stack on their behalf. If they already explicitly chose languages, offer optional setup for those languages with approval.
- For polyglot repositories, identify the languages with meaningful source presence and any subproject roots.
- Present the evidence or explicitly chosen languages and proposed language set. Confirm which languages the user wants supported before making changes.
3. Resolve trusted servers and installation methods
- Determine the host OS, available package managers, existing server binaries, and required language runtimes.
- Select a maintained server for each confirmed language using official server and ecosystem documentation. Resolve the package name, supported runtime versions, installation method, and exact stdio launch command from those sources.
- Reuse an existing compatible installation. Do not assume every server accepts
--stdio, invent package names, or install a new package manager without separate approval. - If a server or platform is unsupported or cannot be verified, explain the limitation and leave that language unchanged. Offer a documented alternative when available.
4. Choose scope and approve the change
-
Present the available scopes and ask the user to choose:
Scope Location Effect Project .github/lsp.jsonShared with repository contributors; each machine still needs the server installed User ~/.copilot/lsp-config.jsonApplies to this user's projects on this machine -
Prefer the existing project configuration location when updating project settings. Check current CLI documentation before changing a legacy root-level
lsp.json; do not create a second competing project configuration silently. -
Explain overrides, disabled entries, and portability constraints. Keep machine-specific absolute paths and secrets out of shared configuration. Changing an intentionally disabled server requires explicit approval.
-
Show the exact installation commands and proposed configuration changes. Obtain approval before installing software, updating an existing server entry, or writing configuration. Do not modify application dependency manifests merely to install development language servers.
5. Install and merge configuration
- Run only approved installation commands. On failure, report the actual error and request approval for any alternative command; do not silently switch installers or elevate privileges.
- Confirm that the server executable is accessible in the environment that launches Copilot CLI (
command -von POSIX orGet-Commandon PowerShell). - Re-read the destination before writing. Add or update only approved keys under
lspServers, preserving other servers and fields. If the file changed since approval, reconcile the new content before proceeding. - Validate the resulting JSON and required server fields. Use the server's documented arguments and language IDs. For monorepos, set
rootUriwhen the server needs a subproject root.
6. Reload and verify runtime behavior
- Ask the user to run
/lsp reloadin Copilot CLI to load the updated configuration, then/lspto inspect effective server status. Check/lsp helpif the installed CLI does not support reload; restart only when required by that version. - Run
/lsp test SERVER-NAMEfor each configured server, or ask the user to run it and provide the result. Inspect/lsp logswhen startup fails. - Verify a definition or reference lookup on a known symbol in a saved source file of each configured language. If source files do not exist yet, defer this check without creating application code solely for verification. A reachable executable and valid JSON alone do not establish working code intelligence.
- Report configuration validity, server startup results, and code-navigation verification separately. For an explicitly chosen stack without code, state that navigation verification is pending until source files exist; startup may also remain unverified if the server requires project files. Report failures and checks awaiting user execution without claiming fully working code intelligence.
- Explain that
.memory/lsp-status.mdrefreshes at the next session start. Do not treat its older snapshot as the result of/lsp reload.
Configuration Shape
Use the following structure as a template, replacing placeholders with verified values:
{
"lspServers": {
"server-name": {
"command": "server-binary",
"args": ["documented-stdio-argument"],
"fileExtensions": {
".ext": "language-id"
}
}
}
}
- Use server keys containing only alphanumeric characters, underscores, and hyphens.
- Map extensions, including the leading dot, to the server's supported language IDs. Omit
argsor use an empty array when no arguments are required. - Preserve optional fields such as
env,rootUri,initializationOptions, and timeouts when merging. Follow current CLI documentation for supported fields. - Preserve entries such as
"server-name": { "disabled": true }unless the user approves enabling or replacing them. - Consult GitHub's LSP setup documentation and LSP configuration precedence for current client behavior.
04 同仓库更多 Skills
work-item-workflow
Work item workflow for implementation. Use when starting work on a GitHub issue or Azure DevOps work item to verify assignee, dependencies, priority, and capacity. Do not use for creating new work items (use work-item-creation), for suggesting the next task (use next-task), or when the work source is only tasks.md without an issue/work item.
work-item-creation
Rules and checklist for creating work items on GitHub Issues or Azure DevOps. Use when you need to create issues, user stories, tasks, epics, or features on the board. Do not use for platform configuration (use board-config), managing workflow of existing tasks (use work-item-workflow), or for comments on work items.
triage-workflow
Label-based state machine for triaging issues and work items. Manages state transitions, generates durable triage artifacts, and supports resumable sessions. Use when triaging GitHub issues or Azure DevOps work items. Do not use for creating new work items from scratch (use work-item-creation) or for managing implementation workflow of already-triaged items (use work-item-workflow).
test-discipline
Testing practices for behavior-focused, refactor-resistant tests. Use when implementing features, fixing bugs, refactoring, or adding or reviewing tests to ensure they verify intent through public interfaces and avoid tautological assertions. Also use when adding regression tests after bug fixes. Consulted by the implement agent during coding and by the review agent when validating test quality. Do not use for test strategy decisions (use complexity-analysis), for failure triage and root-cause analysis (use debugging-recovery, then after root cause is localized use test-discipline to add the reproducing regression test and fix), or for integration test infrastructure setup.
security-review
Security assessment workflow in two modes: architectural (design) and code (implementation). Use when a security trigger is detected during planning (architectural mode) or implementation/review (code mode). Covers STRIDE, OWASP, dependency scanning, Azure compliance, and GitHub security alerts. Do not use for general code quality (use devsquad.review), for threat modeling as a standalone activity, or for compliance audits.
reasoning
Record decisions and justifications during SDD agent execution, and pass structured context between agents via handoff envelope. Use when an agent needs to document decisions made (Reasoning Log) or perform a handoff to another agent. Do not use for architecture documentation (use ADRs), complexity analysis (use complexity-analysis), or debug logs.