juliusbrussee/caveman已通过检查
SKILL DETAIL
safe-refactor
juliusbrussee/caveman/safe-refactor
safe-refactor 技能用于在保持行为不变的前提下重构代码。它适用于提取、合并、所有权转移或清理等场景,在这些场景中,验证必须围绕结构编辑进行。该技能强调在结构编辑之前定义行为保持边界并建立验证机制。 使用该技能时,应避免将功能变更混入重构,一次只移动一个所有权边界,保持公共接口、失败行为、顺序和兼容性不变(除非明确调整范围),并确保中间状态可构建、可测试。同时,避免不必要的依赖或配置增长。在变更后运行相同的验证,直到行为匹配且达到所需结构。
安装量 · 987查看来源
Installation
npx skills add https://github.com/juliusbrussee/caveman --skill safe-refactor
技能文件
SKILL.md
最近同步 · 2026年8月29日
agents/openai.yaml›
interface:
display_name: "Safe Refactor"
short_description: "Preserve behavior through structural change"
default_prompt: "Use $safe-refactor to restructure this code while preserving behavior."
SKILL.md›
---
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.