viepilot 2.12.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +203 -0
  2. package/README.md +11 -9
  3. package/docs/dev/agents.md +131 -0
  4. package/docs/skills-reference.md +12 -0
  5. package/docs/user/features/adapters.md +51 -0
  6. package/docs/user/features/interactive-prompts.md +83 -0
  7. package/lib/adapters/antigravity.cjs +2 -1
  8. package/lib/adapters/claude-code.cjs +2 -1
  9. package/lib/adapters/codex.cjs +2 -1
  10. package/lib/adapters/copilot.cjs +44 -0
  11. package/lib/adapters/cursor.cjs +2 -1
  12. package/lib/adapters/index.cjs +1 -0
  13. package/lib/viepilot-install.cjs +9 -0
  14. package/package.json +1 -1
  15. package/skills/vp-audit/SKILL.md +15 -0
  16. package/skills/vp-auto/SKILL.md +12 -0
  17. package/skills/vp-brainstorm/SKILL.md +34 -0
  18. package/skills/vp-crystallize/SKILL.md +51 -1
  19. package/skills/vp-debug/SKILL.md +12 -0
  20. package/skills/vp-docs/SKILL.md +28 -6
  21. package/skills/vp-evolve/SKILL.md +32 -0
  22. package/skills/vp-info/SKILL.md +12 -0
  23. package/skills/vp-pause/SKILL.md +12 -0
  24. package/skills/vp-proposal/SKILL.md +12 -0
  25. package/skills/vp-request/SKILL.md +36 -0
  26. package/skills/vp-resume/SKILL.md +12 -0
  27. package/skills/vp-rollback/SKILL.md +12 -0
  28. package/skills/vp-status/SKILL.md +12 -0
  29. package/skills/vp-task/SKILL.md +12 -0
  30. package/skills/vp-ui-components/SKILL.md +12 -0
  31. package/skills/vp-update/SKILL.md +12 -0
  32. package/templates/proposal/docx/project-detail.docx +0 -0
  33. package/templates/proposal/pptx/general.pptx +0 -0
  34. package/templates/proposal/pptx/product-pitch.pptx +0 -0
  35. package/templates/proposal/pptx/tech-architecture.pptx +0 -0
  36. package/workflows/audit.md +72 -37
  37. package/workflows/autonomous.md +138 -9
  38. package/workflows/brainstorm.md +61 -0
  39. package/workflows/crystallize.md +219 -8
  40. package/workflows/documentation.md +26 -11
  41. package/workflows/evolve.md +76 -7
  42. package/workflows/request.md +99 -7
  43. package/workflows/rollback.md +39 -7
@@ -100,7 +100,10 @@ fi
100
100
  ```bash
101
101
  # List completed phases (PHASE-STATE.md with status: complete)
102
102
  # List git tags matching legacy + project-scoped complete format
103
- COMPLETE_TAGS=$(git tag 2>/dev/null | grep -E '(^vp-p[0-9]+-complete$)|(^[a-z0-9-]+-vp-p[0-9]+-complete$)' | sort)
103
+ COMPLETE_TAGS=$(git tag 2>/dev/null | grep -E \
104
+ '(^vp-p[0-9]+-complete$)|(^[a-z0-9-]+-vp-p[0-9]+-complete$)|(^[a-z0-9._-]+-[a-z0-9._-]+-[0-9]+\.[0-9]+\.[0-9]+-vp-p[0-9]+-complete$)' \
105
+ | sort)
106
+ # Third alternative matches enriched format: prefix-branch-version-vp-pN-complete (ENH-050)
104
107
  # Report any phase marked complete in PHASE-STATE.md without a git tag
105
108
  ```
106
109
 
@@ -215,7 +218,8 @@ for phase_state in $RECENT_PHASES; do
215
218
  PHASE_NUM=$(basename "$PHASE_DIR" | grep -o '^[0-9]*' | sed 's/^0*//')
