From act101
Perform semantic code refactoring using AST-aware tools. Use when renaming symbols, extracting functions or variables, inlining code, moving symbols between files, organizing imports, or any code transformation that must update all references. Supports preview mode and undo. Works across TypeScript, Python, Rust, Go, and 14 more languages.
npx claudepluginhub act101-ai/act101 --plugin act101This skill uses the workspace's default tool permissions.
6 MCP refactor tools with preview mode and undo/redo. All tools are tree-sitter based — no LSP required.
Performs safe refactoring: extract functions/components/hooks/modules/classes, rename/move/restructure symbols/files, inline code, detect dead code/smells using test-driven methods.
Provides safe refactoring workflow with trace-mcp: assess change risk, find refactor candidates, check impact, rename symbols across files, and extract functions without missing imports or references.
Executes safe, incremental refactors on files, functions, or projects with test verification per step. Sweep mode targets complexity hotspots; extract mode pulls out methods/classes.
Share bugs, ideas, or general feedback.
6 MCP refactor tools with preview mode and undo/redo. All tools are tree-sitter based — no LSP required.
status()
Rename a symbol and update all references across the codebase.
rename(file="src/user.ts", old_name="getData", new_name="fetchData", preview=true)
Extract a code range into a new named function.
extract_function(file="src/utils.ts", new_name="validateInput", start_line=10, start_column=1, end_line=20, end_column=50, preview=true)
Extract an expression into a named variable.
extract_variable(file="src/calc.ts", new_name="basePrice", start_line=15, start_column=5, end_line=15, end_column=40, preview=true)
Inline a variable or function at all usage sites.
inline(file="src/utils.ts", symbol="tempResult", preview=true)
Move a symbol to a different file, updating all imports.
move_symbol(file="src/models.ts", symbol="UserService", destination="src/services/user.ts", preview=true)
Sort and clean up imports in a file.
import_organize(file="src/main.ts", preview=true)
preview=true (or omit — default is false, so always set it explicitly for safety)FileChange[] arraypreview=falsediagnostics(file="...") to check for introduced errorshistory_undo(preview=true) then history_undo()history_list(limit=10) # See recent operations
history_undo(count=1) # Undo last operation
history_redo(count=1) # Redo undone operation
move_symbol, extract-class, and extract-interface create destination files automatically. Never write a file just so an operation can target it.Complex refactors often require sequences of operations. See compound-sequences.md for patterns like extract-then-rename, move-then-organize, and decompose-god-class.
After structural refactoring (extract class, extract interface), the new type often needs boilerplate. See the code-generation skill for batch generation of constructors, accessors, equals, hash, serialization, and other derived methods.
The act CLI supports ~160 refactor operations beyond the 6 MCP tools (generate-constructor, convert-async, wrap-try-catch, etc). See operation-catalog.md for the complete list organized by category. These are available via the CLI but not yet exposed as individual MCP tools.
See error-recovery.md for handling common failures.