Refactoring Assistant for Openclaw

An automated refactoring assistant designed to perform safe code transformations and detect technical debt within your project.

michealxie001
v1.0.0
Apr 1, 2026
0
667
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openclaw-refactoring

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openclaw-refactoring using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Refactoring Assistant?

The Refactoring Assistant is a specialized tool within the Openclaw Skills ecosystem that automates the tedious and often risky process of code restructuring. It enables developers to execute complex operations—such as renaming symbols, extracting methods, and moving code blocks—with confidence by handling scope resolution and reference updates automatically. By integrating this skill into your workflow, you can maintain a cleaner codebase and adhere to best practices without the manual overhead typically associated with structural changes.

Refactoring Assistant Use Cases

  • Cleaning up legacy code by renaming poorly named variables and functions project-wide.
  • Extracting repeating logic into modular helper methods to improve maintainability.
  • Moving utility functions from bloated files into dedicated helper modules.
  • Migrating from old APIs to new ones using regex-based batch renaming.
  • Auditing codebases for technical debt such as long methods or duplicate code blocks.

How Refactoring Assistant Works

  1. The tool scans the target directory to map symbols, scopes, and references within the source code.
  2. Users initiate a refactoring command (e.g., rename, extract, or move) targeting specific symbols or line ranges.
  3. The skill performs a static analysis to identify all affected files and ensure the transformation preserves code logic.
  4. A preview is generated via dry-run mode to show planned changes before any files are modified.
  5. Upon confirmation, a timestamped backup is created in the .refactoring folder and the transformations are applied across the codebase.

Refactoring Assistant Setup

To begin using this skill within your development environment, follow these steps:

# Navigate to your project directory
cd your-project-path

# Run the tool to see suggested improvements
python3 scripts/main.py suggest src/

# Configure custom rules by creating a .refactoring.json file

Refactoring Assistant Data Schema & Taxonomy

The Refactoring Assistant organizes its operations through configuration files and safety backups as detailed below:

Item Description
.refactoring.json Main configuration file for setting ignore patterns, backup toggles, and complexity rules.
.refactoring/backup/ Directory containing timestamped subfolders with original file states (e.g., .bak files).
scripts/ Contains the core engines for renaming, extraction, and code smell analysis.
SKILL.md The definition file used by Openclaw Skills to manage the tool's capabilities.

Refactoring Assistant Advanced Features

  • Dry-run functionality allows developers to preview every file change and diff before execution.
  • Multi-level undo support enables quick recovery by restoring code from timestamped backups.
  • Batch operations support regular expressions for massive symbol migrations across large repositories.
  • Intelligent code smell detection flags long methods, large classes, and feature envy automatically.
  • Git integration support allows for automatic stashing and clean commit history during refactoring cycles.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*