# Safe Refactor

> Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

- Skill: `juliusbrussee/safe-refactor` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add juliusbrussee/safe-refactor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/juliusbrussee/safe-refactor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Julius Brussee (https://skillmd.com/u/juliusbrussee)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/juliusbrussee/safe-refactor

---


# Safe refactor

Define behavior-preservation boundary and establish verification before structural edits.

- Keep feature changes outside refactor.
- Move one ownership boundary at a time.
- Preserve public interfaces, failure behavior, ordering, and compatibility unless explicitly scoped.
- Keep intermediate states buildable and testable.
- Avoid dependency or configuration growth without correctness need.

Run same proof after change. Stop when behavior matches and requested structure is achieved.

