← ClaudeAtlas

god-module-decompositionlisted

Extract and decompose a "god module" (single file >1000 LOC with 5+ unrelated responsibilities) using the Strangler Fig protocol. Produces new modules in target package, a thin re-export shim of the original, per-step atomic commits, and updated imports across the codebase. Use for monolithic files blocking modernization.
osrt91/ulak.os · ★ 2 · AI & Automation · score 74
Install: claude install-skill osrt91/ulak.os
# God Module Decomposition (Strangler Fig Executor) ## Goal Safely decompose a single-file monolith into a multi-module package without a big-bang rewrite, using the Strangler Fig pattern documented in `docs/runtime/strangler-fig-protocol.md`. ## When to use Invoke when `inventory.md` or an anti-patterns match flags a "God module (>1000 LOC)" finding. Representative example: `.py` (146KB, 15+ responsibilities) decomposed to a 73-line shim backed by `app/main.py` + `app/routers/*.py`. ## Inputs - `source_file` — absolute path to the monolith (e.g., `C:/Users/osrt91/desktop/proje/<project>/.py`) - `target_package` — destination package name (e.g., `app`) - `extraction_plan` — YAML document listing phases A/B/C/D with: - `phase_id` — A / B / C / D - `step_id` — A.1 / A.2 /... within phase - `source_line_range` — lines in the monolith to move - `target_module` — destination path (e.g., `app/services/scoring.py`) - `dependencies` — prior step_ids this depends on - `test_command` — command to run after each step (e.g., `pytest tests/`) ## Outputs - New package directory with extracted modules - Original file rewritten as a thin re-export shim - Per-step atomic commits with descriptive messages - Updated imports across the consumer codebase - Optional: `reports/current/god-module-decomposition-log.md` — step-by-step log ## Process (per step) For every step in `extraction_plan`, execute six moves in order: 1. **Create** the new module at `target_module` with the extra