技能 编程开发 安全代码重构与行为保持

安全代码重构与行为保持

v20260905
safe-refactor
这是一种系统化的代码重构方法论,旨在结构性地优化代码,同时严格保证其外部行为和功能不变。它指导开发者进行渐进式的重构,适用于大规模的代码提取、逻辑整合或所有权迁移等场景,强调在每次结构修改后都必须进行充分的验证和测试。
获取技能
267 次下载
概览

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.

信息
Category 编程开发
Name safe-refactor
版本 v20260905
大小 817B
更新时间 2026-09-06
语言