viepilot 2.23.0 → 2.45.2

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 (52) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/README.md +6 -6
  3. package/bin/viepilot.cjs +140 -1
  4. package/bin/vp-tools.cjs +204 -0
  5. package/docs/brainstorm/session-2026-04-20.md +261 -0
  6. package/docs/brainstorm/session-2026-04-24.md +131 -0
  7. package/docs/brainstorm/session-2026-04-25.md +109 -0
  8. package/docs/skills-reference.md +22 -0
  9. package/docs/user/features/adapters.md +2 -2
  10. package/docs/user/features/scaffold-first.md +62 -0
  11. package/docs/user/features/skill-registry.md +125 -0
  12. package/lib/adapters/antigravity.cjs +5 -4
  13. package/lib/domain-packs/ai-product.json +33 -0
  14. package/lib/domain-packs/data-science.json +33 -0
  15. package/lib/domain-packs/devops.json +33 -0
  16. package/lib/domain-packs/mobile.json +33 -0
  17. package/lib/domain-packs/web-saas.json +33 -0
  18. package/lib/skill-installer.cjs +274 -0
  19. package/lib/skill-registry.cjs +212 -0
  20. package/lib/viepilot-calibrate.cjs +279 -0
  21. package/lib/viepilot-persona.cjs +446 -0
  22. package/lib/viepilot-update.cjs +113 -0
  23. package/package.json +1 -1
  24. package/skills/vp-audit/SKILL.md +67 -9
  25. package/skills/vp-auto/SKILL.md +54 -0
  26. package/skills/vp-brainstorm/SKILL.md +124 -2
  27. package/skills/vp-crystallize/SKILL.md +82 -0
  28. package/skills/vp-debug/SKILL.md +37 -0
  29. package/skills/vp-design/SKILL.md +219 -0
  30. package/skills/vp-docs/SKILL.md +37 -0
  31. package/skills/vp-evolve/SKILL.md +69 -6
  32. package/skills/vp-info/SKILL.md +37 -0
  33. package/skills/vp-pause/SKILL.md +37 -0
  34. package/skills/vp-persona/SKILL.md +207 -0
  35. package/skills/vp-proposal/SKILL.md +37 -0
  36. package/skills/vp-request/SKILL.md +62 -6
  37. package/skills/vp-resume/SKILL.md +37 -0
  38. package/skills/vp-rollback/SKILL.md +61 -1
  39. package/skills/vp-skills/SKILL.md +311 -0
  40. package/skills/vp-status/SKILL.md +37 -0
  41. package/skills/vp-task/SKILL.md +37 -0
  42. package/skills/vp-ui-components/SKILL.md +37 -0
  43. package/skills/vp-update/SKILL.md +37 -0
  44. package/templates/phase/TASK.md +7 -0
  45. package/templates/project/PROJECT-CONTEXT.md +76 -0
  46. package/workflows/audit.md +131 -0
  47. package/workflows/autonomous.md +199 -0
  48. package/workflows/brainstorm.md +1172 -9
  49. package/workflows/crystallize.md +639 -3
  50. package/workflows/design.md +601 -0
  51. package/workflows/evolve.md +9 -0
  52. package/workflows/rollback.md +79 -10
@@ -15,6 +15,43 @@ Output this banner as the **first** thing on every invocation — before questio
15
15
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
16
  ```
17
17
  </greeting>
18
+ <version_check>
19
+ ## Version Update Check (ENH-072)
20
+
21
+ After displaying the greeting banner, run:
22
+ ```bash
23
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
24
+ ```
25
+
26
+ **If exit code = 1** (update available — new version printed to stdout):
27
+ Display notice banner before any other output:
28
+ ```
29
+ ┌──────────────────────────────────────────────────────────────────┐
30
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
31
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
32
+ └──────────────────────────────────────────────────────────────────┘
33
+ ```
34
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
35
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
36
+
37
+ **If exit code = 0 or command unavailable**: silent, continue.
38
+
39
+ **Suppression rules:**
40
+ - `--no-update-check` flag on skill invocation → skip this step entirely
41
+ - `config.json` → `update.check: false` → skip this step entirely
42
+ - Show at most once per session (`update_check_done` session guard)
43
+ </version_check>
44
+ <persona_context>
45
+ ## Persona Context Injection (ENH-073)
46
+ At skill start, run:
47
+ ```bash
48
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
49
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
50
+ ```
51
+ Inject the output as `## User Persona` context before any task execution.
52
+ Silent if command unavailable or errors.
53
+ </persona_context>
54
+
18
55
 
19
56
  <cursor_skill_adapter>
20
57
  ## A. Skill Invocation
