lsp-refactor
End-to-end safe refactor workflow — blast-radius analysis, speculative preview, apply to disk, verify build, run affected tests.
Skill by blackwell-systems
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/blackwell-systems-lsp-refactor
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/lsp-refactor
Tools it pre-approves 13
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
mcp__lsp__blast_radiusmcp__lsp__preview_editmcp__lsp__simulate_chainmcp__lsp__get_diagnosticsmcp__lsp__run_buildmcp__lsp__run_testsmcp__lsp__get_tests_for_filemcp__lsp__apply_editmcp__lsp__replace_symbol_bodymcp__lsp__open_documentmcp__lsp__format_documentEdit
Show 1 more
Write
What's inside
- Skill name
lsp-refactor- Description
- End-to-end safe refactor workflow — blast-radius analysis, speculative preview, apply to disk, verify build, run affected tests. Inlines lsp-impact + lsp-safe-edit + lsp-verify + lsp-test-correlation into one coordinated sequence.
- License
- MIT
- Compatibility
- Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
- Allowed tools
- mcp__lsp__blast_radius, mcp__lsp__preview_edit, mcp__lsp__simulate_chain, mcp__lsp__get_diagnostics, mcp__lsp__run_build, mcp__lsp__run_tests, mcp__lsp__get_tests_for_file, mcp__lsp__apply_edit, mcp__lsp__replace_symbol_body, mcp__lsp__open_document, mcp__lsp__format_document, Edit, Write
- Metadata
- optional-capabilities: documentFormattingProvider · required-capabilities: referencesProvider
- Instructions
- 302 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- patterns.md · references/
SKILL.md (first lines)
> Requires the agent-lsp MCP server.
# lsp-refactor
End-to-end safe refactor workflow. Sequences blast-radius analysis, speculative
preview, disk apply, build verification, and targeted test execution in one
coordinated pass.
**This skill does NOT replace lsp-safe-edit or lsp-impact.**
- `lsp-safe-edit` wraps a single edit with before/after diagnostic comparison —
use it when you need to make one targeted change with careful error diffing.
- `lsp-impact` is read-only blast-radius analysis — use it when you want to
understand scope before deciding whether to proceed.
- `lsp-refactor` sequences ALL four workflows (lsp-impact → lsp-safe-edit →
lsp-verify → lsp-test-correlation) in order. Use it when you know your target
and intent up front and want the complete workflow without switching skills.
---
## Input
- **target**: symbol name in dot notation (e.g. `"codec.Encode"`, `"Buffer.Reset"`)
OR file path (e.g. `"internal/lsp/client.go"`)
- **intent**: description of the change to make (e.g. "rename to ParseConfigV2",
"add a second parameter `timeout time.Duration`")
- **workspace_root**: absolute path to the workspace root
---
## Phase 1 — Blast-Radius Analysis (inlined from lsp-impact)
**This phase is mandatory. Do not skip it, even for "small" refactors.**
Call `mcp__lsp__blast_radius` with `changed_files` set to the file
containing the target symbol. If the user provided a file path directly, use it.
If the user provided a symbol name, resolve the file first (e.g. via
`mcp__lsp__go_to_symbol`).
```
mcp__lsp__blast_radius({
"changed_files": ["/abs/path/to/file"],
"include_transitive": false
})
```
Returns:
- `affected_symbols` — exported symbols with reference counts
- `test_callers` — test files and enclosing test function names
- `non_test_callers` — production call sites
**Display:**
- Affected symbol count
- Test callers (each with enclosing test function name)
- Non-test callers (each with file:line)
- Total reference count
**High blast-radius gate:** If the total reference count exceeds 20, STOP and
ask the user to confirm before continuing:
```
High blast radius: N callers found. Proceed with refactor? [y/n]
```
If the user answers "n", abort. Do not proceed to Phase 2.
---
## Phase 2 — Speculative Preview (inlined from lsp-safe-edit)
Only reached if Phase 1 blast radius is acceptable (≤ 20 callers, or user confirmed).
### 2a — Open file and capture baseline diagnostics
```
mcp__lsp__open_document({ "file_path": "/abs/path/to/file", "language_id": "go" })
mcp__lsp__get_diagnostics({ "file_path": "/abs/path/to/file" })
```
Store baseline diagnostics as BEFORE.
### 2b — Speculative simulation
For a **single-file change**: use `preview_edit`:
```
mcp__lsp__preview_edit({
"file_path": "/abs/path/to/file",
"start_line": <N>,
"start_column": <col>,
"end_line": <N>,
"end_column": <col>,
"new_text": "<replacement text>"
})
```
For a **multi-file change** (e.g. rename + call site updates): use `simulate_chain`:
```
mcp__lsp__simulate_chain({
"workspace_root": "/abs/path/to/workspace",
"language": "go",
"edits": [
{
"file_path": "/abs/path/to/file.go",
"start_line": <N>, "start_column": <col>,
"end_line": <N>, "end_column": <col>,
"new_text": "<replacement>"
}
// additional dependent edits ...
]
})
```
### 2c — Evaluate simulation result
Display the speculative result using the Diagnostic Diff Output Format from
[references/patterns.md](references/patterns.md).
**Decision:**From blackwell-systems/agent-lsp, MIT.
More from blackwell-systems/agent-lsp
- 0.791score
lsp-edit-export
blackwell-systems
Safe workflow for editing exported symbols or public APIs.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-understand
blackwell-systems
Deep-dive exploration of unfamiliar code — given a symbol or file, builds a complete Code Map showing type info, implementations, call hierarchy (2-level…
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-simulate
blackwell-systems
Speculative code editing session — simulate changes in memory before touching disk.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-rename
blackwell-systems
Two-phase safe rename across the entire workspace.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-impact
blackwell-systems
Blast-radius analysis for a symbol or file — shows all callers, type supertypes/subtypes, and reference count before you change it.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-dead-code
blackwell-systems
Enumerate exported symbols in a file and surface those with zero references across the workspace.
SkillAFreshness: A★ 164Claude Code +9 - 0.787score
lsp-safe-edit
blackwell-systems
Wrap any code edit with before/after diagnostic comparison.
SkillAFreshness: A★ 164Claude Code +9 - 0.787score
lsp-explore
blackwell-systems
"Tell me about this symbol": hover + implementations + call hierarchy + references in one pass — for navigating unfamiliar code.
SkillAFreshness: A★ 164Claude Code +9 - 0.787score
lsp-extract-function
blackwell-systems
Extract a selected code block into a named function.
SkillAFreshness: A★ 164Claude Code +9 - 0.787score
lsp-fix-all
blackwell-systems
Apply available quick-fix code actions for all current diagnostics in a file, one at a time with re-collection between each fix.
SkillAFreshness: A★ 164Claude Code +9 - 0.787score
lsp-generate
blackwell-systems
Trigger language server code generation — implement interface stubs, generate test skeletons, add missing methods, generate mock types.
SkillAFreshness: A★ 164Claude Code +9 - 0.785score
lsp-implement
blackwell-systems
Find all concrete implementations of an interface or abstract type.
SkillAFreshness: A★ 164Claude Code +9
Signals
- Stars
- 164
- Forks
- 20
- Open issues
- 5
- Contributors
- 9
- Last commit (this folder)
- May 11, 2026 (5 months ago)
- Last release
- Oct 24, 2026 (4 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/blackwell-systems/agent-lsp
- Website
- www.agent-lsp.com/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from blackwell-systems
- 0.791score
lsp-impact
blackwell-systems
Blast-radius analysis for a symbol or file — shows all callers, type supertypes/subtypes, and reference count before you change it.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-simulate
blackwell-systems
Speculative code editing session — simulate changes in memory before touching disk.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-edit-export
blackwell-systems
Safe workflow for editing exported symbols or public APIs.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-dead-code
blackwell-systems
Enumerate exported symbols in a file and surface those with zero references across the workspace.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-rename
blackwell-systems
Two-phase safe rename across the entire workspace.
SkillAFreshness: A★ 164Claude Code +9 - 0.791score
lsp-understand
blackwell-systems
Deep-dive exploration of unfamiliar code — given a symbol or file, builds a complete Code Map showing type info, implementations, call hierarchy (2-level…
SkillAFreshness: A★ 164Claude Code +9
Cite this page
lsp-refactor skill. Agent Mart. https://agentmart.dev/skills/blackwell-systems-lsp-refactor (last updated 2026-10-24)