refactor-plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Refactor Plan

重构计划

Create a detailed plan for this refactoring task.
为本次重构任务创建一份详细计划。

Refactor Goal

重构目标

{{refactor_description}}
{{refactor_description}}

Instructions

操作说明

  1. Search the codebase to understand current state
  2. Identify all affected files and their dependencies
  3. Plan changes in a safe sequence (types first, then implementations, then tests)
  4. Include verification steps between changes
  5. Consider rollback if something fails
  1. 搜索代码库以了解当前状态
  2. 识别所有受影响的文件及其依赖关系
  3. 按安全顺序规划变更(先类型定义,再实现代码,最后测试)
  4. 在各变更阶段之间加入验证步骤
  5. 考虑出现故障时的回滚方案

Output Format

输出格式

markdown
undefined
markdown
undefined

Refactor Plan: [title]

重构计划:[标题]

Current State

当前状态

[Brief description of how things work now]
[对当前工作方式的简要描述]

Target State

目标状态

[Brief description of how things will work after]
[重构完成后工作方式的简要描述]

Affected Files

受影响文件

FileChange TypeDependencies
pathmodify/create/deleteblocks X, blocked by Y
文件变更类型依赖关系
路径修改/创建/删除阻塞X,被Y阻塞

Execution Plan

执行计划

Phase 1: Types and Interfaces

阶段1:类型与接口

  • Step 1.1: [action] in
    file.ts
  • Verify: [how to check it worked]
  • 步骤1.1:在
    file.ts
    中执行[操作]
  • 验证:[验证操作生效的方式]

Phase 2: Implementation

阶段2:代码实现

  • Step 2.1: [action] in
    file.ts
  • Verify: [how to check]
  • 步骤2.1:在
    file.ts
    中执行[操作]
  • 验证:[验证方式]

Phase 3: Tests

阶段3:测试

  • Step 3.1: Update tests in
    file.test.ts
  • Verify: Run
    npm test
  • 步骤3.1:更新
    file.test.ts
    中的测试用例
  • 验证:运行
    npm test

Phase 4: Cleanup

阶段4:清理

  • Remove deprecated code
  • Update documentation
  • 移除已废弃代码
  • 更新文档

Rollback Plan

回滚计划

If something fails:
  1. [Step to undo]
  2. [Step to undo]
若出现故障:
  1. [撤销步骤]
  2. [撤销步骤]

Risks

风险

  • [Potential issue and mitigation]

Shall I proceed with Phase 1?
  • [潜在问题及缓解方案]

是否要开始执行阶段1?