tug-refactor

Renames symbols and updates references across Python codebases using tug tool.

40|2|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/tugtool/tugtool --skill tug-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tug-refactor
Source: https://github.com/tugtool/tugtool/tree/main/.claude/skills/tug-refactor
Command: npx skills add https://github.com/tugtool/tugtool --skill tug-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables semantic refactoring of Python codebases by safely renaming symbols across multiple files while updating all references with correct scoping.

Core Features & Use Cases

  • Multi-file symbol renaming: Update functions, classes, methods, and variables across a codebase with reference integrity.
  • Context-aware updates: Preserve imports, inheritance, and scope so changes remain correct.
  • Deterministic workflow: Provides verified, minimal-diff changes before applying modifications.

Quick Start

Use tug to analyze and then apply a rename across a Python project, for example renaming the function process_data to transform_data.

Frequently Asked Questions about tug-refactor

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

FAQPage Schema
How do I rename a Python function across multiple files and update all references?

To rename a Python function across multiple files, you need a semantic refactoring tool that identifies all references and updates them with correct scoping, preserving imports and inheritance. This ensures changes remain deterministic and verified before applying modifications.

What is semantic refactoring for Python codebases?

Semantic refactoring for Python is the process of renaming symbols like functions, classes, methods, or variables while maintaining scope and import integrity. It provides context-aware updates to ensure the codebase remains functionally correct after modifications are applied.

Can I safely rename Python class methods across a large project without breaking imports?

Yes, you can safely rename Python class methods across a large project by performing context-aware updates that preserve imports, inheritance, and scope. The tool delivers minimal-diff changes and verifies reference integrity before applying the modifications.

What's the best way to preview variable renaming changes before applying them to a Python project?

The best way to preview variable renaming changes is to use a deterministic workflow that provides pre-apply analysis and safe diffs. This allows you to review verified, minimal-diff changes to your Python project before committing any modifications.

Do I need the Tug tool to perform multi-file symbol renaming in Python?

Yes, you need the Tug tool and a Python project context to perform multi-file symbol renaming. It uses the tool to analyze and apply deterministic, verified changes across your codebase, ensuring reference integrity and correct scoping throughout the process.