216
219
  TAG_PREFIX=$(vp-tools tag-prefix --raw 2>/dev/null || echo "vp")
217
220
  PHASE_TAG="${TAG_PREFIX}-p${PHASE_NUM}-complete"
218
- PREV_TAG=$(git tag --sort=-version:refname 2>/dev/null | grep -E "(vp-p.*-complete|[a-z0-9-]+-vp-p.*-complete)" | grep -A1 "^$PHASE_TAG$" | tail -1)
221
+ PREV_TAG=$(git tag --sort=-version:refname 2>/dev/null | grep -E "(vp-p.*-complete|[a-z0-9._-]+-vp-p.*-complete)" | grep -A1 "^$PHASE_TAG$" | tail -1)
222
+ # [a-z0-9._-]+ covers both legacy (viepilot-vp-p60) and enriched (viepilot-main-2.17.0-vp-p80) formats
219
223
  if [ -n "$PREV_TAG" ]; then
220
224
  DOCS_CHANGED=$(git diff "$PREV_TAG"..HEAD --name-only 2>/dev/null | grep "^docs/" | wc -l | tr -d ' ')
221
225
  if [ "$DOCS_CHANGED" -eq 0 ]; then
@@ -338,8 +342,7 @@ Include source links and last-updated timestamp.
338
342
 
339
343
  ```bash
340
344
  if [ "$IS_VIEPILOT_FRAMEWORK" != "true" ]; then
341
- echo "→ Tier 4 skipped (not a viepilot framework repo)"
342
- # Jump to step 5 (report)
345
+ # Tier 4 skipped silently — not a viepilot framework repo
343
346
  fi
344
347
  ```
345
348
 
