Skills

Behavior-Preserving Refactor

Restructures code and checks behavior before and after each structural edit.

Install

npx skills add JuliusBrussee/caveman --skill safe-refactor -g -a claude-code -y
Repository
JuliusBrussee/caveman117k
Category
Engineering
Updated
3d ago
License
Apache-2.0
Context cost
Lightabout 126 tokens
Runs scripts
No, instructions only

What it does

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

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.

More in Engineering