Token导航 LogoToken导航

Agent Skill · 研究检索

lsp-code-analysis(lsp 代码分析)

lsp-code-analysis 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

lsp-code-analysis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 17,411。

总安装 6,624周安装 276GitHub Stars 89下载 2,208核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:lsp-code-analysis(lsp 代码分析)
来源仓库:https://github.com/lsp-client/lsp-skill
仓库路径:skills/lsp-code-analysis
安装命令:
npx skills add https://github.com/lsp-client/lsp-skill --skill lsp-code-analysis
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/lsp-client/lsp-skill --skill lsp-code-analysis

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

lsp-code-analysis 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于代码分析、语法检查和语言服务器集成等研究场景。通过关键词、任务或来源仓库进行信息筛选,需结合原始 README 确认具体用法。

安装命令为 npx skills add https://github.com/lsp-client/lsp-skill --skill lsp-code-analysis。使用前建议确认权限范围、维护状态及是否触发联网或文件读写操作。

来源仓库内路径:skills/lsp-code-analysis

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lsp-client/lsp-skill --skill lsp-code-analysis;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

lsp-code-analysis 怎么安装?

在终端执行 npx skills add https://github.com/lsp-client/lsp-skill --skill lsp-code-analysis。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

lsp-code-analysis 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

lsp-code-analysis 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

lsp-code-analysis 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

lsp-code-analysis 用的人多吗?

公开数据是累计安装 6,624 次,近一周安装 276 次,下载 2,208 次,GitHub 89 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

lsp-code-analysis 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
lsp-code-analysis

lsp 代码分析 · 本页

6,62489需要联网MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

LSP Code Analysis

IMPORTANT: PREREQUISITE

To use this skill, you MUST follow these steps:

  1. Check for updates: Run the update script to ensure you are using the latest version of the tool.
  2. Verify project support: Run 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.

Abstract

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).

Overview

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:

  • 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

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).

TaskTraditional ToolRecommended LSP Command
Find Definitiongrep, readdefinition
Find Usagesgrep -rreference
Understand Filereadoutline
View Docs/Typesreaddoc
RefactorsedSee Refactoring Guide

Commands

All commands support -h or --help.

Locating Symbols

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:

  • The scope is determined by --scope (line/range/symbol). If no --scope is given, the entire file is the scope.
  • Pattern matching is whitespace-insensitive: differences in spaces, tabs, and newlines are ignored.
  • You MAY include the cursor marker <|> inside the pattern to specify the exact position of interest within the match (for example, on a variable name, keyword, or operator).
  • If --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 result
  • lsp doc foo.py --scope 10,20 --find "if <|>condition" - Find if condition in lines 10-20, position at c of condition
  • lsp doc foo.py --scope MyClass.my_method --find "self.<|>" - Find self. within MyClass.my_method, position after the dot
  • lsp doc foo.py --scope MyClass - Target the MyClass symbol directly

Guideline for Scope vs. Find:

  • Use --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.
  • Use --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"

Pagination

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.

Outline: File Structure

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> --all

Agents SHOULD use outline before reading files to avoid unnecessary context consumption.

Definition: Navigate to Source

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_definition

Reference: Find All Usages

Find 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 0

Doc: Get Documentation

Get 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_data

Agents SHOULD prefer doc over read when only documentation or type information is needed.

Search: Global Symbol Search

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 0

Agents SHOULD use --kinds to filter results and reduce noise.

Symbol: Get Complete Symbol Code

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.validate

Response 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.

Refactoring Operations

Read Refactoring Guide for rename, extract, and other safe refactoring operations.

Server: Manage Background Servers

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 shutdown

Best Practices

General Workflows

Understanding Unfamiliar Code

The 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>
Debugging Unknown Behavior
# 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>

Finding Interface Implementations

# Step 1: Locate interface definition
lsp search "IUserService" --kinds interface

# Step 2: Find all implementations
lsp reference src/interfaces.py --scope IUserService --mode implementations

Tracing Data Flow

# 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

Understanding Type Hierarchies

# 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

Performance Tips

# 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"

Domain-Specific Guides

For specialized scenarios, see:

平台分布

Claude Code

31.47%
按下载量换算695

OpenCode

21.8%
按下载量换算481

Codex

19.3%
按下载量换算426

Gemini CLI

12.97%
按下载量换算286

Antigravity

7.69%
按下载量换算170

windsurf

3.31%
按下载量换算73

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills