Agent Skills
› JuliusBrussee/caveman
› safe-refactor
safe-refactor
GitHub指导在重构代码时保持行为一致,涵盖提取、合并及所有权迁移等场景。强调先建立验证边界再执行结构修改,确保公共接口和兼容性不变,中间状态可构建测试,最终通过行为匹配确认重构完成。
Trigger Scenarios
需要重构代码结构
进行模块提取或合并
调整代码所有权归属
清理代码但需保证功能不变
Install
npx skills add JuliusBrussee/caveman --skill safe-refactor -g -y
SKILL.md
Frontmatter
{
"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.
Version History
- 12aa8cc Current 2026-08-16 08:55


