fix: normalize phase input at command entry points

Commands accept both padded (08) and unpadded (8) phase numbers.
Normalization happens in step 1/2 before any directory lookups.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-01-16 22:17:51 -06:00
parent 3d9449cd25
commit 567bdd2e2c
3 changed files with 41 additions and 23 deletions

View File

@@ -244,8 +244,9 @@ issue:
Gather verification context from the phase directory and project state.
```bash
# Phase directory (provided in prompt)
PHASE_DIR=".planning/phases/${PHASE_ARG}"
# Normalize phase and find directory
PADDED_PHASE=$(printf "%02d" ${PHASE_ARG} 2>/dev/null || echo "${PHASE_ARG}")
PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE_ARG}-* 2>/dev/null | head -1)
# List all PLAN.md files
ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null