Loading...
Loading...
Compare original and translation side by side
/kata-move-phase 3 to v1.6.0/kata-move-phase 3 before 1/kata-move-phase 3 after 1"to""before""after"/kata-move-phase 3 to v1.6.0/kata-move-phase 3 before 1/kata-move-phase 3 after 1ERROR: Phase number and operation required
Usage: /kata-move-phase <phase> to <milestone>
/kata-move-phase <phase> before|after <position>ERROR: Invalid operation "{arg}"
Expected: to, before, or aftercat .planning/STATE.md 2>/dev/null
cat .planning/ROADMAP.md 2>/dev/null#### Phase {N}:ERROR: Phase {N} not found in roadmapERROR: Phase {N} is in {state}/ and cannot be movedERROR: Phase {N} has completed workERROR: Milestone {target} not foundERROR: Phase already in {milestone}. Use before/after to reorder.before Nafter NERROR: Phase {target_position} not found in current milestone
Available phases: [list phase numbers]Reordering Phase {N}: {Name}
Current order:
Phase 1: {name}
Phase 2: {name}
Phase 3: {name}
New order:
Phase 1: {name} (was Phase 3)
Phase 2: {name} (was Phase 1)
Phase 3: {name} (was Phase 2)
This will renumber all phase directories and update ROADMAP.md.
Proceed? (y/n)#### Phase {old}:#### Phase {new}:{old}-01:{new}-01:Depends on: Phase {old}Depends on: Phase {new}tmp-{slug}#### Phase N:{old}-01:{new}-01:Depends on: Phase {old}Phase {new}- **Phase {N} moved from {source_milestone} to {target_milestone}** as Phase {NEW_NUM}- **Phase {N} reordered {before|after} Phase {M}** in {milestone}COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=truegit add .planning//kata-move-phase 3 to v1.6.0/kata-move-phase 3 before 1/kata-move-phase 3 after 1"to""before""after"/kata-move-phase 3 to v1.6.0/kata-move-phase 3 before 1/kata-move-phase 3 after 1ERROR: Phase number and operation required
Usage: /kata-move-phase <phase> to <milestone>
/kata-move-phase <phase> before|after <position>ERROR: Invalid operation "{arg}"
Expected: to, before, or aftercat .planning/STATE.md 2>/dev/null
cat .planning/ROADMAP.md 2>/dev/null#### Phase {N}:ERROR: Phase {N} not found in roadmapERROR: Phase {N} is in {state}/ and cannot be movedERROR: Phase {N} has completed workERROR: Milestone {target} not foundERROR: Phase already in {milestone}. Use before/after to reorder.before Nafter NERROR: Phase {target_position} not found in current milestone
Available phases: [list phase numbers]Reordering Phase {N}: {Name}
Current order:
Phase 1: {name}
Phase 2: {name}
Phase 3: {name}
New order:
Phase 1: {name} (was Phase 3)
Phase 2: {name} (was Phase 1)
Phase 3: {name} (was Phase 2)
This will renumber all phase directories and update ROADMAP.md.
Proceed? (y/n)#### Phase {old}:#### Phase {new}:{old}-01:{new}-01:Depends on: Phase {old}Depends on: Phase {new}tmp-{slug}#### Phase N:{old}-01:{new}-01:Depends on: Phase {old}Phase {new}- **Phase {N} moved from {source_milestone} to {target_milestone}** as Phase {NEW_NUM}- **Phase {N} reordered {before|after} Phase {M}** in {milestone}COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=truegit add .planning/</step>
<step name="completion">
Present completion summary showing: operation performed, directories renamed, phases renumbered, files updated, commit message. Then offer next actions: `/kata-track-progress`, continue current phase, review roadmap.
</step>
</process>
<anti_patterns>
- Don't move active or completed phases (only pending phases can be moved/reordered)
- Don't move phases with executed plans (SUMMARY.md exists)
- Don't move to the same milestone (use reorder instead)
- Don't reorder to the same position (no-op)
- Don't forget decimal phases (they move with parent integer phase)
- Don't commit if commit_docs is false
- Don't leave gaps in phase numbering after move or reorder
- Don't modify phases outside the source and target milestones
- Don't rename directories without the two-pass temp approach (avoids collisions during reorder)
</anti_patterns>
<edge_cases>
**Phase has PLAN.md files but no SUMMARY.md:**
- Allowed. Rename plan files inside the directory as part of the move/reorder.
- Update plan frontmatter phase references.
**Target milestone is empty (no phases):**
- First phase becomes Phase 1.
- `calculate_destination_number` handles this (NEW_NUM=1 when HIGHEST is empty).
**Last phase in source milestone removed:**
- No renumbering needed in source milestone.
- Source milestone section in ROADMAP.md still has its heading.
**Decimal phases under moved integer phase:**
- Find all decimal phases (N.1, N.2) belonging to the moved integer phase.
- Move them together with the parent.
- Renumber to NEW_NUM.1, NEW_NUM.2 at destination.
**Phase directory doesn't exist yet:**
- Phase may be in ROADMAP.md but directory not created.
- Skip directory operations, proceed with ROADMAP.md updates only.
- Note in completion summary: "No directory to move (phase not yet created)"
**Reorder: moving to adjacent position:**
- `before N+1` or `after N-1` when phase is at position N is a no-op.
- Detect and report: "Phase {N} is already at that position."
**Reorder: only two phases in milestone:**
- Swap positions. Both directories and all references renumbered.
</edge_cases>
<success_criteria>
**Cross-milestone move** is complete when:
- [ ] Source phase validated as pending/unstarted
- [ ] Target milestone validated as existing and different from source
- [ ] Phase section removed from source milestone in ROADMAP.md
- [ ] Remaining source phases renumbered to close gap
- [ ] Phase section added to target milestone with correct number
- [ ] Phase directory renamed to match new number
- [ ] Files inside directory renamed ({old}-NN-PLAN.md -> {new}-NN-PLAN.md)
- [ ] Decimal phases moved with parent (if any)
- [ ] Source directories renumbered (if phases shifted)
- [ ] STATE.md updated with roadmap evolution note
- [ ] Changes committed with descriptive message
- [ ] No gaps in phase numbering at source or destination
**Reorder** is complete when:
- [ ] Phase validated as pending/unstarted
- [ ] Target position validated as existing in same milestone
- [ ] Phase sections reordered in ROADMAP.md
- [ ] All phases in milestone renumbered sequentially
- [ ] All phase directories renamed (two-pass temp approach)
- [ ] Files inside directories renamed to match new numbers
- [ ] Decimal phases renumbered with parent (if any)
- [ ] STATE.md updated with roadmap evolution note
- [ ] Changes committed with descriptive message
- [ ] No gaps in phase numbering
**Both operations:** User informed of all changes.
</success_criteria></step>
<step name="completion">
显示完成摘要,内容包括:执行的操作、重命名的目录、重编号的阶段、更新的文件、提交信息。然后提供后续操作选项:`/kata-track-progress`、继续当前阶段、查看路线图。
</step>
</process>
<anti_patterns>
- 不要移动active或completed状态的阶段(仅pending状态的阶段可被移动/重新排序)
- 不要移动包含已执行计划的阶段(存在SUMMARY.md文件)
- 不要将阶段移动到同一里程碑(应使用重新排序操作)
- 不要将阶段重新排序到当前位置(无意义操作)
- 不要遗漏小数阶段(它们随父整数阶段一起移动)
- 若commit_docs为false,不要执行提交操作
- 移动或重新排序后不要留下阶段编号空缺
- 不要修改源里程碑和目标里程碑之外的阶段
- 不要在重新排序时不使用两步临时法重命名目录(避免命名冲突)
</anti_patterns>
<edge_cases>
**阶段包含PLAN.md文件但无SUMMARY.md文件:**
- 允许操作。在移动/重新排序过程中重命名目录内的计划文件。
- 更新计划前置元数据中的阶段引用。
**目标里程碑为空(无阶段):**
- 第一个阶段成为Phase 1。
- `calculate_destination_number`步骤会处理此情况(当HIGHEST为空时,NEW_NUM=1)。
**源里程碑的最后一个阶段被移除:**
- 源里程碑无需重编号。
- ROADMAP.md中的源里程碑部分仍保留其标题。
**被移动的整数阶段下包含小数阶段:**
- 查找所有属于该整数阶段的小数阶段(N.1、N.2)。
- 将它们与父阶段一起移动。
- 在目标位置重命名为NEW_NUM.1、NEW_NUM.2。
**阶段目录尚未创建:**
- 阶段可能已在ROADMAP.md中存在但目录未创建。
- 跳过目录操作,仅执行ROADMAP.md的更新。
- 在完成摘要中注明:"No directory to move (phase not yet created)"
**重新排序:移动到相邻位置:**
- 当阶段位于位置N时,执行`before N+1`或`after N-1`属于无意义操作。
- 检测到后输出:"Phase {N} is already at that position."
**重新排序:里程碑内仅有两个阶段:**
- 交换位置。重命名两个目录及所有引用。
</edge_cases>
<success_criteria>
**跨里程碑移动操作**完成的标志:
- [ ] 源阶段已验证为pending/unstarted状态
- [ ] 目标里程碑已验证为存在且与源里程碑不同
- [ ] 阶段部分已从ROADMAP.md的源里程碑中移除
- [ ] 源里程碑的剩余阶段已重编号以填补空缺
- [ ] 阶段部分已添加到目标里程碑并使用正确编号
- [ ] 阶段目录已重命名以匹配新编号
- [ ] 目录内的文件已重命名(`{old}-NN-PLAN.md` → `{new}-NN-PLAN.md`)
- [ ] 小数阶段已随父阶段一起移动(若有)
- [ ] 源目录已重编号(若阶段编号发生变化)
- [ ] STATE.md已添加路线图变更记录
- [ ] 变更已通过描述性信息提交
- [ ] 源里程碑和目标里程碑的阶段编号无空缺
**重新排序操作**完成的标志:
- [ ] 阶段已验证为pending/unstarted状态
- [ ] 目标位置已验证为在同一里程碑中存在
- [ ] ROADMAP.md中的阶段部分已重新排序
- [ ] 里程碑内的所有阶段已按顺序重编号
- [ ] 所有阶段目录已重命名(使用两步临时法)
- [ ] 目录内的文件已重命名以匹配新编号
- [ ] 小数阶段已随父阶段一起重编号(若有)
- [ ] STATE.md已添加路线图变更记录
- [ ] 变更已通过描述性信息提交
- [ ] 阶段编号无空缺
**两种操作通用:** 已向用户告知所有变更内容。
</success_criteria>