Agent skill

Lsp Refactoring

by ArabelaTso in ArabelaTso/Skills-4-SE

Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification.

Apache-2.0Auto-check passedDevelopment

Install Lsp Refactoring

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill lsp-refactoring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE lsp-refactoring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lsp-refactoring .claude/skills/lsp-refactoring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lsp-refactoring
GitHub stars
253
Token cost
~1.1k tokens
SKILL.md length
413 words
Files
1
Skills in repo
170
Repo updated
First seen
Licence
Apache-2.0

At a glance

Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification.

  • Works in 4 steps: Analysis — Understand Before Changing → Plan — Design the Transformation → Execute — Apply Changes Safely → …
  • Large-scale refactoring with precision
  • SKILL.md covers When to Use This Skill, What This Skill Does, Approach by Language and Anti-Patterns, plus 1 more section
  • Calls git, go and tsc

What it does

Lsp Refactoring is an agent skill from ArabelaTso/Skills-4-SE. Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification. Use for safe, large-scale refactoring with precision.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring, Codebase onboarding and Test-driven development. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Large-scale refactoring with precision
  • Tasks that involve Refactoring
  • Tasks that involve Codebase onboarding

Example prompts

  • “/lsp-refactoring”

Requirements

  • Python 3
  • Node.js

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Analysis — Understand Before Changing
  2. Plan — Design the Transformation
  3. Execute — Apply Changes Safely
  4. Verify — TDD Confirmation

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • go
    • tsc
    • npx
    • mypy
    • cargo
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Lsp Refactoring loads about 1.1k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 413 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 413 words, ~1,068 tokens.

