Skill / SKILL.md

Refactoring Safely

AnastasiyaW/codex-claude-code-config

Change the structure of code that already exists without changing what it does: smells as triggers, the named transformations (extract/inline, move feature, organise data, simplify conditionals), and above all the workflow that makes it safe — characterization tests first, one transformation at a time, green between every step. Use when a file or function is already too large; when asked to "split this module", "extract this", "break up main.py", "clean up this legacy code", "reduce coupling here"; when asked to remove dead code, stale feature flags or finished experiments; when a shape advisory fires on a grown file; or before any restructuring of code that has users. Do NOT use to decide the target layout of a NEW project (use architecture-first), for unit-level naming and function quality in code you are writing fresh (use code-complexity), for capacity or storage decisions (use system-and-data-design), or to strip over-engineering on request (use lean-code). This is the transformation with a net; deciding WHERE things should end up is a different question, and doing both at once is how refactors lose behaviour.
3 views 218 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Change the structure of code that already exists without changing what it does: smells as triggers, the named transformations (extract/inline, move feature, organise data, simplify conditionals), and above all the workflow that makes it safe — characterization tests first, one transformation at a time, green between every step. Use when a file or function is already too large; when asked to "split this module", "extract this", "break up main.py", "clean up this legacy code", "reduce coupling here"; when asked to remove dead code, stale feature flags or finished experiments; when a shape advisory fires on a grown file; or before any restructuring of code that has users. Do NOT use to decide the target layout of a NEW project (use architecture-first), for unit-level naming and function quality in code you are writing fresh (use code-complexity), for capacity or storage decisions (use system-and-data-design), or to strip over-engineering on request (use lean-code). This is the transformation with a net; deciding WHERE things should end up is a different question, and doing both at once is how refactors lose behaviour.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/AnastasiyaW/codex-claude-code-config' skill-source

Use the complete skill-source/skills/development/refactoring-safely directory with your client’s skill installer.

  • skills/development/refactoring-safely

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/development/refactoring-safely

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Needs source review
Checked at
Pending source check
Content SHA-256
e11ffaa0da2cecc2ad7c9e36eb6fa6871563865f4d7b41fb320990b44f0cd6e2
Format validation findings
  • Invalid or missing description.
Agent Skills specification
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills