# fe-safe-refactor > # When To Use 需要优化前端代码结构,但必须保证 UI 与行为完全一致时。 - Author: Xzc_cccc - Repository: 242282218/xzcccc_smart_media - Version: 20260206000417 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/242282218/xzcccc_smart_media - Web: https://mule.run/skillshub/@@242282218/xzcccc_smart_media~fe-safe-refactor:20260206000417 --- --- name: fe-safe-refactor description: "# When To Use 需要优化前端代码结构,但必须保证 UI 与行为完全一致时。" --- # Description 前端安全重构模式,不改变任何渲染结果与交互行为。 # Instructions 在保证行为一致的前提下进行结构优化。 ## Allowed - 拆分组件 - 抽取 hooks - 重命名(语义等价) # Output Contract - 修改文件列表 - 行为不变说明 # Forbidden - 不改变 UI - 不改变交互 - 不引入新设计