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 從公開儲存庫中收錄這些內容。

檢舉或申請下架