MCP HubMCP Hub
SKILL·5D47F3

lsp-rename

blackwell-systems
업데이트됨 2 months ago
9 조회
116
7
116
GitHub에서 보기
기타general

정보

이 Claude Skill은 Language Server Protocol(LSP)를 통해 작업 공간 전체에서 코드 심볼을 안전하게 이름 변경합니다. 실행 전에 영향을 받는 모든 참조를 미리 보여주어 확인을 거친 후, 원자적으로 이름 변경 작업을 수행합니다. 프로젝트 전체에서 식별자, 함수, 타입 또는 변수를 안전하게 이름 변경해야 할 때 사용하세요.

빠른 설치

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

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Requires the agent-lsp MCP server.

lsp-rename: Safe Symbol Rename

Renames a symbol across the workspace in two phases: preview first, then execute only after explicit confirmation. Never renames without showing impact.

Invocation: User provides old_name (the symbol to rename) and new_name (the replacement). 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, but an explicit start is required when switching workspaces.


Phase 1: Preview

Find the symbol, enumerate all references, and produce a dry-run preview. Do not apply any edits in this phase.

Step 1 — Locate the symbol

Call mcp__lsp__go_to_symbol with symbol_path set to old_name:

mcp__lsp__go_to_symbol
  symbol_path: "old_name"        # or "Package.OldName" for qualified paths
  workspace_root: "<root>"       # optional; omit to search entire workspace

This returns the definition location (file, line, column). If not found, report the error and stop.

Step 2 — Validate rename is possible

Call mcp__lsp__prepare_rename at the definition location from Step 1:

mcp__lsp__prepare_rename
  file_path: "<file from Step 1>"
  line: <line from Step 1>
  column: <column from Step 1>

prepare_rename asks the language server whether a rename is valid at this position. If it returns an error (e.g. the symbol is a keyword, a built-in, or in a location the server cannot rename), stop immediately and report:

Cannot rename OldName: <server error message> Common causes: built-in or keyword, imported external package, or position is not on the symbol name. Try locating the declaration site directly.

Only proceed to Step 3 if prepare_rename succeeds.

Step 3 — Enumerate references

Call mcp__lsp__find_references at the definition location from Step 1:

mcp__lsp__find_references
  file_path: "<file from Step 1>"
  position_pattern: "<symbol>@@"   # @@ immediately after the symbol name
  # fallback: use line/column from Step 1 if position_pattern is unavailable

Collect all returned locations. Note the total count and the distinct files.

Step 4 — Dry-run preview

Call mcp__lsp__rename_symbol with dry_run=true. Do not call apply_edit.

mcp__lsp__rename_symbol
  file_path: "<file from Step 1>"
  line: <line from Step 1>
  column: <column from Step 1>
  new_name: "<new_name>"
  dry_run: true

The response includes a workspace_edit with all proposed changes and a preview.note describing the scope.

Step 5 — Report impact and hard stop

Display the preview summary to the user:

Rename preview: OldName -> NewName
  Locations to update: N (from find_references count)
  Files affected:      M (distinct files in workspace_edit)
  Language server:     <gopls | typescript-language-server | rust-analyzer | ...>

Changes:
  path/to/file1.go  lines 12, 45, 78
  path/to/file2.go  line 3
  ...

REQUIRED hard stop — do not proceed without explicit user confirmation:

Proceed with rename? [y/n]

Wait for user input. Do not apply any edit until the user answers "y" or "yes".


Edge Case: 0 References

If find_references returns an empty list (the symbol exists but has no external usages), warn the user before stopping:

Warning: no references found for OldName. The symbol may be unexported, dead code, or the LSP index may be stale. Renaming will update only the declaration site. Proceed anyway? [y/n]

If user answers "n", stop. If "y", continue to Phase 2.


Phase 2: Execute

Only enter this phase after the user answers "y" or "yes" to the confirmation prompt in Phase 1.

Step 1 — Capture pre-rename diagnostics

Before applying changes, capture the current diagnostic state:

mcp__lsp__get_diagnostics
  file_path: "<one or more files in the workspace_edit>"

Store the result as before_diagnostics.

Step 2 — Execute rename

Call mcp__lsp__rename_symbol without dry_run (or with dry_run=false):

mcp__lsp__rename_symbol
  file_path: "<file from Phase 1 Step 1>"
  line: <line from Phase 1 Step 1>
  column: <column from Phase 1 Step 1>
  new_name: "<new_name>"

This returns a workspace_edit with the full set of changes.

Step 3 — Apply the edit

Call mcp__lsp__apply_edit with the workspace_edit from Step 2:

mcp__lsp__apply_edit
  workspace_edit: <workspace_edit from rename_symbol>

Step 4 — Check diagnostics

Call mcp__lsp__get_diagnostics on the affected files and compare against before_diagnostics:

mcp__lsp__get_diagnostics
  file_path: "<affected files>"

Compute introduced vs. resolved errors and display the Diagnostic Summary (see references/patterns.md).


Output Format

After Phase 2 completes, display:

## Rename Summary
- Old name: OldName
- New name: NewName
- Files changed: M
- Locations updated: N
- Post-rename errors: 0

Follow with the Diagnostic Summary if any errors changed (format in references/patterns.md).

Only show Diagnostic Summary sections where N > 0. A net change of 0 means the rename is safe.


Language Support

Tested with gopls, typescript-language-server, and rust-analyzer. Most LSP-compliant servers support textDocument/rename — agent-lsp works with any of the 30+ supported language servers that advertise rename capability. Check your server's capability list via mcp__lsp__get_server_capabilities if you are unsure.

GitHub 저장소

blackwell-systems/agent-lsp
경로: skills/lsp-rename
0
agentskillsai-agentsai-toolingclaudeclaude-codecode-intelligence
FAQ

자주 묻는 질문

lsp-rename Skill이란 무엇인가요?

lsp-rename은(는) blackwell-systems이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 lsp-rename 관련 작업을 수행할 수 있게 합니다.

lsp-rename은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. lsp-rename을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

lsp-rename은(는) 어떤 카테고리에 속하나요?

lsp-rename은(는) 기타 카테고리에 속합니다.

lsp-rename은(는) 무료로 사용할 수 있나요?

네. lsp-rename은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

llamaguard
기타

LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.

스킬 보기
cost-optimization
기타

이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.

스킬 보기
sports-betting-analyzer
기타

이 Claude Skill은 스프레드, 오버/언더, 프로프 베트를 포함한 스포츠 베팅 시장을 분석합니다. 역사적 추이와 상황별 통계를 검토하여 가치 베트를 발견하고, 교육적 목적으로 실행 가능한 권장 사항이 담긴 구조화된 마크다운 결과를 제공합니다. 개발자는 이 기능을 스포츠 베팅 분석 도구에 활용할 수 있으며, 단순히 엔터테인먼트/교육 목적으로만 설계되었음을 유의해야 합니다.

스킬 보기
quantizing-models-bitsandbytes
기타

이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.

스킬 보기