@@ -267,3 +304,20 @@ Before the first interactive prompt, call `ToolSearch` with `query: "select:AskU
267
304
  - [ ] CHANGELOG updated for features/fixes
268
305
  - [ ] Clean stop with summary on pause/error
269
306
  </success_criteria>
307
+
308
+ ### Skill Context Execution (FEAT-020)
309
+
310
+ At session start, vp-auto reads `PROJECT-CONTEXT.md ## Skills` (locked by `/vp-crystallize`
311
+ Step 1E) and builds a `SKILL_CONTEXT_MAP`.
312
+
313
+ During each task:
314
+ - Required skills whose phases match the current task's phase are **silently** injected into the execution context
315
+ - Best practices from matched skills appear as a silent checklist before implementation
316
+ - Task output records `skills_applied: [id@version, ...]`
317
+
318
+ **No prompts are shown** — all skill decisions are locked at crystallize time.
319
+ `/vp-auto` is execution-only for skills.
320
+
321
+ Install skills: `vp-tools install-skill <source>`
322
+ Lock decisions: `/vp-crystallize` Step 1E
323
+ Docs: `docs/user/features/skill-registry.md`
@@ -15,6 +15,43 @@ Output this banner as the **first** thing on every invocation — before questio
15
15
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
16
  ```
17
17
  </greeting>
18
+ <version_check>
19
+ ## Version Update Check (ENH-072)
20
+
21
+ After displaying the greeting banner, run:
22
+ ```bash
23
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
24
+ ```
25
+
26
+ **If exit code = 1** (update available — new version printed to stdout):
27
+ Display notice banner before any other output:
28
+ ```
29
+ ┌──────────────────────────────────────────────────────────────────┐
30
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
31
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
32
+ └──────────────────────────────────────────────────────────────────┘
33
+ ```
34
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
35
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
36
+
37
+ **If exit code = 0 or command unavailable**: silent, continue.
38
+
39
+ **Suppression rules:**
40
+ - `--no-update-check` flag on skill invocation → skip this step entirely
41
+ - `config.json` → `update.check: false` → skip this step entirely
42
+ - Show at most once per session (`update_check_done` session guard)
43
+ </version_check>
44
+ <persona_context>
45
+ ## Persona Context Injection (ENH-073)
46
+ At skill start, run:
47
+ ```bash
48
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
49
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
50
+ ```
51
+ Inject the output as `## User Persona` context before any task execution.
52
+ Silent if command unavailable or errors.
53
+ </persona_context>
54
+
18
55
 
19
56
  <cursor_skill_adapter>
20
57
  ## A. Skill Invocation
@@ -54,11 +91,18 @@ Supports:
54
91
  - **Phase assignment (ENH-030):** in every session, features/capabilities are assigned directly to Phase 1, Phase 2, Phase 3... — no MVP/Post-MVP/Future tiers. Session file stores assignments in the `## Phases` section.
55
92
  - **Project meta intake (FEAT-009):** after **scope locked**, **before** `Completed` / `/end`, if `.viepilot/META.md` (`viepilot_profile_id`) is missing — run **sequential** Q&A with proposals; read/write `~/.viepilot/profile-map.md`; create `~/.viepilot/profiles/<slug>.md` + binding per **`docs/dev/global-profiles.md`**. If a profile is already bound — skip intake by default (ask if change needed).
56
93
  - **UX walkthrough (FEAT-010 + ENH-019 + ENH-020):** in **`--ui`** mode, command **`/research-ui`** or **`/research ui`** runs 3 phases — simulates **end-user** (with **content stress pass** + **stress recipes by archetype** → **Stress findings**) → **UX designer + web research** → update `index.html` / `pages/*.html` / `style.css` and write **`## UX walkthrough log`** in `notes.md` (sync hub + **Pages inventory** for multi-page).
57
- - **Background UI extraction (ENH-026):** automatically detects UI signal keywords in every brainstorm session (no `--ui` flag required); silent accumulation buffer; surfaces for confirmation when topic ends, `/save`, or ≥5 signals — does not interrupt the main conversation.
94
+ - **Background UI extraction (ENH-026 + ENH-060):** automatically detects UI signal keywords in every brainstorm session (no `--ui` flag required). **Auto-suggests itself (ENH-060):** if the initial message contains ≥1 UI keyword, shows a proactive 🎨 banner immediately — mirrors Architect Design Mode's 🏗️ proactive activation. Accumulation starts at ≥1 signal (was ≥3); surfaces for confirmation when topic ends, `/save`, or **≥2 unique signals** accumulated (was ≥5) — does not interrupt the main conversation.
95
+ - **Idea → Architecture breakdown loop (ENH-061):** structured 8-step flow from free idea collection → scope lock → **Feature → Coverage mapping** (maps each Phase 1 feature to an architect page + UI screen, outputs `## Coverage` matrix in `notes.md`) → Architect Design → **`arch_to_ui_sync`** reverse sync (surfaces UI implications of architectural decisions; `/sync-ui` command) → UI Direction → **completeness gate** (CHECK 4: warns if any Phase 1 feature has no coverage in either mode, non-blocking). See `Recommended Breakdown Ordering` section in `workflows/brainstorm.md`.
96
+ - **Unified workspace mode selection (BUG-018):** after scope lock, before any design workspace is created, an AUQ prompt offers: Both / Architect only / UI Direction only / Neither. Architect auto-activate heuristic is deferred until after this selection; suppressed if user selects "Neither" or "UI Direction only".
97
+ - **Admin & Governance coverage (ENH-063):** Topic 6 in brainstorm template; proactive 🔐 heuristic fires on admin/governance keywords; admin coverage gate before /save for multi-user/SaaS/compliance projects; `admin.html` added to Architect workspace when applicable; `notes.md ## admin` YAML exported via crystallize.
98
+ - **Content Management coverage (ENH-065):** Topic 7 in brainstorm template; proactive 🗂️ heuristic fires on content-type/media/SEO keywords; content coverage gate before /save for projects with content layer; `content.html` added to Architect workspace; `notes.md ## content` YAML exported via crystallize.
99
+ - **Admin Entity Management coverage (ENH-068):** Topic 7 in brainstorm template; proactive 🗄️ heuristic fires on CRUD/entity/admin panel keywords; entity management coverage gate before /save for projects with DB entities (cross-references ERD); `entity-mgmt.html` added to Architect workspace; `notes.md ## entity_mgmt` YAML exported via crystallize.
100
+ - **User Data Management coverage (ENH-066):** Topic 9 in brainstorm template; proactive 👤 heuristic fires on user-account/privacy/auth keywords; user data coverage gate before /save for B2C/SaaS/GDPR projects; `user-data.html` added to Architect workspace; `notes.md ## user_data` YAML exported via crystallize.
58
101
  - **Architect Design Mode (FEAT-011):** `/vp-brainstorm --architect` or auto-activate when ≥3 components/services detected; generate HTML workspace (architecture, data-flow, decisions, tech-stack, tech-notes, feature-map) with Mermaid diagrams; incremental update per decision; `/review-arch` command; machine-readable `notes.md` YAML schema.