@@ -389,14 +392,22 @@ MISSING_IN_SKILLSREF=$(comm -23 <(echo "$ACTUAL_SKILLS_LIST") <(echo "$DOCUMENTE
389
392
  ```
390
393
 
391
394
  ### 4f. Report Tier 4 results
392
- ```
393
- TIER 4: Framework Integrity
394
- ─────────────────────────────────────────────────
395
- Skills count (ARCHITECTURE.md) {N in sync | ⚠️ N actual vs M documented}
396
- Workflows count {✅ N in sync | ⚠️ N actual vs M documented}
397
- CLI commands count {✅ N in sync | ⚠️ N actual vs M documented}
398
- README.md badges {✅ In sync | ⚠️ version/skills/workflows drift}
399
- docs/skills-reference.md {✅ Complete | ⚠️ N skills missing}
395
+
396
+ > **Silent by default (ENH-049):** Only output Tier 4 results when `TIER4_ISSUES > 0`.
397
+ > If all checks pass or Tier 4 was skipped, produce no output — the user does not
398
+ > need to see "In sync" or "ℹ️ Skipped" every run.
399
+
400
+ ```bash
401
+ if [ "$TIER4_ISSUES" -gt 0 ]; then
402
+ echo " TIER 4: Framework Integrity"
403
+ echo " ─────────────────────────────────────────────────"
404
+ # Print each failing check:
405
+ # Skills count (ARCHITECTURE.md) ⚠️ N actual vs M documented
406
+ # Workflows count ⚠️ N actual vs M documented
407
+ # CLI commands count ⚠️ N actual vs M documented
408
+ # README.md badges ⚠️ version/skills/workflows drift
409
+ # docs/skills-reference.md ⚠️ N skills missing
410
+ fi
400
411
  ```
401
412
  </step>
402
413
 
@@ -412,7 +423,6 @@ MISSING_IN_SKILLSREF=$(comm -23 <(echo "$ACTUAL_SKILLS_LIST") <(echo "$DOCUMENTE
412
423
  Tier 1: ViePilot State ✅ All consistent
413
424
  Tier 2: Project Docs ✅ No drift detected
414
425
  Tier 3: Stack Practices {✅ In sync | ⚠️ N issues}
415
- Tier 4: Framework {✅ In sync | ℹ️ Skipped}
416
426
 
417
427
  Everything looks good!
418
428
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -427,7 +437,9 @@ MISSING_IN_SKILLSREF=$(comm -23 <(echo "$ACTUAL_SKILLS_LIST") <(echo "$DOCUMENTE
427
437
  Tier 1: ViePilot State {✅ | ⚠️ N issues}
428
438
  Tier 2: Project Docs {✅ | ⚠️ N issues}
429
439
  Tier 3: Stack Practices {✅ | ⚠️ N issues}
430
- Tier 4: Framework { | ⚠️ N issues | ℹ️ Skipped}
440
+ {if TIER4_ISSUES > 0}
441
+ Tier 4: Framework ⚠️ {TIER4_ISSUES} issues
442
+ {/if}
431
443
 
432
444
  ISSUES DETAIL:
433
445
  {list each issue with context}
@@ -512,32 +524,55 @@ Create `.viepilot/audit-report.md`:
512
524
  <integration>
513
525
  ## Auto-Hook Integration
514
526
 
515
- Add to `workflows/autonomous.md` after phase complete:
527
+ The following `&lt;step name="post_phase_audit"&gt;` block is inserted into `workflows/autonomous.md`
528
+ immediately after the `&lt;step name="phase_complete"&gt;` block (after git tag + push, before
529
+ starting the next phase).
516
530
 
517
531
  ```xml
518
- <step name="post_phase_audit">
519
- ## Post-Phase Documentation Audit
520
-
521
- After marking phase complete:
522
-
523
- 1. Run silent audit (Tier 1 + Tier 2 only)
524
- ```bash
525
- # Conceptually:
526
- /vp-audit --silent
527
- ```
528
-
529
- 2. If issues found:
530
- ```
531
- ⚠️ Documentation may be out of sync.
532
-
533
- Run /vp-audit to check and fix.
534
-
535
- Continue anyway? (y/n)
536
- ```
537
-
538
- 3. Recommend running before version bump
539
- </step>
532
+ &lt;step name="post_phase_audit"&gt;
533
+ ## Post-Phase Documentation Audit (Tier 1 + 2 only)
534
+
535
+ After the phase-complete git tag is created, run a fast silent audit:
536
+
537
+ ```bash
538
+ AUDIT_ISSUES=0
539
+
540
+ # Tier 1: ROADMAP.md phase marked ✅?
541
+ PHASE_IN_ROADMAP=$(grep -c "Phase ${PHASE_NUM}.*✅" .viepilot/ROADMAP.md 2>/dev/null || echo "0")
542
+ [ "$PHASE_IN_ROADMAP" -eq 0 ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
543
+ echo "⚠️ Tier 1: Phase ${PHASE_NUM} not marked ✅ in ROADMAP.md"
544
+
545
+ # Tier 1: HANDOFF.json current phase matches?
546
+ HANDOFF_PHASE=$(node -e "try{const h=require('./.viepilot/HANDOFF.json');console.log(h.phase||'')}catch(e){}" 2>/dev/null)
547
+ [ "$HANDOFF_PHASE" != "$PHASE_NUM" ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
548
+ echo "⚠️ Tier 1: HANDOFF.json phase=$HANDOFF_PHASE, expected $PHASE_NUM"
549
+
550
+ # Tier 2: README.md version badge matches package.json?
551
+ PKG_VERSION=$(node -p "require('./package.json').version" 2>/dev/null)
552
+ README_VERSION=$(grep -o 'version-[0-9]*\.[0-9]*\.[0-9]*' README.md 2>/dev/null | head -1 | sed 's/version-//')
553
+ [ "$PKG_VERSION" != "$README_VERSION" ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
554
+ echo "⚠️ Tier 2: README.md badge=$README_VERSION, package.json=$PKG_VERSION"
555
+ ```
556
+
557
+ If `AUDIT_ISSUES > 0`:
540
558
  ```
559
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
560
+ POST-PHASE AUDIT: {AUDIT_ISSUES} issue(s) found
561
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
562
+ {list issues above}
563
+
564
+ Fix now before starting next phase? (y/n)
565
+ → y: run /vp-audit --fix then continue
566
+ → n: continue (issues noted, non-blocking)
567
+ ```
568
+
569
+ If `AUDIT_ISSUES == 0`: silent — no output.
570
+ &lt;/step&gt;
571
+ ```
572
+
573
+ > **Note:** This hook runs Tier 1 + Tier 2 checks only (3 fast assertions). It does NOT
574
+ > invoke `/vp-audit` in full — Tier 3 (stack) and Tier 4 (framework) are too slow for
575
+ > a post-phase gate. For a full audit, run `/vp-audit` manually.
541
576
  </integration>
542
577
 
543
578
  <success_criteria>
@@ -13,6 +13,29 @@ Pauses at control points for user decisions.
13
13
 
14
14
  - **`/vp-auto`** + this workflow is the **default lane** for **implementing** work that already has a **phase/task plan** (and doc-first **BUG-001**). **`/vp-request`** and **`/vp-evolve`** do **not** replace this step unless the user explicitly overrides — see **Implementation routing guard** in `workflows/request.md` and `workflows/evolve.md`.
15
15
 
16
+ ## Agent Delegation (ENH-057)
17
+
18
+ This workflow delegates heavy/repetitive operations to sub-agents defined in `agents/`.
19
+ Each agent is invoked via the pattern below rather than implemented inline.
20
+
21
+ | Agent | When invoked | Operation |
22
+ |-------|-------------|-----------|
23
+ | tracker-agent | Task start, task complete, phase complete | TRACKER.md status updates |
24
+ | changelog-agent | Post-phase last task (version bump) | CHANGELOG + package.json bump |
25
+ | test-generator-agent | Last task of each phase (contract tests) | Test file generation + run |
26
+ | doc-sync-agent | Bulk edits: ≥5 identical file types in Paths block | Multi-file .md updates |
27
+
28
+ **Invoke-agent pattern** (Claude Code adapter):
29
+ ```
30
+ Agent({
31
+ subagent_type: "general-purpose",
32
+ description: "{agent-name}: {operation}",
33
+ prompt: "Load agents/{agent-name}.md for full spec. Execute: {operation} with inputs: {inputs}"
34
+ })
35
+ ```
36
+ **Non-Claude Code adapters**: execute the equivalent operation inline in the same session.
37
+
38
+ See `agents/` directory for full agent specifications.
16
39
 
17
40
  <process>
18
41
 
@@ -36,6 +59,26 @@ cat .viepilot/ROADMAP.md
36
59
  Read `~/.viepilot/config.json` → `COMMUNICATION_LANG` (default: `en`).
37
60
  Use `COMMUNICATION_LANG` for all banners, control-point messages, and user-facing output in this session.
38
61
 
62
+ ### Tag Prefix Resolution (ENH-050)
63
+ Resolve the enriched git tag prefix once at session start. All task/phase tags use `${TAG_PREFIX}`.
64
+
65
+ ```bash
66
+ PROJECT_PREFIX=$(node bin/vp-tools.cjs info --prefix 2>/dev/null \
67
+ || grep -i "^prefix:" .viepilot/PROJECT-META.md 2>/dev/null | awk '{print $2}' \
68
+ || basename "$(pwd)")
69
+ BRANCH_SAFE=$(git rev-parse --abbrev-ref HEAD 2>/dev/null \
70
+ | sed 's/[^a-zA-Z0-9._-]/-/g' || echo "main")
71
+ VERSION=$(node -e "try{console.log(require('./package.json').version)}catch(e){console.log('0.0.0')}" 2>/dev/null \
72
+ || grep '"version"' package.json 2>/dev/null | head -1 | sed 's/.*"\([0-9.]*\)".*/\1/' || echo "0.0.0")
73
+ TAG_PREFIX="${PROJECT_PREFIX}-${BRANCH_SAFE}-${VERSION}"
74
+ # Example: viepilot-main-2.17.0
75
+ # Tags: ${TAG_PREFIX}-vp-p{phase}-t{task}
76
+ # ${TAG_PREFIX}-vp-p{phase}-t{task}-done
77
+ # ${TAG_PREFIX}-vp-p{phase}-complete
78
+ ```
79
+
80
+ > Note: dots in version are valid in git tag names. Branch `/` → `-` via sed.
81
+
39
82
  Display startup banner:
40
83
  ```
41
84
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -195,7 +238,7 @@ Canonical order for every task: **Validate contract → Doc-first gate → Stack
195
238
 
196
239
  If any check fails:
197
240
  - Mark task `blocked` in `PHASE-STATE.md` and list what is missing under **Notes**
198
- - **Do not** create `{projectPrefix}-vp-p{phase}-t{task}`
241
+ - **Do not** create `{TAG_PREFIX}-vp-p{phase}-t{task}` (where `TAG_PREFIX=${PROJECT_PREFIX}-${BRANCH_SAFE}-${VERSION}`)
199
242
  - **Do not** proceed to **Execute Task**
200
243
 
201
244
  #### Stack Preflight (token-efficient lookup)
@@ -213,9 +256,34 @@ If stack cache is missing:
213
256
 
214
257
  Only after **Validate Task Contract**, **Pre-execution documentation gate**, and **Stack Preflight** (or explicit waiver logged in the task file with reason):
215
258
 
216
- Create git tag: `{projectPrefix}-vp-p{phase}-t{task}`
259
+ Create git tag: `{TAG_PREFIX}-vp-p{phase}-t{task}` (enriched format: `${PROJECT_PREFIX}-${BRANCH_SAFE}-${VERSION}-vp-p{phase}-t{task}`)
260
+ ```bash
261
+ git tag "${TAG_PREFIX}-vp-p${PHASE}-t${TASK}"
262
+ ```
217
263
  Ensure `PHASE-STATE.md` already shows current task `in_progress` (set during the gate if not already).
218
264
 
265
+ #### Bulk-Edit Task Detection — doc-sync-agent (ENH-057)
266
+
267
+ **Before executing**, scan the `## Paths` block of the task:
268
+
269
+ ```
270
+ IF (Paths block contains ≥5 files of the same type, e.g., skills/*/SKILL.md)
271
+ OR (task description matches: "update all N files", "add row to all skills", "sync across N files")
272
+ → Invoke doc-sync-agent instead of N sequential edits:
273
+
274
+ Agent({ subagent_type: "general-purpose",
275
+ description: "doc-sync-agent: {change_mode} across {file_pattern}",
276
+ prompt: "Load agents/doc-sync-agent.md. Pattern: {glob}. Mode: {change_mode}. Anchor: {anchor}. Content: {content}."
277
+ })
278
+ Non-Claude Code: apply changes sequentially inline.
279
+
280
+ Example: Task 84.3 "Update all 17 SKILL.md — add Copilot adapter row"
281
+ → Pattern: skills/*/SKILL.md | Mode: insert-row | Anchor: "| Codex CLI |" | Content: "| GitHub Copilot | ✅ ..."
282
+ → 1 agent call replaces 17 sequential Edit calls.
283
+ ```
284
+
285
+ If Paths block has < 5 files: proceed with sequential edits as normal.
286
+
219
287
  #### Execute Task
220
288
  1. Read task objective and acceptance criteria
221
289
  2. Read SYSTEM-RULES.md for coding standards
@@ -289,7 +357,7 @@ If any check fails:
289
357
  #### Handle Result
290
358
 
291
359
  **PASS:**
292
- - Create git tag: `{projectPrefix}-vp-p{phase}-t{task}-done`
360
+ - Create git tag: `{TAG_PREFIX}-vp-p{phase}-t{task}-done` (e.g. `git tag "${TAG_PREFIX}-vp-p${PHASE}-t${TASK}-done"`)
293
361
  - Update PHASE-STATE.md immediately: task → done, append files changed by this task to Files Changed table (individual files, no glob patterns)
294
362
  - Update TRACKER.md immediately
295
363
  - Update HANDOFF.json immediately
@@ -312,11 +380,20 @@ After each PASS task and PASS sub-task (state-first, then continue):
312
380
  ```yaml
313
381
  update:
314
382
  - PHASE-STATE.md: task status, timestamp
315
- - TRACKER.md: current state, progress
383
+ - TRACKER.md: current state, progress ← via tracker-agent (ENH-057)
316
384
  - HANDOFF.json: latest position
317
385
  - ROADMAP.md: sync when phase status/progress changed
318
- - CHANGELOG.md: if feature/fix completed
386
+ - CHANGELOG.md: if feature/fix completed ← via changelog-agent at end of phase (ENH-057)
387
+ ```
388
+
389
+ **Tracker updates — invoke tracker-agent:**
390
+ ```
391
+ Agent({ subagent_type: "general-purpose",
392
+ description: "tracker-agent: update task {phase}.{task} → {status}",
393
+ prompt: "Load agents/tracker-agent.md. Operation: update-task-status. Phase: {phase}. Task: {task}. Status: {status}."
394
+ })
319
395
  ```
396
+ Non-Claude Code: update TRACKER.md inline as before.
320
397
 
321
398
  Rule:
322
399
  - Never defer state updates to end-of-phase only.
@@ -355,10 +432,22 @@ When all tasks in phase are done/skipped:
355
432
  | smarttrack-*/pom.xml (8 files) | 1.1 | ← WRONG: glob pattern
356
433
  | smarttrack-*/src/** (7 files) | 1.1 | ← WRONG: summarized
357
434
  ```
358
- 4. Create git tag: `{projectPrefix}-vp-p{phase}-complete`
359
- 5. Check version bump needed:
360
- - Features added → MINOR
361
- - Fixes only → PATCH
435
+ 4. Create git tag: `{TAG_PREFIX}-vp-p{phase}-complete` (e.g. `git tag "${TAG_PREFIX}-vp-p${PHASE}-complete"`)
436
+ 5. Check version bump needed — apply `.viepilot/SYSTEM-RULES.md → Version Bump Rules`:
437
+ - Features added → MINOR; Fixes only → PATCH; Mixed → MINOR; Breaking → MAJOR
438
+
439
+ **Version bump — invoke changelog-agent (ENH-057, ENH-053 fix):**
440
+ ```
441
+ Agent({ subagent_type: "general-purpose",
442
+ description: "changelog-agent: bump to {version} + CHANGELOG [{version}]",
443
+ prompt: "Load agents/changelog-agent.md. Version: {version}. Date: {today}. Entries: {phase_summary_bullets}. Files: package.json + CHANGELOG.md."
444
+ })
445
+ ```
446
+ Non-Claude Code: update CHANGELOG.md + package.json inline as before.
447
+
448
+ > changelog-agent is the **single authority** for version bumps. Both autonomous.md and
449
+ > evolve.md invoke it — never do inline version bumps (resolves ENH-053).
450
+
362
451
  6. Update TRACKER.md
363
452
  7. Push all changes:
364
453
  ```bash
@@ -406,6 +495,46 @@ fi
406
495
  ```
407
496
  </step>
408
497
 
498
+ <step name="post_phase_audit">
499
+ ## 5c. Post-Phase Documentation Audit (Tier 1 + 2 only)
500
+
501
+ After the phase-complete git tag is created, run a fast silent audit:
502
+
503
+ ```bash
504
+ AUDIT_ISSUES=0
505
+
506
+ # Tier 1: ROADMAP.md phase marked ✅?
507
+ PHASE_IN_ROADMAP=$(grep -c "Phase ${PHASE_NUM}.*✅" .viepilot/ROADMAP.md 2>/dev/null || echo "0")
508
+ [ "$PHASE_IN_ROADMAP" -eq 0 ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
509
+ echo "⚠️ Tier 1: Phase ${PHASE_NUM} not marked ✅ in ROADMAP.md"
510
+
511
+ # Tier 1: HANDOFF.json current phase matches?
512
+ HANDOFF_PHASE=$(node -e "try{const h=require('./.viepilot/HANDOFF.json');console.log(h.phase||'')}catch(e){}" 2>/dev/null)
513
+ [ "$HANDOFF_PHASE" != "$PHASE_NUM" ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
514
+ echo "⚠️ Tier 1: HANDOFF.json phase=$HANDOFF_PHASE, expected $PHASE_NUM"
515
+
516
+ # Tier 2: README.md version badge matches package.json?
517
+ PKG_VERSION=$(node -p "require('./package.json').version" 2>/dev/null)
518
+ README_VERSION=$(grep -o 'version-[0-9]*\.[0-9]*\.[0-9]*' README.md 2>/dev/null | head -1 | sed 's/version-//')
519
+ [ "$PKG_VERSION" != "$README_VERSION" ] && AUDIT_ISSUES=$((AUDIT_ISSUES+1)) && \
520
+ echo "⚠️ Tier 2: README.md badge=$README_VERSION, package.json=$PKG_VERSION"
521
+ ```
522
+
523
+ If `AUDIT_ISSUES > 0`:
524
+ ```
525
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
526
+ POST-PHASE AUDIT: {AUDIT_ISSUES} issue(s) found
527
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
528
+ {list issues}
529
+
530
+ Fix now before starting next phase? (y/n)
531
+ → y: run /vp-audit --fix then continue
532
+ → n: continue (issues noted, non-blocking)
533
+ ```
534
+
535
+ If `AUDIT_ISSUES == 0`: silent — no output.
536
+ </step>
537
+
409
538
  <step name="iterate">
410
539
  ## 6. Iterate
411
540
 
@@ -3,6 +3,15 @@ Interactive brainstorm session to gather ideas, requirements, and decisions for
3
3
  Allows research inline within the same brainstorm session when needed.
4
4
  </purpose>
5
5
 
6
+ ## Adapter Compatibility
7
+
8
+ | Feature | Claude Code (terminal) | Cursor (Agent/Skills) | Codex CLI | Antigravity (native) |
9
+ |---------|----------------------|-----------------------|-----------|----------------------|
10
+ | Interactive prompts | ✅ `AskUserQuestion` tool — **REQUIRED** | ❌ text fallback | ❌ text fallback | ❌ text fallback |
11
+
12
+ **Claude Code (terminal):** Always call `AskUserQuestion` first. Only fall back to the plain-text menu below if the tool returns an error or is unavailable.
13
+ **Cursor / Codex CLI / Antigravity / other adapters:** `AskUserQuestion` not available — use text menus below.
14
+
6
15
  ## ViePilot Skill Scope Policy (BUG-004)
7
16
 
8
17
  - Default behavior: only use and suggest skills under `vp-*`.
@@ -37,6 +46,15 @@ Parse results to get list of existing sessions.
37
46
  ## 2. Ask User Intent
38
47
 
39
48
  **If previous sessions exist:**
49
+
50
+ > **Adapter-aware prompt:**
51
+ > **Claude Code (terminal) — REQUIRED:** Call `AskUserQuestion` tool. Only fall back to text menu if the tool errors or is unavailable. AUQ spec:
52
+ > - question: "Previous brainstorm sessions found. What would you like to do?"
53
+ > - header: "Session"
54
+ > - options: [{ label: "Continue recent session", description: "Resume the most recent session from where it stopped" }, { label: "Review specific session", description: "Choose a particular session to review or continue" }, { label: "New brainstorm session", description: "Start fresh — previous sessions are preserved" }]
55
+ > - multiSelect: false
56
+ > **Cursor / Codex / Antigravity / other:** use text menu below
57
+
40
58
  ```
41
59
  I found previous brainstorm sessions:
42
60
  {list sessions with dates}
@@ -118,6 +136,15 @@ If the user is brainstorming a landing page / homepage / marketing page:
118
136
  - Visual tone? (minimal, modern, bold, enterprise, playful)
119
137
  - Primary CTA and secondary CTA?
120
138
  2. Present a layout menu for the user to choose from:
139
+
140
+ > **Adapter-aware prompt:**
141
+ > **Claude Code (terminal) — REQUIRED:** Call `AskUserQuestion` tool. Only fall back to text menu if the tool errors or is unavailable. AUQ spec:
142
+ > - question: "Which landing page layout fits your goals and audience?"
143
+ > - header: "Layout"
144
+ > - options: [{ label: "Layout A — Hero centric", description: "Hero + trust logos + features + CTA — best for brand awareness and conversions" }, { label: "Layout B — Problem/Solution", description: "Problem/Solution + social proof + pricing + FAQ — best for SaaS sign-ups" }, { label: "Layout C — Product storytelling", description: "Screenshots + testimonials + final CTA — best for product demos" }, { label: "Layout D — SaaS conversion", description: "Integrations + comparison + onboarding steps — best for tool adoption" }]
145
+ > - multiSelect: false
146
+ > **Cursor / Codex / Antigravity / other:** use list below
147
+
121
148
  - Layout A: Hero centric + trust logos + features + CTA
122
149
  - Layout B: Problem/Solution + social proof + pricing + FAQ
123
150
  - Layout C: Product storytelling + screenshots + testimonials + final CTA
@@ -567,6 +594,40 @@ After intake is **completed** or a **valid skip** (META already has profile) →
567
594
  <step name="save_session">
568
595
  ## 6. Save Session
569
596
 
597
+ ### Pre-Save Phase Assignment Validation (ENH-052)
598
+
599
+ Before writing the session file, validate phase assignment completeness:
600
+
601
+ **Scope-locked session** — `## Phases` section exists with real content OR user confirmed scope finalized (ref: Step 5.1 condition 1):
602
+
603
+ ```
604
+ CHECK 1: Does session draft contain a non-empty ## Phases section?
605
+ CHECK 2: Does Phase 1 have at least one feature/capability assigned?
606
+ CHECK 3: Are there any features listed outside a phase (unassigned)?
607
+ ```
608
+
609
+ **Gate condition:**
610
+ - If scope is locked AND (CHECK 1 fails OR CHECK 2 fails):
611
+ → **Block save.** Show:
612
+ ```
613
+ ⚠️ Phase assignment incomplete — cannot save as Completed.
614
+
615
+ Features were discussed but no phase assignments exist.
616
+ Before saving:
617
+ 1. Assign all features to phases (## Phases section)
618
+ 2. Ensure Phase 1 has at least one feature
619
+
620
+ Return to the conversation to assign phases, then /save again.
621
+ ```
622
+ - If scope is **not** locked (exploratory session — no feature assignments):
623
+ → **Allow save** with `Status: In Progress` and add advisory note to session file:
624
+ ```markdown
625
+ > ⚠️ Exploratory session — no phase assignments yet.
626
+ > Run /vp-brainstorm to continue and assign features to phases before /vp-crystallize.
627
+ ```
628
+ - If brownfield stub session (`IS_BROWNFIELD=true`): **skip this gate** — brownfield stubs intentionally have no phases.
629
+ - If all checks pass → proceed to file write below.
630
+
570
631
  Create/update file: `docs/brainstorm/session-{YYYY-MM-DD}.md`
571
632
 
572
633
  ```markdown