Execute behavior-preserving code restructuring — establish a test safety net first, apply the smallest mechanical transformations in sequence, verify after each, and refuse refactors that lack the coverage to be done safely. Trigger this when the user asks to "refactor", "clean up", "simplify", "restructure", "extract", or "rename" existing working code, or when you initiate a structural improvement yourself. Do NOT trigger for changes meant to alter behavior (that's a feature/fix — use task-planning), or for diagnosing why code is broken (use debugging-methodology) — a refactor by definition starts from green.
$npx -y skills add unpaidattention/fable5-methodology --skill safe-refactoringInstalls into the current project.
Run `npx skills use "https://github.com/unpaidattention/fable5-methodology" --skill "unpaidattention/fable5-methodology/safe-refactoring"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/unpaidattention/fable5-methodology" that are relevant to the current task. Run `npx skills add "https://github.com/unpaidattention/fable5-methodology"` and select the relevant skills, then follow their instructions.