59
102
  - **ERD page (ENH-027):** Architect workspace includes `erd.html` — Mermaid `erDiagram`, entity list table, relationship summary; triggered by DB/entity/table/relationship keywords; notes.md `## erd` YAML section exported to ARCHITECTURE.md `## Database Schema` via crystallize Step 1D.
60
103
  - **User Use Cases page (ENH-028):** Architect workspace includes `user-use-cases.html` — actor/use-case diagram (Mermaid flowchart), use case table; triggered by user/role/actor/story keywords; notes.md `## use_cases` YAML section exported to PROJECT-CONTEXT.md `## User Stories & Use Cases` via crystallize Step 1D.
61
104
  - **C4Context/Sequence/Deployment/APIs pages (ENH-029, 12-page workspace):** Architect workspace expanded to 12 pages — `sequence-diagram.html` (per-scenario sequenceDiagram), `deployment.html` (infra graph + environments + CI/CD pipeline), `apis.html` (endpoint tables with HTTP method badges); page boundary rules table; trigger keywords for sequence/deploy/API; notes.md `## apis` YAML section; deployment+APIs exported to ARCHITECTURE.md via crystallize Step 1D (sequence excluded — scenario docs are not architecture artifacts).
105
+ - **Embedded Domain Mode (ENH-071):** Activated when ≥2 embedded trigger keywords detected (MCU families: STM32/ESP32/nRF52/AVR/RISC-V/RP2040; concepts: firmware/bare-metal/GPIO/interrupt/HAL/bootloader/RTOS) OR `--domain embedded` flag. Adds 6 Architect workspace pages for embedded hardware artifacts, injects domain-specific topic probes, suppresses web-UI false-positives for hardware display keywords, and offers a firmware phase ordering template. crystallize exports 8 YAML sections to ARCHITECTURE.md hardware sections.
62
106
 
63
107
  **Creates/Updates:**
64
108
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
@@ -70,6 +114,16 @@ Supports:
70
114
  - `BRAINSTORM_LANG` is used for brainstorm file storage and generated content.
71
115
  - User session language takes precedence over config if different.
72
116
  - Configure via: `vp-tools config set language.document vi`
117
+
118
+ **Workflow version stamps (ENH-067):**
119
+ - Session files record `workflow_version` (current ViePilot semver) at create/save time.
120
+ - `upgrade_supplement_version` stamped after gap-detection supplement completes (idempotency guard).
121
+
122
+ **Upgrade gap detection (ENH-067):**
123
+ - On `--continue`, compares session `workflow_version` vs. current Topics Template to detect missing topics.
124
+ - Proactive 🔄 upgrade banner (AUQ) lists missing topics; user can discuss inline, defer to /save, or skip.
125
+ - Inline supplement appended as `## Upgrade supplement (vX → vY)` section; `upgrade_supplement_version` stamped for idempotency.
126
+ - After supplement: suggests `/vp-crystallize --upgrade` to patch project artifacts.
73
127
  </objective>
74
128
 
75
129
  <execution_context>
@@ -83,9 +137,53 @@ Optional flags:
83
137
  - `--list` : List all sessions
84
138
  - `--landing` : Prioritize the Landing Page layout discovery flow
85
139
  - `--research` : Enable proactive research suggestions during the session
86
- - `--ui` : Enable UI Direction mode (live HTML/CSS direction artifacts)
140
+ - `--ui` : Enable UI Direction mode (live HTML/CSS direction artifacts + auto-generates `design.md` when design keywords present — ENH-076)
141
+ - `--domain embedded` : Force-activate Embedded Domain Mode (hardware topology, RTOS, pin map, memory layout, protocol matrix, power budget pages + topic probes)
87
142
  </context>
88
143
 
