SKILL·E8788A

lsp-explore

blackwell-systems
更新于 3 days ago
1 次查看
154
18
154
在 GitHub 上查看
开发general

关于

The lsp-explore skill provides a comprehensive single-command overview of any code symbol by combining hover documentation, implementations, call hierarchy, and references. It's designed for quickly navigating unfamiliar codebases through the agent-lsp MCP server. Developers should use it when they need immediate context about a symbol's definition, usage, and relationships without running multiple separate LSP queries.

快速安装

Claude Code

推荐
主要方式
npx skills add blackwell-systems/agent-lsp -a claude-code
插件命令备选方式
/plugin add https://github.com/blackwell-systems/agent-lsp
Git 克隆备选方式
git clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-explore

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Requires the agent-lsp MCP server.

lsp-explore

"Tell me about this symbol" — hover, implementations, call hierarchy, and references in a single pass. Use when navigating unfamiliar code: you get type info, doc comments, who calls it, what implements it, and every reference site without issuing four separate commands.

Read-only — does not modify any files.

Invocation: User provides a symbol name in dot notation (e.g. "codec.Encode", "Buffer.Reset"). Optionally provide workspace_root to scope the search.


Prerequisites

If LSP is not yet initialized, call mcp__lsp__start_lsp with the workspace root first. Auto-inference applies when file paths are provided.


Phase 1 — Locate the symbol

Call mcp__lsp__go_to_symbol with symbol_path set to the user-provided name:

mcp__lsp__go_to_symbol({
  "symbol_path": "Package.SymbolName",   // dot notation; e.g. "codec.Encode"
  "workspace_root": "<root>"             // optional
})
→ returns: file, line, column (1-indexed)

Record the returned file, line, and column. If go_to_symbol returns nothing, report:

Symbol not found: <name> Check the dot-notation path (e.g. "Package.Symbol") and ensure the workspace root covers the file.

Stop immediately — do not proceed to Phase 2.

Then open the file so the language server has it in view:

mcp__lsp__open_document({
  "file_path": "<file from go_to_symbol>"
})

Phase 2 — Hover (always available)

Call mcp__lsp__inspect_symbol at the definition location:

mcp__lsp__inspect_symbol({
  "file_path": "<file from Phase 1>",
  "line": <line from Phase 1>,
  "column": <column from Phase 1>
})

Store the result as hover_text. If the call fails or returns nothing, set hover_text to an empty string. Do not stop.


Phase 3 — Implementations (capability-gated)

Call mcp__lsp__get_server_capabilities to see what the server supports:

mcp__lsp__get_server_capabilities()
→ returns: supported_tools list

If go_to_implementation appears in supported_tools, call it:

mcp__lsp__go_to_implementation({
  "file_path": "<file from Phase 1>",
  "line": <line from Phase 1>,
  "column": <column from Phase 1>
})
→ returns: list of implementation locations (file, line)

Record locations as implementations. If go_to_implementation is not in supported_tools, record "not supported by this server" — do not stop.


Phase 4 — Call hierarchy and references (run in parallel)

Issue both calls in the same message — they are independent:

4a — Incoming callers

Only if find_callers appears in supported_tools:

mcp__lsp__find_callers({
  "file_path": "<file from Phase 1>",
  "line": <line from Phase 1>,
  "column": <column from Phase 1>,
  "direction": "incoming"
})
→ returns: list of caller functions with file and line

If find_callers is not in supported_tools, note "not supported by this server" — do not stop.

4b — All reference sites

mcp__lsp__find_references({
  "file_path": "<file from Phase 1>",
  "line": <line from Phase 1>,
  "column": <column from Phase 1>,
  "include_declaration": false
})
→ returns: list of reference locations (file, line)

Collect all reference locations. Group by file and count distinct files.


Output format — Explore Report

Produce the report in this format:

## Explore Report: <SymbolName>

### Definition
- File: <file>:<line>
- Hover: <hover_text or "unavailable">

### Implementations (<N> found, or "not supported")
[list of file:line entries, or "none found", or "not supported by this server"]

### Callers (incoming call hierarchy)
[list of caller function names with file:line, or "none", or "not supported"]

