refactor-executor

Analyze large Python modules and extract functions and classes into libraries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ribatshepo/cc-auto-orchestrate --skill refactor-executor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-executor
Source: https://github.com/ribatshepo/cc-auto-orchestrate/tree/main/claude-code/skills/refactor-executor
Command: npx skills add https://github.com/ribatshepo/cc-auto-orchestrate --skill refactor-executor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires layer0, layer1, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of refactoring large Python scripts into modular, reusable libraries by analyzing code structure, identifying natural boundaries, and planning extraction points.

Core Features & Use Cases

  • Size Analysis: Identify oversized modules for potential splitting.
  • Function Extraction: Group related functions for extraction.
  • Dependency Mapping: Track dependencies among extracted items.
  • Module Creation: Create new library modules with extracted functions and classes.
  • Source Update: Update original scripts to source new libraries and adjust imports.
  • Use Case: When a monolithic script becomes hard to maintain, run this Skill to generate modular libraries and update references accordingly.

Quick Start

Split a large Python script into modular libraries by analyzing it and extracting functions and classes.

Frequently Asked Questions about refactor-executor

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

FAQPage Schema
How do I split a large Python script into modular libraries?

To split a large Python script into modular libraries, you analyze the code structure to identify natural boundaries, extract related functions and classes, generate new library modules, and update the original source imports.

When should I refactor a monolithic Python file into separate modules?

You should refactor a monolithic Python file into separate modules when the script exceeds maintainable size thresholds, becomes difficult to manage, and requires function extraction with dependency tracking to improve code reusability.

How does dependency mapping work when extracting functions during Python refactoring?

Dependency mapping during Python refactoring works by analyzing code structure to track relationships among extracted items, ensuring that when functions and classes move to new library modules, all import references and dependencies are correctly updated.

Can I plan extraction boundaries before splitting a Python module?

Yes, you can plan extraction boundaries before splitting a Python module. The refactoring process includes optional boundary planning and safety checks to identify natural split points and group related functions securely before generating libraries.

What is the best way to update source imports after extracting Python classes?

The best way to update source imports after extracting Python classes is to automate the source update process, which adjusts the original scripts to source the new libraries and automatically corrects all import paths and dependency references.

Does Python refactoring with function extraction handle safety checks for dependency updates?

Yes, Python refactoring with function extraction handles safety checks for dependency updates. It applies safety checks during the modularization process to ensure source updates and library generation maintain code integrity and correct import paths.