Safe Refactor

作者 juliusbrussee2e08b9177c07无许可证110K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

AI 生成的概览

指导在结构修改前后进行验证的行为保持型代码重构。

功能
提供一套在保持行为不变的前提下重构代码的工作流程。它让代理先界定行为保持边界,在结构修改前建立验证,一次只移动一个归属边界,并保持中间状态可构建、可测试。它还要求把功能变更排除在重构之外,并在未明确限定范围时保留公共接口、失败行为、顺序和兼容性。
适用场景
适用于通过提取、合并、归属迁移或清理来重构代码,且验证必须包住结构修改的场景。也适用于以保持行为为优先、需要把功能变更分开处理的情况。不适用于新增功能。
运行要求
无需脚本或工具,仅为说明性指令。代理需要访问被重构的代码库,并能运行其现有的构建和测试命令。

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.

来源与署名

来源:juliusbrussee/caveman位于skills/safe-refactor提交2e08b91

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架