S

safe-refactor

by @juliusbrusseev
4.8(120)

Restructure code while preserving behavior. This skill defines behavior-preservation boundaries and establishes verification before structural edits, supporting extraction, consolidation, ownership moves, and cleanup. It keeps intermediate states buildable and testable, then runs the same proof after changes to ensure behavior matches and the requested structure is achieved, significantly reducing regressions and hidden bugs.

code-refactoringbehavior-preservationverificationrefactoring-safetyGitHub
Installation
npx skills add https://github.com/juliusbrussee/caveman --skill safe-refactor
compare_arrows

Before / After Comparison

1 组
Before

Developers manually refactor without behavioral verification boundaries, often breaking interfaces or ordering, which leads to issues surfacing late and requiring extensive rework and debugging, impacting delivery schedules.

After

This skill establishes verification before structural edits, moves one ownership boundary at a time, and keeps intermediate states testable, ensuring consistent behavior and dramatically cutting rework time while boosting efficiency.

SKILL.md

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.

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs101.6K
Rating4.8 / 5.0
Version
Updated2026年10月22日
Comparisons1

User Rating

4.8(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年8月13日
Last Updated2026年10月22日
🎁 Agent Knowledge Cards
Survey