lsp-refactor

Automates end-to-end safe refactoring of codebases using LSP tooling.

102|5|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/blackwell-systems/agent-lsp --skill lsp-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lsp-refactor
Source: https://github.com/blackwell-systems/agent-lsp/tree/main/skills/lsp-refactor
Command: npx skills add https://github.com/blackwell-systems/agent-lsp --skill lsp-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

End-to-end safe refactor workflow. Sequences blast-radius analysis, speculative preview, apply to disk, verify build, and run affected tests. The workflow inlines lsp-impact + lsp-safe-edit + lsp-verify + lsp-test-correlation into one coordinated sequence.

Core Features & Use Cases

  • End-to-end refactor orchestration across files and tests.
  • Blast-radius analysis to surface impact before edits.
  • Speculative preview to validate changes with diagnostics.

Quick Start

Begin a safe refactor by specifying the target symbol or file and your intended change, and let the workflow execute the full blast-radius, speculative preview, apply, build, and test phases.

Frequently Asked Questions about lsp-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate safe refactoring across multiple files using LSP?

LSP refactoring automates safe code transformations by coordinating blast-radius analysis, speculative preview, apply-to-disk edits, build verification, and targeted test execution across multi-file changes. It enforces safe-change gates to prevent breaking modifications.

What is blast-radius analysis in code refactoring and when do I need it?

Blast-radius analysis in code refactoring surfaces the full impact of a symbol change before edits are applied. You need it when modifying shared code to prevent unexpected build failures or test regressions across dependent files.

How do I verify code changes and run affected tests after a refactor?

To verify code changes after a refactor, the workflow sequences build verification and targeted test execution. It correlates tests with the modified symbols to run only the affected suite, ensuring safe modifications.

Can I preview diagnostics before applying LSP edits to disk?

Yes, you can preview diagnostics before applying LSP edits to disk. The workflow uses a speculative preview phase to validate proposed transformations and check for errors before committing any changes to the file system.

Does multi-file refactoring work without manual build and test checks?

Multi-file refactoring works without manual checks by enforcing safe-change gates automatically. The workflow inline coordinates impact analysis, edits, build verification, and test correlation, eliminating the need for manual validation steps.

What are the limitations of automating codebase refactoring with LSP tooling?

The limitation of automating codebase refactoring with LSP tooling is that transformations rely on the agent-lsp MCP server to perform controlled edits. Refactoring outside the LSP protocol's semantic understanding may not trigger the safe-change gates correctly.