mcpField
S
safe-refactor

safe-refactor

github.com/juliusbrusseeDevelopment115.8k109.4k installsUpdated 3d ago
Repository

About safe-refactor

safe-refactor is a coding-agent skill for planning behavior-preserving structural changes. It sets boundaries for refactors and requires the same verification before and after edits.

Key features

  1. 01Define behavior-preservation boundaries
  2. 02Keep feature changes out of refactors
  3. 03Move one ownership boundary at a time
  4. 04Preserve interfaces and failure behavior
  5. 05Keep intermediate states testable
  6. 06Repeat verification after changes

Use cases

  1. 01Plan a refactor without changing features
  2. 02Preserve compatibility during structural edits
  3. 03Verify behavior before and after refactoring

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/juliusbrussee/caveman --skill safe-refactor

After installing, type/safe-refactorin Claude Code to confirm it loaded.

Bundled filesagents/openai.yaml

Details

From the project README

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.

Comments

Markdown supported