S

safe-refactor

by @juliusbrusseev
4.8(120)

在重构代码时确保行为不变。此技能在结构编辑前定义行为保持边界并建立验证机制,支持提取、合并、所有权移动和清理等操作,在每一步保持中间状态可构建可测试,最终运行相同验证确保行为匹配且结构调整达成,有效防止回归和隐藏缺陷。

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

Before / After 效果对比

1 组
使用前

开发者手动重构时缺乏行为验证边界,容易在提取或移动代码时意外改变接口和顺序,导致问题在后续阶段才暴露,不得不花大量时间返工调试,影响交付进度。

使用后

此技能在结构编辑前建立验证机制,逐步移动所有权边界并保持中间状态可测试,重构后行为一致,返工时间大幅缩短,开发效率显著提升。

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.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量101.6K
评分4.8 / 5.0
版本
更新日期2026年10月22日
对比案例1 组

用户评分

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

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年8月13日
最后更新2026年10月22日
🎁 Agent 知识卡片
调研问卷