144
+ ### Embedded Domain Mode (ENH-071)
145
+
146
+ **Activation**: Automatically when ≥2 embedded keywords detected, or via `--domain embedded` flag. One-time `🔌 Embedded Domain Mode activated` banner shown.
147
+
148
+ **Topic probes injected when `embedded_domain: true`:**
149
+ - **MCU/Toolchain** (Gap 2): MCU family, toolchain (GCC-ARM/Keil/IAR), build system (CMake/PlatformIO/West), debug interface (SWD/JTAG), flasher, SDK/HAL
150
+ - **RTOS/Scheduling** (Gap 3): bare-metal vs RTOS choice, task list, ISR table, resource protection strategy
151
+ - **Power Budget** (Gap 7): supply type, sleep modes, current targets, battery life (triggered by battery/power/sleep keywords)
152
+ - **Safety/Compliance** (Gap 10): IEC 61508/ISO 26262/DO-178C, watchdog, fault handlers (triggered by safety/SIL/ASIL keywords)
153
+ - **Firmware Phase Template** (Gap 9): Board Bring-Up → Drivers → RTOS → Middleware → Application → Integration Test → OTA
154
+
155
+ **6 new Architect workspace pages** (in `.viepilot/architect/{session-id}/`):
156
+
157
+ | Page | Trigger | Content |
158
+ |------|---------|---------|
159
+ | `hw-topology.html` | Always in embedded domain | MCU block diagram (Mermaid graph TD) + component/bus/power-rail tables |
160
+ | `pin-map.html` | GPIO/pin/pinout keywords | Pin assignment table (Pin# / GPIO / Function / Peripheral / Direction / Pull / Voltage) |
161
+ | `memory-layout.html` | Flash/RAM/linker/bootloader/OTA keywords | Flash + RAM regions tables + linker constraint notes |
162
+ | `protocol-matrix.html` | CAN/I2C/SPI/BLE/LoRa/MQTT/Modbus keywords | Bus protocol + wireless connectivity tables (distinct from `apis.html` HTTP REST) |
163
+ | `rtos-scheduler.html` | RTOS/FreeRTOS/task/ISR/scheduler keywords | Task priority table + ISR table + state diagram (≤5 tasks) |
164
+ | `power-budget.html` | Battery/sleep/power/µA/mAh keywords | Power modes table + battery life estimate |
165
+
166
+ Pages linked in `index.html` under an **Embedded** nav section.
167
+
168
+ **UI Direction false-positive suppression** (Gap 6):
169
+ - `LCD` / `OLED` / `TFT` / `display` / `screen` in hardware context → routed to `hw-topology` peripherals, NOT UI Direction buffer
170
+ - Hardware context confirmed by: GPIO / SPI / I2C / driver / framebuffer / ILI9341 / SSD1306 / LVGL / u8g2 keywords
171
+ - `🎨 UI Direction Mode?` banner suppressed when all display signals have hardware context
172
+
173
+ **notes.md YAML sections written:** `## hw_topology`, `## pin_map`, `## memory_layout`, `## protocols`, `## rtos_config`, `## embedded_toolchain`, `## power_budget`, `## safety_config`
174
+
175
+ **crystallize Step 1D item 13 exports:**
176
+ - `## Hardware Architecture` (from `hw_topology`)
177
+ - `## Hardware Interface` (from `pin_map`)
178
+ - `## Memory Map` (from `memory_layout`)
179
+ - `## Communication Protocols` (from `protocols`) — distinct from `## APIs`
180
+ - `## RTOS & Task Model` (from `rtos_config`)
181
+ - `## Toolchain & Build System` (from `embedded_toolchain`)
182
+ - `## Power Budget` (from `power_budget`)
183
+ - `## Safety & Reliability` (from `safety_config`)
184
+ - `## Embedded Domain: true` + MCU family written to `PROJECT-CONTEXT.md`
185
+ - UI Coverage Gate skipped; Hardware Coverage Check (driver-task completeness, non-blocking) applied instead
186
+
89
187
  <process>
90
188
  Execute workflow from `@$HOME/{envToolDir}/workflows/brainstorm.md`
91
189
 
@@ -117,6 +215,7 @@ Key steps:
117
215
  - [ ] **FEAT-010 + ENH-019 + ENH-020**: `/research-ui` (when `--ui`) runs all 3 phases, including **content stress pass** + **archetype recipes** + **`## UX walkthrough log`** (with **Stress findings**) when prototype is updated
118
216
  - [ ] `## Phases` present with Phase 1 having real content when scope is discussed
119
217
  - [ ] **FEAT-009**: intake completed, binding already present, **or** waiver with reason before Completed; session records **`## Project meta intake (FEAT-009)`**
218
+ - [ ] **ENH-076**: `design.md` generated in session directory when UI mode active and ≥2 design keywords present; `notes.md ## design_tokens` populated
120
219
  - [ ] Next steps suggested
121
220
  </success_criteria>
122
221
 
@@ -144,3 +243,26 @@ plain-text numbered list prompts — no configuration required.
144
243
  **Prompts using AskUserQuestion in this skill:**
145
244
  - Session intent (continue / review / new — Step 2)
146
245
  - Landing page layout selection (Step 4 — Layout A/B/C/D)
246
+ - Mid-session structured choices (≥2 discrete named options — BUG-022): topic direction,
247
+ section priority, angle selection, and any numbered decision with enumerable options
248
+ - Session-transition/next-steps prompt (session-flow choices: save/crystallize, update UI
249
+ artifacts, continue discussing — BUG-023)
250
+
251
+
252
+ ### Skill Registry Integration (FEAT-020)
253
+
254
+ When UI Direction Mode is active, vp-brainstorm automatically:
255
+ 1. Loads `~/.viepilot/skill-registry.json` (written by `vp-tools scan-skills`)
256
+ 2. Matches installed skills by `capabilities` to current UI signals
257
+ 3. **Silently** applies matched skill `best_practices` to HTML generation
258
+ 4. Records matched skills in `notes.md ## skills_used`
259
+
260
+ **No prompt is shown** — integration is transparent. Skills with relevant
261
+ capabilities (e.g., `ui-generation`, `component-design`, `responsive-layout`)
262
+ are detected automatically.
263
+
264
+ Skill decisions are **locked at crystallize time** (see `/vp-crystallize`).
265
+ `/vp-auto` executes with those locked decisions — no re-asking.
266
+
267
+ Install skills via `vp-tools install-skill <source>`.
268
+ See: `docs/user/features/skill-registry.md`
@@ -15,6 +15,43 @@ Output this banner as the **first** thing on every invocation — before questio
15
15
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
16
  ```
17
17
  </greeting>
18
+ <version_check>
19
+ ## Version Update Check (ENH-072)
20
+
21
+ After displaying the greeting banner, run:
22
+ ```bash
23
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
24
+ ```
25
+
26
+ **If exit code = 1** (update available — new version printed to stdout):
27
+ Display notice banner before any other output:
28
+ ```
29
+ ┌──────────────────────────────────────────────────────────────────┐
30
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
31
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
32
+ └──────────────────────────────────────────────────────────────────┘
33
+ ```
34
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
35
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
36
+
37
+ **If exit code = 0 or command unavailable**: silent, continue.
38
+
39
+ **Suppression rules:**
40
+ - `--no-update-check` flag on skill invocation → skip this step entirely
41
+ - `config.json` → `update.check: false` → skip this step entirely
42
+ - Show at most once per session (`update_check_done` session guard)
43
+ </version_check>
44
+ <persona_context>
45
+ ## Persona Context Injection (ENH-073)
46
+ At skill start, run:
47
+ ```bash
48
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
49
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
50
+ ```
51
+ Inject the output as `## User Persona` context before any task execution.
52
+ Silent if command unavailable or errors.
53
+ </persona_context>
54
+
18
55
 
19
56
  <cursor_skill_adapter>
20
57
  ## A. Skill Invocation
@@ -84,6 +121,35 @@ Convert brainstorm sessions into structured artifacts for autonomous AI executio
84
121
  **Architect artifacts consumption (FEAT-011):**
85
122
  - Step 1D reads `.viepilot/architect/{session}/notes.md` YAML — imports `decisions[]` → ARCHITECTURE.md, uses `tech_stack{}` as authoritative stack (conflict → ask user), surfaces `open_questions[]` with `status: open`. Soft suggestion (not hard block) when architect dir missing but ≥5 services detected.
86
123
 
124
+ **Admin & Governance Export (ENH-063):**
125
+ - Step 1D item 7: if `admin.html` or `notes.md ## admin` exists in architect workspace → append `## Admin & Governance` table to `.viepilot/PROJECT-CONTEXT.md` (columns: Capability | Required | Phase | Notes) + Admin Personas table. Records `admin_imported` and `admin_capabilities_count` in working notes.
126
+
127
+ **Content Management Export (ENH-065):**
128
+ - Step 1D item 8: if `content.html` or `notes.md ## content` exists in architect workspace → append `## Content Management` table to `.viepilot/PROJECT-CONTEXT.md` (columns: Content Type | Created By | Lifecycle | Key Fields | Phase) + Media/Storage and Localization sub-tables. Records `content_imported` and `content_types_count` in working notes.
129
+
130
+ **Admin Entity Management Export (ENH-068):**
131
+ - Step 1D item 10: if `entity-mgmt.html` or `notes.md ## entity_mgmt` exists in architect workspace → append `## Admin Entity Management` table to `.viepilot/PROJECT-CONTEXT.md` (columns: Entity | CRUD Ops | Soft Delete | Bulk Actions | Audit Trail | Scope) + Import/Export sub-table. Records `entity_mgmt_imported` and `entity_mgmt_entity_count` in working notes.
132
+
133
+ **User Data Management Export (ENH-066):**
134
+ - Step 1D item 9: if `user-data.html` or `notes.md ## user_data` exists in architect workspace → append `## User Data Management` table to `.viepilot/PROJECT-CONTEXT.md` (columns: Capability | Supported | Notes) with 8 capability rows (profile editing, notification prefs, privacy settings, data export, right to erasure, connected accounts, session management, 2FA). Records `user_data_imported` and `user_data_capabilities_count` in working notes.
135
+
136
+ **Crystallize version stamps (ENH-067):**
137
+ - Generated `PROJECT-CONTEXT.md` includes `<!-- crystallize_version: {semver} -->` as its first line.
138
+ - `HANDOFF.json` records `crystallize_version` and `crystallized_at` fields.
139
+ - Used by `--upgrade` re-scan mode to compute delta on future runs.
140
+
141
+ **Upgrade re-scan mode (`--upgrade`) (ENH-067):**
142
+ - Detects `crystallize_version` delta; lists missing PROJECT-CONTEXT.md sections.
143
+ - **Patch mode:** appends only missing sections non-destructively; re-stamps `crystallize_version`.
144
+ - **Full re-generate:** backs up `.viepilot/` → regenerates all artifacts using existing sessions.
145
+ - Integrates brainstorm `## Upgrade supplement` sections when present.
146
+
147
+ **Mandatory Workspace Read Gates (ENH-064):**
148
+ - **Architect workspace (Step 1D):** if `.viepilot/architect/` exists → reads ALL 12 pages front-to-back before any extraction. `architect_read_complete: true` required. Missing `notes.md` → STOP.
149
+ - **UI Direction workspace (Step 1A strengthened):** if `.viepilot/ui-direction/` exists → reads ALL pages/*.html + ALL notes.md sections. `ui_direction_read_complete: true` required. Pages inventory mismatch → STOP.
150
+ - **Cross-reference gate (Step 1F):** when both workspaces present → validates coverage matrix; warns on Phase 1 features with no architect OR UI coverage.
151
+ - **No silent skip**: any workspace that exists MUST be fully read. Partial reads are not allowed.
152
+
87
153
  **Language configuration (ENH-032):**
88
154
  - Step 0-A reads `~/.viepilot/config.json` → `DOCUMENT_LANG` (default: `en`) and `COMMUNICATION_LANG` (default: `en`).
89
155
  - `DOCUMENT_LANG` controls content language for all generated files (ROADMAP, TRACKER, ARCHITECTURE, etc.).
@@ -303,3 +369,19 @@ plain-text numbered list prompts — no configuration required.
303
369
  - Polyrepo related-repos prompt (Step 0-B)
304
370
  - UI direction gate choice (Step 1A)
305
371
  - Architect mode suggestion (Step 1D)
372
+
373
+ ### Step 1E — Skill Decision Gate (FEAT-020)
374
+
375
+ After scope lock, before SPEC generation, crystallize checks for `## skills_used`
376
+ in the brainstorm session's notes.md:
377
+
378
+ - **No skills_used found** → step silently skipped
379
+ - **Skills found** → AUQ presents each skill (required / optional / exclude)
380
+ - **Decision written** to `PROJECT-CONTEXT.md ## Skills`
381
+
382
+ The `## Skills` decision is **final** — `/vp-auto` reads it at execution time
383
+ and injects skill best practices per task without re-prompting.
384
+
385
+ Install skills: `vp-tools install-skill <source>`
386
+ Registry: `vp-tools scan-skills`
387
+ Docs: `docs/user/features/skill-registry.md`
@@ -15,6 +15,43 @@ Output this banner as the **first** thing on every invocation — before questio
15
15
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
16
  ```
17
17
  </greeting>
18
+ <version_check>
19
+ ## Version Update Check (ENH-072)
20
+
21
+ After displaying the greeting banner, run:
22
+ ```bash
23
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
24
+ ```
25
+
26
+ **If exit code = 1** (update available — new version printed to stdout):
27
+ Display notice banner before any other output:
28
+ ```
29
+ ┌──────────────────────────────────────────────────────────────────┐
30
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
31
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
32
+ └──────────────────────────────────────────────────────────────────┘
33
+ ```
34
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
35
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
36
+
37
+ **If exit code = 0 or command unavailable**: silent, continue.
38
+
39
+ **Suppression rules:**
40
+ - `--no-update-check` flag on skill invocation → skip this step entirely
41
+ - `config.json` → `update.check: false` → skip this step entirely
42
+ - Show at most once per session (`update_check_done` session guard)
43
+ </version_check>
44
+ <persona_context>
45
+ ## Persona Context Injection (ENH-073)
46
+ At skill start, run:
47
+ ```bash
48
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
49
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
50
+ ```
51
+ Inject the output as `## User Persona` context before any task execution.
52
+ Silent if command unavailable or errors.
53
+ </persona_context>
54
+
18
55
 
19
56
  <cursor_skill_adapter>
20
57
  ## A. Skill Invocation
@@ -0,0 +1,219 @@
1
+ <greeting>
2
+ ## Invocation Banner
3
+
4
+ Output this banner as the **first** thing on every invocation — before questions, work, or any other output:
5
+
6
+ ```
7
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8
+ VIEPILOT ► VP-DESIGN v1.0.0 (fw 2.45.0)
9
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10
+ ```
11
+ </greeting>
12
+ <version_check>
13
+ ## Version Update Check (ENH-072)
14
+
15
+ After displaying the greeting banner, run:
16
+ ```bash
17
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
18
+ ```
19
+
20
+ **If exit code = 1** (update available — new version printed to stdout):
21
+ Display notice banner before any other output:
22
+ ```
23
+ ┌──────────────────────────────────────────────────────────────────┐
24
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
25
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
26
+ └──────────────────────────────────────────────────────────────────┘
27
+ ```
28
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
29
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
30
+
31
+ **If exit code = 0 or command unavailable**: silent, continue.
32
+
33
+ **Suppression rules:**
34
+ - `--no-update-check` flag on skill invocation → skip this step entirely
35
+ - `config.json` → `update.check: false` → skip this step entirely
36
+ - Show at most once per session (`update_check_done` session guard)
37
+ </version_check>
38
+ <persona_context>
39
+ ## Persona Context Injection (ENH-073)
40
+ At skill start, run:
41
+ ```bash
42
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
43
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
44
+ ```
45
+ Inject the output as `## User Persona` context before any task execution.
46
+ Silent if command unavailable or errors.
47
+ </persona_context>
48
+
49
+ <cursor_skill_adapter>
50
+ ## A. Skill Invocation
51
+ - Skill is triggered when user mentions `vp-design`, `/vp-design`, "design system", "design.md", "sync tokens", "audit design"
52
+ - Treat all user text after the skill mention as `{{VP_ARGS}}`
53
+
54
+ ## B. User Prompting
55
+ Prompt user conversationally with numbered list options at control points.
56
+
57
+ ## C. Tool Usage
58
+ Use Cursor tools: `Shell`, `ReadFile`, `Glob`, `rg`, `ApplyPatch`, `WebSearch`, `WebFetch`, `Subagent`
59
+ </cursor_skill_adapter>
60
+
61
+ <scope_policy>
62
+ ## ViePilot Namespace Guard (BUG-004)
63
+ - Default mode: only use and reference `vp-*` skills in ViePilot workflows.
64
+ - External skills (`non vp-*`) are out of framework scope unless user explicitly opts in.
65
+ - If external skills appear in runtime context, ignore them and route with the closest built-in `vp-*` skill.
66
+ </scope_policy>
67
+
68
+ <implementation_routing_guard>
69
+ ## Implementation routing guard (ENH-021)
70
+
71
+ - This skill manages **design system files** (`design.md`, stylesheet token sync, compliance audit).
72
+ - Does **not** implement application features or replace **`/vp-auto`** for shipping code.
73
+ - After creating/updating `design.md`, run **`/vp-design --sync`** to apply tokens, then continue with **`/vp-auto`** for feature work.
74
+ </implementation_routing_guard>
75
+
76
+ <objective>
77
+ Manage Design.MD design system files for the project (ENH-076).
78
+
79
+ Implements the [Design.MD v1 spec](https://github.com/google-labs-code/design.md) —
80
+ a Google Labs open standard (Apache 2.0) for describing visual design systems to AI coding agents.
81
+
82
+ **Commands:**
83
+ - `--init` : Create `design.md` from scratch via Q&A, or import from awesome-design-md community library (55+ brand examples)
84
+ - `--sync` : Sync design.md tokens → Tailwind config / CSS custom properties / SCSS variables
85
+ - `--audit` : Scan project HTML/CSS files for compliance; report deviations (❌ / ⚠️ / ✅)
86
+ - `--import [brand]` : Fetch community template from awesome-design-md (Linear, Notion, Stripe, Vercel, Figma...)
87
+
88
+ **Creates/Updates:**
89
+ - `design.md` (project root)
90
+ - `tailwind.config.js` / `style.css` / `_variables.scss` (via `--sync`)
91
+
92
+ **Reads:**
93
+ - `design.md` (project root or session directory)
94
+ - HTML/CSS/SCSS files (via `--audit`)
95
+
96
+ **After:** `design.md` is ready for `/vp-crystallize` (Step 1D.14 export) and
97
+ `/vp-auto` (Preflight 5.5 token injection into UI tasks)
98
+ </objective>
99
+
100
+ <execution_context>
101
+ @$HOME/.claude/viepilot/workflows/design.md
102
+ </execution_context>
103
+
104
+ <context>
105
+ **Commands:**
106
+ - `--init` : Create new design.md (Q&A or awesome-design-md import)
107
+ - `--sync` : Sync tokens to project stylesheets (auto-detects Tailwind / CSS vars / SCSS)
108
+ - `--audit` : Compliance report — scan all HTML/CSS vs design.md spec
109
+ - `--import [brand]` : Import community template (omit brand for interactive catalog picker)
110
+
111
+ **Examples:**
112
+ ```bash
113
+ /vp-design --init # Q&A flow to create design.md
114
+ /vp-design --init --import # Import from awesome-design-md catalog
115
+ /vp-design --sync # Sync tokens → detected stylesheet target
116
+ /vp-design --audit # Full compliance report
117
+ /vp-design --import linear # Import Linear design system directly
118
+ /vp-design --import notion # Import Notion design system
119
+ ```
120
+ </context>
121
+
122
+ <process>
123
+ Execute workflow from `@$HOME/.claude/viepilot/workflows/design.md`
124
+
125
+ ### --init flow (Q&A from scratch)
126
+
127
+ 1. **Brand identity:**
128
+ - Brand name?
129
+ - Core personality (3 words — AI suggests: minimal/bold/playful/enterprise/warm/technical)
130
+ - Primary color (hex or describe, AI suggests 4 palette options)
131
+
132
+ 2. **Typography:**
133
+ - Font family (AI suggests: Inter / Geist / Plus Jakarta Sans / Custom)
134
+ - Heading scale (tight compact / balanced standard / spacious editorial)
135
+
136
+ 3. **Spacing & Shape:**
137
+ - Spacing base (4px atomic / 8px standard — Recommended / custom)
138
+ - Corner radius (sharp 0px / subtle 4px / rounded 8px / pill 16px+)
139
+
140
+ 4. **Auto-generate semantic colors** from primary (surface, error, success, warning)
141
+ 5. **Write** `design.md` at project root
142
+
143
+ ### --init flow (awesome-design-md import mode)
144
+
145
+ When user says "import" or triggers `--import`:
146
+ 1. AUQ catalog picker by category (Productivity / Developer / Commerce / Enterprise / Creative)
147
+ 2. Preview selected brand tokens (text table)
148
+ 3. AUQ: Apply as-is / Customize tokens / Use as reference only
149
+
150
+ ### --sync flow
151
+
152
+ 1. Parse `design.md` YAML front matter → TOKEN_MAP
153
+ 2. Detect stack:
154
+ - `tailwind.config.js` exists → Tailwind mode
155
+ - `style.css` only → CSS custom properties mode
156
+ - `*.scss` files → SCSS mode
157
+ - Multiple targets found → AUQ: which target?
158
+ 3. Generate/update target with tokens:
159
+ - **Tailwind:** `theme.extend.colors`, `theme.fontFamily`, `theme.spacing`, `theme.borderRadius`
160
+ - **CSS vars:** `:root { --color-primary: {hex}; --font-sans: {font}; --spacing-base: {n}px; }`
161
+ - **SCSS:** `$color-primary: {hex}; $font-sans: '{font}'; $spacing-base: {n}px;`
162
+ 4. Conflict resolution: AUQ per conflicting token (Override / Merge / Skip)
163
+ 5. Report: "Synced N tokens to {target file}"
164
+
165
+ ### --audit flow
166
+
167
+ 1. Discover all `.html` + `.css` + `.scss` files (exclude `node_modules`, `.git`)
168
+ 2. For each file: extract color/font references → compare vs TOKEN_MAP
169
+ 3. Categorize deviations:
170
+ - **❌ Critical:** wrong font-family, wrong primary/surface color hex
171
+ - **⚠️ Minor:** hardcoded value instead of CSS var (e.g. `#6366f1` instead of `var(--color-primary)`)
172
+ - **✅ Compliant:** uses correct var or correct hex
173
+ 4. Generate report table:
174
+ ```
175
+ | File | Colors | Typography | Spacing | Status |
176
+ | index.html | ✅ | ⚠️ 1 | ✅ | Partial |
177
+ ```
178
+ 5. Summary + suggestion: "Run /vp-design --sync to auto-fix"
179
+
180
+ ### --import [brand] flow
181
+
182
+ 1. Resolve brand:
183
+ - If arg provided → search awesome-design-md catalog for match
184
+ - If no arg → AUQ catalog picker
185
+ 2. Fetch template (runtime from awesome-design-md GitHub raw content)
186
+ 3. Preview: show token table (colors/typography/spacing)
187
+ 4. AUQ: Apply as-is / Customize before applying / Use as reference only
188
+ </process>
189
+
190
+ <success_criteria>
191
+ - [ ] `design.md` created/updated at project root
192
+ - [ ] `--init` produces valid Design.MD v1 spec YAML front matter
193
+ - [ ] `--sync` updates correct target file based on stack detection
194
+ - [ ] `--audit` produces severity-categorized compliance report
195
+ - [ ] `--import` fetches community template and applies per user choice
196
+ - [ ] AUQ used for catalog picker, conflict resolution, apply mode
197
+ </success_criteria>
198
+
199
+ ## Adapter Compatibility
200
+
201
+ ### AskUserQuestion Tool (ENH-059)
202
+
203
+ | Adapter | Interactive Prompts | Notes |
204
+ |---------|---------------------|-------|
205
+ | Claude Code (terminal) | ✅ `AskUserQuestion` — **REQUIRED** | Preload via ToolSearch before first prompt |
206
+ | Cursor / Codex / Antigravity / Copilot | ❌ Text fallback | Plain numbered list |
207
+
208
+ **Claude Code (terminal) — AUQ preload required (ENH-059):**
209
+ Call `ToolSearch` with `query: "select:AskUserQuestion"` before first interactive prompt.
210
+
211
+ **Prompts using AskUserQuestion in this skill:**
212
+ - `--init`: primary color palette selection, font family selection
213
+ - `--init --import`: awesome-design-md catalog picker, apply mode (as-is/customize/reference)
214
+ - `--sync`: conflict resolution per token (Override/Merge/Skip), multi-target selection
215
+ - `--audit`: (report only — no AUQ)
216
+ - `--import`: catalog picker, apply mode
217
+ - Workflow continuation after command completes
218
+ </content>
219
+ </invoke>
@@ -15,6 +15,43 @@ Output this banner as the **first** thing on every invocation — before questio
15
15
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
16
  ```
17
17
  </greeting>
18
+ <version_check>
19
+ ## Version Update Check (ENH-072)
20
+
21
+ After displaying the greeting banner, run:
22
+ ```bash
23
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" check-update --silent
24
+ ```
25
+
26
+ **If exit code = 1** (update available — new version printed to stdout):
27
+ Display notice banner before any other output:
28
+ ```
29
+ ┌──────────────────────────────────────────────────────────────────┐
30
+ │ ✨ ViePilot {latest_version} available (installed: {current}) │
31
+ │ npm i -g viepilot && vp-tools install --target {adapter_id} │
32
+ └──────────────────────────────────────────────────────────────────┘
33
+ ```
34
+ Replace `{latest_version}` with stdout from the command, `{current}` with the installed
35
+ version, `{adapter_id}` with the active adapter (claude-code / cursor / antigravity / codex / copilot).
36
+
37
+ **If exit code = 0 or command unavailable**: silent, continue.
38
+
39
+ **Suppression rules:**
40
+ - `--no-update-check` flag on skill invocation → skip this step entirely
41
+ - `config.json` → `update.check: false` → skip this step entirely
42
+ - Show at most once per session (`update_check_done` session guard)
43
+ </version_check>
44
+ <persona_context>
45
+ ## Persona Context Injection (ENH-073)
46
+ At skill start, run:
47
+ ```bash
48
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona auto-switch
49
+ node "$HOME/.claude/viepilot/bin/vp-tools.cjs" persona context
50
+ ```
51
+ Inject the output as `## User Persona` context before any task execution.
52
+ Silent if command unavailable or errors.
53
+ </persona_context>
54
+
18
55
 
19
56
  <cursor_skill_adapter>
20
57
  ## A. Skill Invocation