Download SKILL.mdSave it as .claude/skills/lsp-refactoring/SKILL.md (or your agent's skills folder).
name
lsp-refactoring
description
Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification. Use for safe, large-scale refactoring with precision.

LSP Refactoring

Refactoring workflow that combines language server capabilities with code search and test-driven verification for safe, precise code transformations.

When to Use This Skill

  • Renaming symbols across an entire workspace
  • Extracting functions, classes, or modules
  • Moving code between files with automatic reference updates
  • Large-scale pattern-based code transformations
  • Any refactoring where manual find-replace is error-prone

What This Skill Does

Phase 1: Analysis — Understand Before Changing
  1. Scope assessment: Find all usages of the target symbol using grep or IDE references
  2. Dependency graph: Trace where the symbol is defined and what depends on it
  3. Impact analysis: Identify all files that will be affected
  4. Pattern discovery: Search for similar patterns that should be refactored consistently
bash
# Find all usages of a function
grep -rn "getUserData" src/ --include="*.ts"

# Find pattern across codebase with AST-aware tools (if available)
# e.g., ast-grep, semgrep, or comby
ast-grep --pattern 'console.log($MSG)' --lang typescript
Phase 2: Plan — Design the Transformation
  1. Pre-flight check: Run the type checker / linter to capture baseline errors
  2. Rename validation: Verify the symbol can be safely renamed (no conflicts)
  3. Transformation plan: List each change with file, line, before/after
  4. Test identification: Find tests covering the code being refactored
Phase 3: Execute — Apply Changes Safely

For renames (use IDE/editor capabilities when available):

bash
# Using sed for simple renames
find src/ -name "*.ts" -exec sed -i '' 's/getUserData/fetchUserProfile/g' {} +

# Or use language-specific tools
# TypeScript: ts-morph, jscodeshift
# Python: rope, bowler
# Go: gorename

For pattern-based transformations:

bash
# Using ast-grep (if installed)
ast-grep --pattern 'console.log($MSG)' --rewrite 'logger.info($MSG)' --lang typescript

# Using comby
comby 'console.log(:[msg])' 'logger.info(:[msg])' .ts

For structural changes (extract/move):

  1. Create the new target (file, function, class)
  2. Move the code
  3. Update all references using LSP rename
  4. Remove the old code
  5. Verify no dangling references
Phase 4: Verify — TDD Confirmation
  1. Type check: Run the project type checker — must be clean
    bash
    npx tsc --noEmit          # TypeScript
    mypy src/                  # Python
    go vet ./...               # Go
  2. Build check: Run project build — must pass
  3. Test check: Run test suite — all previously passing tests must still pass
  4. Diff review: git diff to review the complete changes for unintended modifications

If any check fails:

  • Revert changes: git checkout -- .
  • Analyze the failure
  • Adjust approach and retry
Show full SKILL.md (133 more words)Show less

Approach by Language

LanguageRename ToolPattern SearchType Check
TypeScriptts-morph, jscodeshiftast-grep, semgreptsc --noEmit
Pythonrope, bowlerast-grep, semgrepmypy, pyright
Gogorename, goplsast-grep, semgrepgo vet
JavaIntelliJ refactor, openrewritesemgrepjavac
Rustrust-analyzerast-grepcargo check

Anti-Patterns

  • Manual find-replace without verifying all references — misses dynamic usages
  • Skipping type check after rename — may introduce type errors
  • Not running tests after refactoring — behavior may have changed
  • Refactoring while fixing bugs — do one or the other, never both

Example

User: "Rename getUserData to fetchUserProfile across the project"

Output:

  1. grep -rn finds 23 usages across 8 files
  2. Applies rename using sed/jscodeshift across all locations
  3. tsc --noEmit passes with no errors
  4. npm test — 47 tests pass
  5. git diff shows clean, focused changes

Inspired by: oh-my-opencode /refactor command

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/lsp-refactoring of ArabelaTso/Skills-4-SE.

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Lsp Refactoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lsp Refactoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lsp Refactoring this skillArabelaTso/Skills-4-SE253—~1.1kAutomated safety check: PassApache-2.0
Devnpc-live/clawfirm156—~642Automated safety check: PassNone
Solidramziddin/solid-skills606—~2.7kAutomated safety check: PassNone
Ast GrepBiFangKNT/mtga1.2k—~802Automated safety check: PassAGPL-3.0
Lsp Code Analysislsp-client/lsp-skill118—~3kAutomated safety check: PassMIT
Gograph Go Repository Intelligenceozgurcd/gograph228—~4.8kAutomated safety check: NotesMIT

Similar skills

  • Dev

    npc-live/clawfirm

    Software development workflow dispatcher. An agent skill from npc-live/clawfirm.

    156 GitHub stars~642 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Solid

    ramziddin/solid-skills

    A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.

    606 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Ast Grep

    BiFangKNT/mtga

    Write and debug ast-grep rules for structural code search and rewrite.

    1.2k GitHub stars~802 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Lsp Code Analysis

    lsp-client/lsp-skill

    Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill.

    118 GitHub stars~3k tokensUpdated 8 mo ago
    DevelopmentAuto-check passed
  • Gives an agent working in a Go codebase a structural view through a local MCP server: call graphs, blast-radius and impact analysis, and bounded first-call exploration.

    228 GitHub stars~4.8k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Skill Writing

    millionco/expect

    Write and improve agent skills (SKILL.md files). An agent skill from millionco/expect.

    3.6k GitHub stars~1.8k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed

More from ArabelaTso/Skills-4-SE

All 170 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Lsp Refactoring

What does Lsp Refactoring do?

Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification. Lsp Refactoring is an agent skill from ArabelaTso/Skills-4-SE. Intelligent code refactoring using IDE-level tools (rename, find-references, go-to-definition), AST-aware pattern matching, and TDD verification.

When should I use Lsp Refactoring?

Lsp Refactoring fits situations like: large-scale refactoring with precision; tasks that involve Refactoring; tasks that involve Codebase onboarding.

How do I install Lsp Refactoring in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill lsp-refactoring -a claude-code`. Or copy the skill folder (skills/lsp-refactoring in ArabelaTso/Skills-4-SE) into .claude/skills/lsp-refactoring in your project. Claude Code loads it when a task matches its description.

How do I install Lsp Refactoring in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill lsp-refactoring -a codex`. Or copy the skill folder (skills/lsp-refactoring in ArabelaTso/Skills-4-SE) into .agents/skills/lsp-refactoring in your project. Codex loads it when a task matches its description.

Can I use Lsp Refactoring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill lsp-refactoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lsp-refactoring, .gemini/skills/lsp-refactoring, .github/skills/lsp-refactoring and .opencode/skills/lsp-refactoring in your project.

What does Lsp Refactoring need to run?

Going by SKILL.md and its folder, Lsp Refactoring needs the command-line tools its instructions call (git, go, tsc, npx, mypy and cargo). Our summary lists: Python 3; Node.js.

Does Lsp Refactoring access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Lsp Refactoring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Lsp Refactoring use?

Lsp Refactoring is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lsp Refactoring use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Lsp Refactoring?

Skills that share tags, products or a category with Lsp Refactoring: Dev (npc-live/clawfirm, 156 stars), Solid (ramziddin/solid-skills, 606 stars), Ast Grep (BiFangKNT/mtga, 1.2k stars) and Lsp Code Analysis (lsp-client/lsp-skill, 118 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lsp Refactoring?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 170 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.