refactor-plan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRefactor Plan
重构计划
Create a detailed plan for this refactoring task.
为本次重构任务创建一份详细计划。
Refactor Goal
重构目标
{{refactor_description}}
{{refactor_description}}
Instructions
操作说明
- Search the codebase to understand current state
- Identify all affected files and their dependencies
- Plan changes in a safe sequence (types first, then implementations, then tests)
- Include verification steps between changes
- Consider rollback if something fails
- 搜索代码库以了解当前状态
- 识别所有受影响的文件及其依赖关系
- 按安全顺序规划变更(先类型定义,再实现代码,最后测试)
- 在各变更阶段之间加入验证步骤
- 考虑出现故障时的回滚方案
Output Format
输出格式
markdown
undefinedmarkdown
undefinedRefactor Plan: [title]
重构计划:[标题]
Current State
当前状态
[Brief description of how things work now]
[对当前工作方式的简要描述]
Target State
目标状态
[Brief description of how things will work after]
[重构完成后工作方式的简要描述]
Affected Files
受影响文件
| File | Change Type | Dependencies |
|---|---|---|
| path | modify/create/delete | blocks 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:
- [Step to undo]
- [Step to undo]
若出现故障:
- [撤销步骤]
- [撤销步骤]
Risks
风险
- [Potential issue and mitigation]
Shall I proceed with Phase 1?- [潜在问题及缓解方案]
是否要开始执行阶段1?