<< All versions
Skill v1.0.0
currentAutomated scan100/100baliaga-repo/vibe-tools/modular-refactor
──Details
PublishedOctober 25, 2026 at 08:38 AM
Content Hashsha256:2c99832891973918...
Git SHA0fd5d4bf4381
──Files
Files (1 file, 1.3 KB)
SKILL.md1.3 KBactive
SKILL.md · 21 lines · 1.3 KB
version: "1.0.0" name: modular-refactor description: Step-by-step procedure and strategies for incremental Python refactoring to break monolithic scripts into clean, modular, token-efficient, and backwards-compatible (zero-regression) architectures. Activate when handling long files (>300 lines) or upon refactoring requests.
Skill: Modular Refactor
Decompose monolithic Python scripts into clean, modular, and token-efficient architectures.
Core Principles
- Zero Regression: Preserve original entry points (batch scripts, CLI, Resolve shortcuts).
- Facade Pattern: Re-export relocated functions/classes in the legacy file (
from module import symbol) for backwards compatibility. - Incremental: Migrate one boundary/domain at a time.
Workflow
- Dependency Mapping: Check call graphs using
graphify query "function dependencies in <file>". Identify constants, pure utilities, side-effects, and entry points. - Package Scaffolding: Create package folder with
__init__.pyand dedicated submodules (config.py,bridge.py,processor.py,handlers.py). - Extract & Facade: Move logic to submodules, add Indonesian docstrings/type hints, and re-export symbols in legacy file.
- Graphify Refresh: Run
graphify extract . --code-onlyand notify user.