# lsp-code-analysis

Semantic code analysis over the Language Server Protocol: jump to definitions, find references, outline a file and preview refactorings.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 920 installs · ★ 118
- Author: lsp-client
- License: LICENSE · policy=link-only · description only; the file stays with the author
- Source: https://github.com/lsp-client/lsp-skill/tree/HEAD/skills/lsp-code-analysis/SKILL.md
- Updated: 2026-02-09
- HTML: https://affpapa.org/en/nevibecode/skills/lsp-code-analysis

## What it does

The skill hands your agent an `lsp` CLI for code navigation. Instead of `grep` and reading whole files, it resolves definitions, references and implementations, tells variables apart from functions and classes, and pulls signatures and docs. On an unfamiliar codebase that beats text search.

Two steps come first: run the update script `scripts/update.sh`, then confirm the project is supported with `lsp server start <project_path>`. The skill is not allowed to run without them. You point at a target with `--scope` (a line number, a range, or a path like `MyClass.my_method`) and `--find`, where the `<|>` marker sets the exact position inside the pattern. Large result sets page through `--pagination-id` and `--start-index`.

Commands cover `outline` for file structure, `definition`, `reference`, `doc` and `locate` to verify a target before acting. Refactoring has its own guide in `references/refactor.md`. If the language server for your stack does not come up during the check, nothing else will work — worth testing that before you wire the skill into a workflow.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/lsp-code-analysis/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/lsp-code-analysis/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/lsp-code-analysis/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/lsp-code-analysis/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install lsp-client/lsp-skill lsp-code-analysis
```

2. **Manually: put the files in place**
- File: `.github/skills/lsp-code-analysis/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/lsp-client/lsp-skill --path skills/lsp-code-analysis
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/lsp-code-analysis/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/lsp-client/lsp-skill/tree/HEAD/skills/lsp-code-analysis/SKILL.md

## When to use it
- find every usage of a function before renaming it
- map an unfamiliar file without reading its implementation
- jump to the definition of a symbol imported from another module
- read a signature and its docs without opening the source
- verify a symbol exists in a file before running a command

## Example prompts
- outline `src/models.py` with lsp outline
- find all references to `logger` inside `MyClass.run`
- jump to the definition of `User.get_id` in `models.py`

## Similar
- [lsp-setup](https://affpapa.org/en/nevibecode/skills/lsp-setup.md) — skill · 1100 installs
- [gopls-lsp](https://affpapa.org/en/nevibecode/plugins/gopls-lsp.md) — plugin · ★ 44635
- [rust-call-graph](https://affpapa.org/en/nevibecode/skills/rust-call-graph.md) — skill · 3200 installs
- [platform-lsp-integrate](https://affpapa.org/en/nevibecode/skills/platform-lsp-integrate.md) — skill · 2600 installs
- [rust-analyzer-lsp](https://affpapa.org/en/nevibecode/plugins/rust-analyzer-lsp.md) — plugin · ★ 44635
- [golang-gopls](https://affpapa.org/en/nevibecode/skills/golang-gopls.md) — skill · 11000 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
