Back to Skills

lsp-code-analysis

verified

Semantic code analysis via LSP. Navigate code (definitions, references, implementations), search symbols, preview refactorings, and get file outlines. Use for exploring unfamiliar codebases or performing safe refactoring.

View on GitHub

Marketplace

lsp-skill

lsp-client/lsp-skill

Plugin

lsp-code-analysis

Repository

lsp-client/lsp-skill
40stars

skills/lsp-code-analysis/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/lsp-client/lsp-skill/blob/main/skills/lsp-code-analysis/SKILL.md -a claude-code --skill lsp-code-analysis

Installation paths:

Claude
.claude/skills/lsp-code-analysis/
Powered by add-skill CLI

Instructions

# LSP Code Analysis

## IMPORTANT: PREREQUISITE

**You MUST run the [update script](scripts/update.sh) to check for updates before using this skill.**

Before any LSP operations, you **MUST first run `lsp server start <project_path>` to verify project support**.

**IF YOU DO NOT PERFORM THESE STEPS, YOU ARE NOT ALLOWED TO USE THIS SKILL.**

## Abstract

This document specifies the operational requirements and best practices for the `lsp-code-analysis` skill. It provides a semantic interface to codebase navigation and analysis via the Language Server Protocol (LSP).

## Overview

You SHOULD use the `lsp` CLI tool for semantic code navigation and analysis, and it SHOULD be preferred over `read` or `grep` for most code understanding tasks.

- **Semantic navigation**: Jump to definitions, find references, locate implementations - understands code structure, not just text patterns.
- **Language-aware**: Distinguishes between variables, functions, classes, types - eliminates false positives from text search.
- **Cross-file intelligence**: Trace dependencies, refactor safely across entire codebase - knows what imports what.
- **Type-aware**: Get precise type information, signatures, documentation - without reading implementation code.

### Tool Selection

| Task                | Traditional Tool | Recommended LSP Command                         |
| ------------------- | ---------------- | ----------------------------------------------- |
| **Find Definition** | `grep`, `read`   | [`definition`](#definition-navigate-to-source)  |
| **Find Usages**     | `grep -r`        | [`reference`](#reference-find-all-usages)       |
| **Understand File** | `read`           | [`outline`](#outline-file-structure)            |
| **View Docs/Types** | `read`           | [`doc`](#doc-get-documentation)                 |
| **Refactor**        | `sed`            | See [Refactoring Guide](references/refactor.md) |

**Guideline**: Agents SHOULD prioritize LSP commands for code navigation and an

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
9691 chars