Loading...
Loading...
Compare original and translation side by side
/kata-insert-phase 72 Fix critical auth bugif [ $# -lt 2 ]; then
echo "ERROR: Both phase number and description required"
echo "Usage: /kata-insert-phase <after> <description>"
echo "Example: /kata-insert-phase 72 Fix critical auth bug"
exit 1
fiafter_phase=$1
shift
description="$*"/kata-insert-phase 72 Fix critical auth bugif [ $# -lt 2 ]; then
echo "ERROR: Both phase number and description required"
echo "Usage: /kata-insert-phase <after> <description>"
echo "Example: /kata-insert-phase 72 Fix critical auth bug"
exit 1
fiafter_phase=$1
shift
description="$*"
</step>
<step name="preflight_roadmap_format">
**Pre-flight: Check roadmap format (auto-migration)**
If ROADMAP.md exists, check format and auto-migrate if old:
```bash
if [ -f .planning/ROADMAP.md ]; then
bash ../kata-doctor/scripts/check-roadmap-format.sh 2>/dev/null
FORMAT_EXIT=$?
if [ $FORMAT_EXIT -eq 1 ]; then
echo "Old roadmap format detected. Running auto-migration..."
fi
fiSkill("kata-doctor", "--auto")if [ -f .planning/ROADMAP.md ]; then
ROADMAP=".planning/ROADMAP.md"
else
echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
exit 1
fiERROR: Phase {after_phase} not found in roadmap
Available phases: [list phase numbers]decimal_phase="$(printf "%02d" $after_phase).${next_decimal}"slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//'){decimal-phase}-{slug}06.1-fix-critical-auth-bugphase_dir=".planning/phases/pending/${decimal_phase}-${slug}"
mkdir -p "$phase_dir"### Phase {decimal_phase}: {Description} (INSERTED)
**Goal:** [Urgent work - to be planned]
**Depends on:** Phase {after_phase}
**Plans:** 0 plans
Plans:
- [ ] TBD (run /kata-plan-phase {decimal_phase} to break down)
**Details:**
[To be added during planning].planning/STATE.md- Phase {decimal_phase} inserted after Phase {after_phase}: {description} (URGENT)Phase {decimal_phase} inserted after Phase {after_phase}:
- Description: {description}
- Directory: .planning/phases/{decimal-phase}-{slug}/
- Status: Not planned yet
- Marker: (INSERTED) - indicates urgent work
Roadmap updated: {roadmap-path}
Project state updated: .planning/STATE.md
---
</step>
<step name="preflight_roadmap_format">
**预检查:检查路线图格式(自动迁移)**
如果ROADMAP.md存在,检查格式,若为旧格式则自动迁移:
```bash
if [ -f .planning/ROADMAP.md ]; then
bash ../kata-doctor/scripts/check-roadmap-format.sh 2>/dev/null
FORMAT_EXIT=$?
if [ $FORMAT_EXIT -eq 1 ]; then
echo "Old roadmap format detected. Running auto-migration..."
fi
fiSkill("kata-doctor", "--auto")if [ -f .planning/ROADMAP.md ]; then
ROADMAP=".planning/ROADMAP.md"
else
echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
exit 1
fiERROR: Phase {after_phase} not found in roadmap
Available phases: [列出所有阶段编号]decimal_phase="$(printf "%02d" $after_phase).${next_decimal}"slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//'){decimal-phase}-{slug}06.1-fix-critical-auth-bugphase_dir=".planning/phases/pending/${decimal_phase}-${slug}"
mkdir -p "$phase_dir"### Phase {decimal_phase}: {Description} (INSERTED)
**Goal:** [紧急工作 - 待规划]
**Depends on:** Phase {after_phase}
**Plans:** 0 plans
Plans:
- [ ] TBD (运行 /kata-plan-phase {decimal_phase} 进行拆分)
**Details:**
[规划过程中补充].planning/STATE.md- Phase {decimal_phase} inserted after Phase {after_phase}: {description} (URGENT)Phase {decimal_phase} inserted after Phase {after_phase}:
- Description: {description}
- Directory: .planning/phases/{decimal-phase}-{slug}/
- Status: 尚未规划
- Marker: (INSERTED) - 表示紧急工作
Roadmap updated: {roadmap-path}
Project state updated: .planning/STATE.md
---/kata-plan-phase {decimal_phase}/clear</step>
</process>
<anti_patterns>
- Don't use this for planned work at end of milestone (use /kata-add-phase)
- Don't insert before Phase 1 (decimal 0.1 makes no sense)
- Don't renumber existing phases
- Don't modify the target phase content
- Don't create plans yet (that's /kata-plan-phase)
- Don't commit changes (user decides when to commit)
</anti_patterns>
<success_criteria>
Phase insertion is complete when:
- [ ] Phase directory created: `.planning/phases/pending/{N.M}-{slug}/`
- [ ] Roadmap updated with new phase entry (includes "(INSERTED)" marker)
- [ ] Phase inserted in correct position (after target phase, before next integer phase)
- [ ] STATE.md updated with roadmap evolution note
- [ ] Decimal number calculated correctly (based on existing decimals)
- [ ] User informed of next steps and dependency implications
</success_criteria>/kata-plan-phase {decimal_phase}/clear</step>
</process>
<anti_patterns>
- 不要将此用于里程碑末尾的计划工作(使用/kata-add-phase)
- 不要在Phase 1之前插入(0.1阶段没有意义)
- 不要重新编号现有阶段
- 不要修改目标阶段的内容
- 暂时不要创建计划(这是/kata-plan-phase的功能)
- 不要提交更改(由用户决定何时提交)
</anti_patterns>
<success_criteria>
阶段插入完成的判定标准:
- [ ] 已创建阶段目录:`.planning/phases/pending/{N.M}-{slug}/`
- [ ] 路线图已更新,包含新阶段条目(带有"(INSERTED)"标记)
- [ ] 阶段插入到正确位置(目标阶段之后,下一个整数阶段之前)
- [ ] STATE.md已更新路线图演进记录
- [ ] 小数编号计算正确(基于已存在的小数阶段)
- [ ] 已告知用户后续步骤和依赖影响
</success_criteria>