lsp-edit-symbol
について
このClaudeスキルは、ファイルパスや正確な位置情報を必要とせず、名前だけでコードシンボル(関数、型、変数)を編集できるようにします。シンボルの定義を自動的に解決し、その完全な範囲を取得して、編集を適用します。シンボルの本体やシグネチャを変更したいが、名前しかわからない場合にご利用ください。
クイックインストール
Claude Code
推奨npx skills add blackwell-systems/agent-lsp -a claude-code/plugin add https://github.com/blackwell-systems/agent-lspgit clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-edit-symbolこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
lsp-edit-symbol
Edit a named symbol (function, type, variable) without needing its exact file path
or line/column. Primary path uses replace_symbol_body for direct symbol replacement.
Falls back to find_symbol + list_symbols + apply_edit when
the server does not support document symbols well.
Workflow
Step 1 — Locate the file
{ "tool": "find_symbol", "query": "MyFunc" }
Returns a list of matching symbols with file URI and position. Pick the definition (not a test file, not a stub). If multiple matches, use the container name or file path to disambiguate.
Step 2 — Replace the symbol body (primary path)
Use replace_symbol_body to replace the entire function/method/type body by name:
{
"tool": "replace_symbol_body",
"file_path": "/path/to/file.go",
"symbol_path": "MyFunc",
"new_body": "func MyFunc() error {\n\treturn nil\n}"
}
For methods, use dot notation: "MyStruct.Method".
This resolves the symbol by name within the file, finds its full range, and replaces it atomically. No position math required.
If replace_symbol_body fails (e.g., the server cannot resolve document symbols
for this file), fall back to the manual path below.
Fallback — Manual resolution via document symbols
Step 2b — Get the full range:
{
"tool": "list_symbols",
"file_path": "/path/to/file.go",
"language_id": "go"
}
Find MyFunc in the returned tree. The range field covers the entire symbol
including its body; selectionRange covers only the name.
Step 3b — Apply the edit:
Option A (text-match, recommended when you have the old text):
{
"tool": "apply_edit",
"file_path": "/path/to/file.go",
"old_text": "func MyFunc() {",
"new_text": "func MyFunc() error {"
}
Option B (positional, when you have the exact range):
{
"tool": "apply_edit",
"workspace_edit": {
"changes": {
"file:///path/to/file.go": [{
"range": { "start": {"line": 12, "character": 0}, "end": {"line": 18, "character": 1} },
"newText": "func MyFunc() error {\n\treturn nil\n}"
}]
}
}
}
Decision guide
| Situation | Approach |
|---|---|
| Replacing full body | replace_symbol_body (primary path) |
| Changing signature only | Step 1 + apply_edit with one-line old_text |
| Symbol name ambiguous | Use find_symbol query + container name filter |
| Server lacks document symbols | Fallback path (Step 2b + 3b) |
| After edit | Run get_diagnostics to verify no errors introduced |
Notes
replace_symbol_bodyis the preferred path for full-body replacements. It handles symbol resolution and range calculation internally.find_symbolreturns declaration sites, not all references. The first non-test result is usually the definition.- Positions in
list_symbolsare 1-based (shifted from LSP convention).apply_editworkspace_editexpects 0-based; subtract 1 when using positional mode (Option B). Text-match mode (Option A) requires no position math. - For renames (not edits), use
/lsp-renameinstead; it updates all call sites.
GitHub リポジトリ
関連スキル
llamaguard
その他LlamaGuardは、暴力やヘイトスピーチなど6つの安全性カテゴリーにおいて、LLMの入力と出力をモデレートするMetaの70-80億パラメータモデルです。94〜95%の精度を提供し、vLLM、Hugging Face、Amazon SageMakerを使用してデプロイ可能です。このスキルを使用して、AIアプリケーションにコンテンツフィルタリングと安全策を簡単に統合できます。
cost-optimization
その他このClaudeスキルは、リソースの適正サイジング、タグ付け戦略、支出分析を通じて、開発者がクラウドコストを最適化することを支援します。AWS、Azure、GCPにわたるクラウド支出の削減とコストガバナンスの実施のためのフレームワークを提供します。インフラコストの分析、リソースの適正サイジング、または予算制約への対応が必要な際にご利用ください。
quantizing-models-bitsandbytes
その他このスキルは、bitsandbytesを使用してLLMを8ビットまたは4ビット精度に量子化し、精度の低下を最小限に抑えつつ50〜75%のメモリ削減を実現します。限られたGPUメモリでより大規模なモデルを実行したり、推論を高速化するのに理想的で、INT8、NF4、FP4などのフォーマットをサポートしています。HuggingFace Transformersと統合され、QLoRAトレーニングや8ビットオプティマイザーを可能にします。
dispatching-parallel-agents
その他このClaudeスキルは、複数のエージェントを配備し、3つ以上の独立した問題を並行して調査・修正します。共有状態や依存関係がなく解決可能な、無関係な障害が発生するシナリオ向けに設計されています。中核となる機能は並列問題解決であり、効率を最大化するために独立した問題領域ごとに1つのエージェントを割り当てます。
