Safe Refactor safe-refactor

Restructure code while preserving behavior.

Use it when extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

Works in Claude, ChatGPT, Codex and more
Our test
7/10✓ Verified
tested Dec 6, 2026
GitHub stars
125k
juliusbrussee/caveman
Added by
0
members
Updated
Dec 6
commit c1b12c1
Content
2 files
no scripts · 1 KB
License
Apache 2.0
free to use

What our test found

Le skill donne des garde-fous clairs et directement applicables pour refactorer sans changement fonctionnel, mais reste général sur le choix des tests et la comparaison des comportements.

Request we tested it on“I want to extract input validation from a module into a new file without changing behavior. How should I proceed?”

Limits spotted

  • Does not specify how to establish a baseline when test coverage is low.
  • Does not propose a method for verifying behaviors that are difficult to test automatically.
View on GitHub ↗
name: safe-refactor
description: 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.