Skip to content

Commit b521fb7

Browse files
jwaldripclaude
andcommitted
fix(plugin): skip delivery prompt for unit-based change strategy
With unit strategy, each unit already gets its own PR during construction. The intent-level delivery prompt ("How would you like to deliver?") made no sense in that context. Now the delivery prompt is gated on change strategy — skipped entirely for unit strategy, shown only for intent strategy or hybrid intents with non-unit units. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4613677 commit b521fb7

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

plugin/skills/advance/SKILL.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,34 @@ git commit -m "announce: generate completion announcements for ${INTENT_SLUG}"
455455

456456
Skip this step if `announcements` is empty or `[]`.
457457

458-
Then ask the user how to deliver using `AskUserQuestion`:
458+
**Gate on change strategy.** The delivery prompt only applies to intent-level strategy. With unit strategy, each unit already has its own PR.
459+
460+
```bash
461+
source "${CLAUDE_PLUGIN_ROOT}/lib/config.sh"
462+
source "${CLAUDE_PLUGIN_ROOT}/lib/dag.sh"
463+
CONFIG=$(get_ai_dlc_config "$INTENT_DIR")
464+
CHANGE_STRATEGY=$(echo "$CONFIG" | jq -r '.change_strategy // "unit"')
465+
466+
ALL_UNIT_STRATEGY=true
467+
for unit_file in "$INTENT_DIR"/unit-*.md; do
468+
[ -f "$unit_file" ] || continue
469+
UNIT_CS=$(parse_unit_change_strategy "$unit_file")
470+
EFFECTIVE_CS="${UNIT_CS:-$CHANGE_STRATEGY}"
471+
[ "$EFFECTIVE_CS" != "unit" ] && { ALL_UNIT_STRATEGY=false; break; }
472+
done
473+
```
474+
475+
**If ALL units use unit strategy** (`ALL_UNIT_STRATEGY=true`): Skip the delivery prompt. Each unit already has its own PR. Output:
476+
477+
```
478+
All unit PRs have been created during construction. Review and merge them individually.
479+
480+
To clean up:
481+
git worktree remove .ai-dlc/worktrees/{intent-slug}
482+
/reset
483+
```
484+
485+
**If intent strategy** (or hybrid with non-unit units): Ask the user how to deliver using `AskUserQuestion`:
459486

460487
```json
461488
{
@@ -483,6 +510,8 @@ git push -u origin "$INTENT_BRANCH" 2>/dev/null || true
483510
2. Collect ticket references from all units:
484511

485512
```bash
513+
DEFAULT_BRANCH=$(echo "$CONFIG" | jq -r '.default_branch')
514+
486515
TICKET_REFS=""
487516
for unit_file in "$INTENT_DIR"/unit-*.md; do
488517
[ -f "$unit_file" ] || continue
@@ -520,7 +549,7 @@ EOF
520549
)"
521550
```
522551

523-
3. Output the PR URL.
552+
4. Output the PR URL.
524553

525554
### If manual:
526555

plugin/skills/construct/SKILL.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,36 @@ han keep save iteration.json "$STATE"
848848

849849
#### 5c. Delivery Prompt
850850

851-
After the completion summary, ask the user how to deliver using `AskUserQuestion`:
851+
**Gate on change strategy.** The delivery prompt only applies to intent-level strategy, where all unit work merges into a single intent branch that needs delivery. With unit strategy, each unit already has its own PR — there's nothing to deliver as a whole.
852+
853+
```bash
854+
source "${CLAUDE_PLUGIN_ROOT}/lib/config.sh"
855+
source "${CLAUDE_PLUGIN_ROOT}/lib/dag.sh"
856+
INTENT_DIR=".ai-dlc/${INTENT_SLUG}"
857+
CONFIG=$(get_ai_dlc_config "$INTENT_DIR")
858+
CHANGE_STRATEGY=$(echo "$CONFIG" | jq -r '.change_strategy // "unit"')
859+
860+
# Check if ALL units effectively use unit strategy (including hybrid)
861+
ALL_UNIT_STRATEGY=true
862+
for unit_file in "$INTENT_DIR"/unit-*.md; do
863+
[ -f "$unit_file" ] || continue
864+
UNIT_CS=$(parse_unit_change_strategy "$unit_file")
865+
EFFECTIVE_CS="${UNIT_CS:-$CHANGE_STRATEGY}"
866+
[ "$EFFECTIVE_CS" != "unit" ] && { ALL_UNIT_STRATEGY=false; break; }
867+
done
868+
```
869+
870+
**If ALL units use unit strategy** (`ALL_UNIT_STRATEGY=true`): Skip the delivery prompt entirely. Each unit already has its own PR. Output:
871+
872+
```
873+
All unit PRs have been created during construction. Review and merge them individually.
874+
875+
To clean up:
876+
git worktree remove .ai-dlc/worktrees/{intent-slug}
877+
/reset
878+
```
879+
880+
**If intent strategy** (or hybrid with non-unit units): Ask the user how to deliver using `AskUserQuestion`:
852881

853882
```json
854883
{
@@ -876,9 +905,6 @@ git push -u origin "$INTENT_BRANCH" 2>/dev/null || true
876905
2. Collect ticket references from all units:
877906

878907
```bash
879-
source "${CLAUDE_PLUGIN_ROOT}/lib/config.sh"
880-
INTENT_DIR=".ai-dlc/${INTENT_SLUG}"
881-
CONFIG=$(get_ai_dlc_config "$INTENT_DIR")
882908
DEFAULT_BRANCH=$(echo "$CONFIG" | jq -r '.default_branch')
883909

884910
TICKET_REFS=""

0 commit comments

Comments
 (0)