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


