sl:refactor

Automate semantic refactoring across workspaces using AST-grep patterns and LSP.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/HuynhHoangPhuc/solon --skill sl-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sl:refactor
Source: https://github.com/HuynhHoangPhuc/solon/tree/main/plugins/solon-core/skills/refactor
Command: npx skills add https://github.com/HuynhHoangPhuc/solon --skill sl-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Semantic refactoring of code across a workspace using AST-grep patterns and LSP to ensure safe, type-aware transformations.

Core Features & Use Cases

  • Orchestrates solon core tools for safe semantic code transformations, enabling renames, structural transforms, and API migrations across the workspace.
  • Provides deterministic searches and pattern-based transforms via AST-grep with type-checking guided by LSP.
  • Supports a workflow: scope, analyze, transform, verify, and report for end-to-end refactoring.

Quick Start

Invoke the sl:refactor skill with a target and a mode flag to perform a workspace-wide semantic refactor.

Frequently Asked Questions about sl:refactor

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

FAQPage Schema
How do I perform a semantic API migration across multiple files in a large codebase?

Workspace-wide semantic refactoring uses AST-grep for deterministic pattern matching and LSP for type-aware verification. This combination ensures safe, structural code transformations across multiple files and languages within your workspace.

What is the best way to automate code transformations without breaking type safety?

Automating code transformations while maintaining type safety requires combining AST-grep for deterministic structural changes with LSP intelligence for type-aware verification. This approach validates transformations before applying them across the workspace.

Does AST-grep work with LSP for workspace-wide refactoring?

AST-grep works with LSP for workspace-wide refactoring by using AST-grep for deterministic search and structural transforms, while LSP provides type-aware verification. This combination supports safe semantic refactoring across multiple files and languages.

How do I start a guided refactoring workflow for structural code transforms?

Start a guided refactoring workflow by invoking the refactor skill with a target and mode flag. The workflow guides you end-to-end through scope, analyze, transform, verify, and report stages to ensure safe semantic transformations.

Can I use semantic refactoring tools for renaming variables across different programming languages?

Semantic refactoring for renaming variables across different programming languages is supported through AST-grep patterns and LSP intelligence. This enables safe, type-aware renames across multiple files and languages supported by both tools.