### References (<N> total across <M> files)
[list of file:line entries grouped by file, or "none found"]

### Summary
- Symbol kind:      <inferred from hover or "unknown">
- Reference count:  <N>
- Files with refs:  <M distinct files>
- Callers:          <K>
- Implementations:  <P or "not supported">

Keep the report concise. The goal is "understand this symbol in one pass."


Example

Goal: understand the exported function `ParseConfig` in pkg/config

Phase 1 — go_to_symbol: symbol_path="config.ParseConfig"
  → pkg/config/parser.go:42:6

open_document: pkg/config/parser.go

Phase 2 — inspect_symbol: line=42, column=6
  → hover_text: "func ParseConfig(path string) (*Config, error) — reads and
    validates a config file from path"

Phase 3 — get_server_capabilities
  → go_to_implementation: in supported_tools
  go_to_implementation: line=42, column=6
  → 0 implementations (ParseConfig is a concrete function, not an interface method)

Phase 4 (parallel):
  find_callers direction=incoming
  → 3 callers: cmd.main (cmd/main.go:14), app.Start (internal/app.go:31),
               loader.Load (internal/loader.go:55)

  find_references include_declaration=false
  → 7 references in 4 files

## Explore Report: ParseConfig

### Definition
- File: pkg/config/parser.go:42
- Hover: func ParseConfig(path string) (*Config, error) — reads and validates a
  config file from path

### Implementations (0 found)
none found

### Callers (incoming call hierarchy)
- cmd.main — cmd/main.go:14
- app.Start — internal/app.go:31
- loader.Load — internal/loader.go:55

### References (7 total across 4 files)
cmd/main.go: line 14
internal/app.go: lines 31, 87
internal/loader.go: line 55
pkg/config/parser_test.go: lines 12, 34, 56, 78

### Summary
- Symbol kind:      function
- Reference count:  7
- Files with refs:  4
- Callers:          3
- Implementations:  0

GitHub 仓库

blackwell-systems/agent-lsp
路径: skills/lsp-explore
0
agentskillsai-agentsai-toolingclaudeclaude-codecode-intelligence
FAQ

常见问题

什么是 lsp-explore Skill?

lsp-explore 是一个 Claude Skill,作者为 blackwell-systems。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 lsp-explore 相关的任务。

如何安装 lsp-explore?

使用本页的安装命令:将 lsp-explore 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

lsp-explore 属于哪个分类?

lsp-explore 属于开发分类。

lsp-explore 可以免费使用吗?

可以。lsp-explore 已收录在 AIMCP,可免费安装。

相关推荐技能

qmd
开发

这是一个本地搜索和索引的CLI工具,支持BM25、向量搜索和重排序功能。开发者可以用它快速索引本地文件(如Markdown文档)并进行混合搜索,特别适合代码库或文档的本地检索。它还提供MCP模式,能轻松集成到Claude开发环境中使用。

查看技能
subagent-driven-development
开发

该Skill用于在当前会话中执行包含独立任务的实施计划,它会为每个任务分派一个全新的子代理并在任务间进行代码审查。这种"全新子代理+任务间审查"的模式既能保障代码质量,又能实现快速迭代。适合需要在当前会话中连续执行独立任务,并希望在每个任务后都有质量把关的开发场景。

查看技能
mcporter
开发

mcporter Skill 让开发者能在Claude中直接管理和调用MCP服务器。它支持列出可用服务器、调用工具、处理OAuth认证以及管理服务器守护进程。开发者可以通过命令行式交互快速执行`mcporter list`查看服务器,或使用`mcporter call`直接调用工具,简化了MCP工作流程。

查看技能
adk-deployment-specialist
开发

这是一个用于部署和编排Google Vertex AI ADK智能体的Claude Skill,专为构建生产级多智能体系统而设计。它支持通过A2A协议进行智能体通信,提供代码执行沙箱和记忆库功能,并能处理智能体发现与任务提交。当开发者需要部署ADK智能体或编排多智能体协作时,可使用此Skill来简化Vertex AI Agent Engine的部署流程。

查看技能