Ast Grep
BiFangKNT/mtga
Write and debug ast-grep rules for structural code search and rewrite.
Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill.
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lsp-code-analysis .claude/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .claude/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysisType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/lsp-code-analysis .agents/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .agents/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/lsp-code-analysis .cursor/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .cursor/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/lsp-client/lsp-skill.git --path skills/lsp-code-analysis--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/lsp-code-analysis .gemini/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .gemini/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install lsp-client/lsp-skill lsp-code-analysisInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/lsp-code-analysis .github/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .github/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/lsp-code-analysis .opencode/skills/lsp-code-analysis && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "lsp-code-analysis" agent skill from https://github.com/lsp-client/lsp-skill/tree/main/skills/lsp-code-analysis into .opencode/skills/lsp-code-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "lsp-code-analysis", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
lsp-code-analysisSemantic code analysis via LSP. An agent skill from lsp-client/lsp-skill.
Lsp Code Analysis is an agent skill from lsp-client/lsp-skill. 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.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts, reference files and assets (for example `assets/bp_template.md`, `references/bp_backend.md` and `references/bp_frontend.md`).
It sits in Development, covering Refactoring and Codebase onboarding. The repository describes itself as: IntelliSense Designed for Coding Agent. The licence is MIT.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 66f3e41. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Shell), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Lsp Code Analysis loads about 3k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 883 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from lsp-client/lsp-skill at commit 66f3e41, republished under its MIT licence (© lsp-client). 883 words, ~2,954 tokens.
.claude/skills/lsp-code-analysis/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.To use this skill, you MUST follow these steps:
lsp server start <project_path> to start the LSP server and confirm the project is supported.IF YOU DO NOT PERFORM THESE STEPS, YOU ARE NOT ALLOWED TO USE THIS SKILL.
This document specifies the operational requirements and best practices for the lsp-code-analysis skill. It provides a semantic interface to codebase navigation, analysis and refactoring via the Language Server Protocol (LSP).
You are provided with lsp CLI tool for semantic code navigation and analysis. It SHOULD be preferred over read or grep for most code understanding tasks.
Usages:
Guideline: You SHOULD prioritize LSP commands for code navigation and analysis. Agents MAY use read or grep ONLY when semantic analysis is not applicable (e.g., searching for comments or literal strings).
| Task | Traditional Tool | Recommended LSP Command |
|---|---|---|
| Find Definition | grep, read | definition |
| Find Usages | grep -r | reference |
| Understand File | read | outline |
| View Docs/Types | read | doc |
| Refactor | sed | See Refactoring Guide |
All commands support -h or --help.
Most commands use a unified locating syntax via the --scope and --find options.
Arguments: <file_path>
Options:
--scope: Narrow search to a symbol body or line range.--find: Text pattern to find within the scope.Scope Formats:
<line>: Single line number (e.g., 42).<start>,<end>: Line range (e.g., 10,20). Use 0 for end to mean till EOF (e.g., 10,0).<symbol_path>: Symbol path with dots (e.g., MyClass.my_method).Find Pattern (--find):
The --find option narrows the target to a text pattern within the selected scope:
--scope (line/range/symbol). If no --scope is given, the entire file is the scope.<|> inside the pattern to specify the exact position of interest within the match (for example, on a variable name, keyword, or operator).--find is omitted, the command uses the start of the scope (or a tool-specific default) as the navigation target.Cursor Marker (<|>):
The <|> marker indicates the exact position for symbol resolution. It represents the character immediately to its right. Use it within the find pattern to point to a specific element (e.g., user.<|>name to target the name property).
Examples:
lsp doc foo.py --find "self.<|>" - Find self. in entire file, position at the character after the dot (typically for completion or member access)lsp doc foo.py --scope 42 --find "return <|>result" - Find return result on line 42, position at r of resultlsp doc foo.py --scope 10,20 --find "if <|>condition" - Find if condition in lines 10-20, position at c of conditionlsp doc foo.py --scope MyClass.my_method --find "self.<|>" - Find self. within MyClass.my_method, position after the dotlsp doc foo.py --scope MyClass - Target the MyClass symbol directlyGuideline for Scope vs. Find:
--scope <symbol_path> (e.g., --scope MyClass, --scope MyClass.my_method) to target classes, functions, or methods. This is the most robust and preferred way to target symbol.--find (often combined with --scope) to target variables or specific positions. Use this when the target is not a uniquely named symbol or when you need to pinpoint a specific usage within a code block.Agents MAY use lsp locate <file_path> --scope <scope> --find <find> to verify if the target exists in the file and view its context before running other commands.
# Verify location exists
lsp locate main.py --scope 42 --find "<|>process_data"Use pagination for large result sets like reference or search.
--pagination-id <ID>: (Required) Unique session ID for consistent paging.--max-items <N>: Page size.--start-index <N>: Offset (0-based).Example:
# Page 1
lsp search "User" --max-items 20 --pagination-id "task_123"
# Page 2
lsp search "User" --max-items 20 --start-index 20 --pagination-id "task_123"Guideline: Use pagination with a unique ID for common symbols to fetch results in manageable chunks. Increment --start-index using the same ID to browse.
Get hierarchical symbol structure without reading implementation.
# Get main symbols (classes, functions, methods)
lsp outline <file_path>
# Get all symbols including variables and parameters
lsp outline <file_path> --allAgents SHOULD use outline before reading files to avoid unnecessary context consumption.
Navigate to where symbols are defined.
# Jump to where User.get_id is defined
lsp definition models.py --scope User.get_id
# Find where an imported variable comes from
lsp definition main.py --scope 42 --find "<|>config"
# Find declaration (e.g., header files, interface declarations)
lsp definition models.py --scope 25 --mode declaration --find "<|>provider"
# Find the class definition of a variable's type
lsp definition models.py --scope 30 --find "<|>user" --mode type_definitionFind where symbols are used or implemented.
# Find all places where logger is referenced
lsp reference main.py --scope MyClass.run --find "<|>logger"
# Find all concrete implementations of an interface/abstract class
lsp reference api.py --scope "IDataProvider" --mode implementations
# Get more surrounding code context for each reference
lsp reference app.py --scope 10 --find "<|>my_var" --context-lines 5
# Limit results for large codebases
lsp reference utils.py --find "<|>helper" --max-items 50 --start-index 0Get documentation and type information without navigating to source.
# Get docstring and type info for symbol at line 42
lsp doc main.py --scope 42
# Get API documentation for process_data function
lsp doc models.py --scope process_dataAgents SHOULD prefer doc over read when only documentation or type information is needed.
Search for symbols across the workspace when location is unknown.
# Search by name (defaults to current directory)
lsp search "MyClassName"
# Search in specific project
lsp search "UserModel" --project /path/to/project
# Filter by symbol kind (can specify multiple times)
lsp search "init" --kinds function --kinds method
# Limit and paginate results for large codebases
lsp search "Config" --max-items 10
lsp search "User" --max-items 20 --start-index 0Agents SHOULD use --kinds to filter results and reduce noise.
Get the full source code of the symbol containing a location.
# Get complete code of the function/class at line 15
lsp symbol main.py --scope 15
# Get full UserClass implementation
lsp symbol utils.py --scope UserClass
# Get complete method implementation
lsp symbol models.py --scope User.validateResponse includes: symbol name, kind (class/function/method), range, and complete source code.
Agents SHOULD use symbol to read targeted code blocks instead of using read on entire files.
Read Refactoring Guide for rename, extract, and other safe refactoring operations.
The background manager starts automatically. Manual control is OPTIONAL.
# List running servers
lsp server list
# Start server for a project
lsp server start <path>
# Stop server for a project
lsp server stop <path>
# Shutdown the background manager
lsp server shutdownThe RECOMMENDED sequence for exploring new codebases:
# Step 1: Start with outline - Get file structure without reading implementation
lsp outline <file_path>
# Step 2: Inspect signatures - Use doc to understand API contracts
lsp doc <file_path> --scope <symbol_name>
# Step 3: Navigate dependencies - Follow definition chains
lsp definition <file_path> --scope <symbol_name>
# Step 4: Map usage - Find where code is called with reference
lsp reference <file_path> --scope <symbol_name># Step 1: Locate symbol definition workspace-wide
lsp search "<symbol_name>"
# Step 2: Verify implementation details
lsp definition <file_path> --scope <symbol_name>
# Step 3: Trace all callers to understand invocation context
lsp reference <file_path> --scope <symbol_name># Step 1: Locate interface definition
lsp search "IUserService" --kinds interface
# Step 2: Find all implementations
lsp reference src/interfaces.py --scope IUserService --mode implementations# Step 1: Find where data is created
lsp search UserDTO --kinds class
# Step 2: Find where it's used
lsp reference models.py --scope UserDTO
# Step 3: Check transformations
lsp doc transform.py --scope map_to_dto# Step 1: Get class outline
lsp outline models.py
# Step 2: Find subclasses (references to base)
lsp reference models.py --scope BaseModel
# Step 3: Check type definitions
lsp definition models.py --scope BaseModel --mode type_definition# Use outline instead of reading entire files
lsp outline large_file.py # Better than: read large_file.py
# Use symbol paths for nested structures (more precise than line numbers)
lsp definition models.py --scope User.Profile.validate
# Limit results in large codebases
lsp search "User" --max-items 20
# Use doc to understand APIs without navigating to source
lsp doc api.py --scope fetch_data # Get docs/types without jumping to definition
# Verify locate strings if commands fail
lsp locate main.py --scope 42 --find "<|>my_var"For specialized scenarios, see:
© lsp-client, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 8 other files (scripts, references, assets) in skills/lsp-code-analysis of lsp-client/lsp-skill.
Open the folder on GitHubat commit 66f3e41
Lsp Code Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Lsp Code Analysis this skilllsp-client/lsp-skill | 119 | — | ~3k | Automated safety check: Pass | MIT | |
| Ast GrepBiFangKNT/mtga | 1.2k | — | ~802 | Automated safety check: Pass | AGPL-3.0 | |
| Gograph Go Repository Intelligenceozgurcd/gograph | 227 | — | ~4.8k | Automated safety check: Notes | MIT | |
| Ripwire Graph Queryredhat-et/ripwire | 2.4k | — | ~1.1k | Automated safety check: Notes | Apache-2.0 | |
| CodeNavitech-leads-club/agent-skills | 7k | — | ~3.4k | Automated safety check: Pass | CC-BY-4.0 | |
| Golang Goplscontext-labs/whip | 1.1k | 1 repos | ~2.3k | Automated safety check: Pass | MIT |
BiFangKNT/mtga
Write and debug ast-grep rules for structural code search and rewrite.
ozgurcd/gograph
Gives an agent working in a Go codebase a structural view through a local MCP server: call graphs, blast-radius and impact analysis, and bounded first-call exploration.
redhat-et/ripwire
Answers call-graph questions that combine several conditions, such as complex functions that reach a target or untested symbols near main, using ripwire's graph-query mode.
tech-leads-club/agent-skills
Investigates unfamiliar codebases before changing them, makes small targeted edits and records what it learns in a .notebook/ folder for later sessions.
context-labs/whip
Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors.
AnastasiyaW/codex-claude-code-config
Ranked symbol map of a codebase within a token budget — a compact "what matters in this repo" before reading files.
Categories
Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill. Lsp Code Analysis is an agent skill from lsp-client/lsp-skill. Semantic code analysis via LSP.
Lsp Code Analysis fits situations like: exploring unfamiliar codebases; performing safe refactoring.
Run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a claude-code`. Or copy the skill folder (skills/lsp-code-analysis in lsp-client/lsp-skill) into .claude/skills/lsp-code-analysis in your project. Claude Code loads it when a task matches its description.
Run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a codex`. Or copy the skill folder (skills/lsp-code-analysis in lsp-client/lsp-skill) into .agents/skills/lsp-code-analysis in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lsp-code-analysis, .gemini/skills/lsp-code-analysis, .github/skills/lsp-code-analysis and .opencode/skills/lsp-code-analysis in your project.
Going by SKILL.md and its folder, Lsp Code Analysis needs a shell for the scripts in its folder. Our summary lists: A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Lsp Code Analysis is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 840 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Lsp Code Analysis: Ast Grep (BiFangKNT/mtga, 1.2k stars), Gograph Go Repository Intelligence (ozgurcd/gograph, 227 stars), Ripwire Graph Query (redhat-et/ripwire, 2.4k stars) and CodeNavi (tech-leads-club/agent-skills, 7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
lsp-client (a GitHub organization) maintains it in lsp-client/lsp-skill, which has 119 GitHub stars. The repository was last updated on February 9, 2026.
Source: lsp-client/lsp-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.