viepilot 3.7.2 → 3.8.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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ---
11
11
 
12
+ ## [3.8.0] - 2026-05-24
13
+
14
+ ### Added
15
+ - ENH-098: vp-brainstorm Stakeholder Generation Gate — AI infers domain-appropriate stakeholders
16
+ at end of session, creates `.claude/agents/{project-slug}-{role}.md` agent files (haiku-4-5, Read-only)
17
+ - ENH-098: vp-crystallize Step 1G Stakeholder Review Gate — parallel fan-out of all project
18
+ stakeholder agents, gap analysis synthesis (Gaps/Risks/Suggestions), enriches PROJECT-CONTEXT.md
19
+ before ROADMAP generation; skippable with `--no-stakeholders`
20
+ - `templates/stakeholder-agent.md` — canonical template for generated stakeholder agent files
21
+
22
+ ---
23
+
24
+ ## [3.7.3] - 2026-05-23
25
+
26
+ ### Documentation
27
+ - sync README.md badges to v3.7.3: version, skills (21), workflows (14), tests (2210 passing)
28
+ - add vp-design, vp-intake, vp-persona sections to docs/skills-reference.md (21 skills total)
29
+ - update docs/dev/architecture.md orchestration model — ENH-096/097 delegation: tracker-agent, vp-git-agent, read+spawn-only orchestrator
30
+ - remove confusing dual-version paragraph from README.md versioning note
31
+
32
+ ---
33
+
12
34
  ## [3.7.2] - 2026-05-23
13
35
 
14
36
  ### Added — ENH-097: vp-auto Full Orchestrator Delegation (Phase 142)
package/README.md CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  **Autonomous Vibe Coding Framework / Bộ khung phát triển tự động có kiểm soát**
4
4
 
5
- [![Version](https://img.shields.io/badge/version-3.1.1-blue.svg)](CHANGELOG.md)
5
+ [![Version](https://img.shields.io/badge/version-3.8.0-blue.svg)](CHANGELOG.md)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
7
- [![Skills](https://img.shields.io/badge/skills-18-purple.svg)](#skills-reference)
8
- [![Workflows](https://img.shields.io/badge/workflows-13-orange.svg)](#workflows)
9
- [![Templates](https://img.shields.io/badge/templates-17-cyan.svg)](#templates)
10
- [![Tests](https://img.shields.io/badge/tests-1324%20passing-brightgreen.svg)](tests/)
7
+ [![Skills](https://img.shields.io/badge/skills-21-purple.svg)](#skills-reference)
8
+ [![Workflows](https://img.shields.io/badge/workflows-14-orange.svg)](#workflows)
9
+ [![Templates](https://img.shields.io/badge/templates-18-cyan.svg)](#templates)
10
+ [![Tests](https://img.shields.io/badge/tests-2210%20passing-brightgreen.svg)](tests/)
11
11
  [![GitHub](https://img.shields.io/github/stars/0-CODE/viepilot?style=social)](https://github.com/0-CODE/viepilot)
12
12
 
13
- **Versioning:** Shield **2.19.0** is the **ViePilot framework SemVer** tracked in `.viepilot/TRACKER.md` and `CHANGELOG.md`. The npm `package.json` field `version` (**2.19.0**) is the Node package identifier for this repo; use the framework version for milestone releases and docs.
13
+ **Version**: `3.8.0` tracked in `package.json`, `CHANGELOG.md`, and `.viepilot/TRACKER.md`.
14
14
 
15
15
  ViePilot là bộ skill framework cho phép AI assistant (Claude, GPT, etc.) phát triển dự án một cách **tự động**, **có kiểm soát**, và **có thể khôi phục**. Thiết kế theo các tiêu chuẩn chuyên nghiệp: Semantic Versioning, Conventional Commits, Keep a Changelog.
16
16
 
@@ -28,13 +28,13 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
28
28
 
29
29
  | Chỉ số / Metric | Giá trị / Value |
30
30
  |-----------------|-----------------|
31
- | Total LOC | **~51,713+** (`.md`, `.js`, `.cjs`, `.yml`, `.json`, `.sh`; không gồm `node_modules`) |
32
- | Skills | **18** |
33
- | Workflows | **12** |
34
- | Templates | **17** (Project: 12, Phase: 5) |
31
+ | Total LOC | **~94,739+** (`.md`, `.js`, `.cjs`, `.yml`, `.json`, `.sh`; không gồm `node_modules`) |
32
+ | Skills | **21** |
33
+ | Workflows | **14** |
34
+ | Templates | **18** (Project: 13, Phase: 5) |
35
35
  | CLI Commands | **18** (`vp-tools` 17 subcommands + `viepilot` installer) |
36
- | Tests | **607** (34 suites: unit + integration + AI compat + README metrics + UI direction + ENH contracts + scope policy + FEAT-009/010/011/012/013/015 + ENH-021~037 routing/language/architect/adapter + BUG-009~013 guards + viepilot-info/update/install/adapters) |
37
- | ViePilot phases (local `.viepilot`) | **62** phase cycles — **v2.4.0** FEAT-015 Codex adapter; **v2.3.x** ENH-036~037 installer cleanup; **v2.0.0** FEAT-013 dynamic adapters; **v1.x** M1.29 (FEAT-001~013); xem `CHANGELOG.md` |
36
+ | Tests | **2210** (111 suites: unit + integration + AI compat + README metrics + UI direction + ENH contracts + scope policy + FEAT-009/010/011/012/013/015 + ENH-021~037 routing/language/architect/adapter + BUG-009~013 guards + viepilot-info/update/install/adapters) |
37
+ | ViePilot phases (local `.viepilot`) | **142** phase cycles — **v3.7.x** ENH-095~097 orchestrator delegation; **v3.0.0** M3.0 Per-Adapter Intelligence; **v2.4.0** FEAT-015 Codex; **v2.0.0** FEAT-013 dynamic adapters; xem `CHANGELOG.md` |
38
38
  | Standards | 5 (SemVer, Commits, Changelog, Comments, Contributors) |
39
39
 
40
40
  > Metric `Total LOC` có thể được refresh tự động bằng `npm run readme:sync` (dùng `cloc`; nếu thiếu `cloc` script sẽ fallback an toàn).
@@ -43,29 +43,29 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
43
43
 
44
44
  | Thành phần / Component | Số lượng / Count | Mô tả / Description |
45
45
  |------------------------|------------------|---------------------|
46
- | Skill Definitions | **17** | SKILL.md files với trigger, process, success criteria |
47
- | Workflow Files | **12** | Step-by-step execution guides |
46
+ | Skill Definitions | **21** | SKILL.md files với trigger, process, success criteria |
47
+ | Workflow Files | **14** | Step-by-step execution guides |
48
48
  | Project Templates | 12 | AI-GUIDE, ARCHITECTURE, VIEPILOT-META, README, SYSTEM-RULES, etc. |
49
49
  | Phase Templates | 5 | SPEC, PHASE-STATE, TASK, VERIFICATION, SUMMARY |
50
50
  | CLI Tools | 2 | vp-tools.cjs (**17** subcommands) + viepilot.cjs (guided installer) |
51
- | Test Files | 34 | Jest: 33 unit + 1 integration (contracts, installer + Claude paths, info/update, FEAT-009/010/011~015, ENH-021~037, BUG-009~013 guards, adapter tests, scope policy, …) |
51
+ | Test Files | 111 | Jest: 111 test files (contracts, installer + Claude paths, info/update, FEAT-009/010/011~015, ENH-021~037, BUG-009~013 guards, adapter tests, scope policy, …) |
52
52
 
53
53
  ---
54
54
 
55
55
  ## Độ hoàn thiện / Completion Status
56
56
 
57
57
  ```
58
- Tổng thể / Overall: ████████████████████ ~99% ✅ Latest **v2.4.0** FEAT-015 Codex adapter; **v2.3.x** ENH-036~037 installer cleanup; **v2.1.x** BUG-009~013; **v2.0.0** FEAT-013 dynamic adapters
58
+ Tổng thể / Overall: ████████████████████ ~99% ✅ Latest **v3.7.3** ENH-095~097 orchestrator delegation; **v3.0.0** M3.0 Per-Adapter Intelligence; **v2.4.0** FEAT-015 Codex adapter; **v2.0.0** FEAT-013 dynamic adapters
59
59
  ```
60
60
 
61
61
  | Lĩnh vực / Area | Trạng thái | Chi tiết |
62
62
  |-----------------|------------|----------|
63
- | Core Skills (18) | ✅ Hoàn thiện | brainstorm, crystallize, auto, pause, resume, status, info, request, evolve, docs, update, task, debug, rollback, audit, ui-components, proposal, **skills** |
64
- | Workflows (13) | ✅ Hoàn thiện | Full step-by-step guides với success criteria |
63
+ | Core Skills (21) | ✅ Hoàn thiện | brainstorm, crystallize, auto, pause, resume, status, info, request, evolve, docs, update, task, debug, rollback, audit, ui-components, proposal, skills, **design, intake, persona** |
64
+ | Workflows (14) | ✅ Hoàn thiện | Full step-by-step guides với success criteria |
65
65
  | Project Templates (12) | ✅ Hoàn thiện | Placeholders cho customization (+ `VIEPILOT-META` FEAT-009) |
66
66
  | Phase Templates (5) | ✅ Hoàn thiện | Task tracking, verification, summary |
67
67
  | CLI Tools (18) | ✅ Hoàn thiện | vp-tools 17 subcommands + viepilot installer; bundle `info` / `update` |
68
- | Tests (957) | ✅ Hoàn thiện | Unit, integration, AI compat, workflow contracts, installer, scope policy, FEAT-009~015, ENH-021~048, BUG-009~013, adapter tests, AskUserQuestion adapter-aware prompts |
68
+ | Tests (2210) | ✅ Hoàn thiện | Unit, integration, AI compat, workflow contracts, installer, scope policy, FEAT-009~015, ENH-021~048, BUG-009~013, adapter tests, AskUserQuestion adapter-aware prompts |
69
69
  | CI/CD | ✅ Hoàn thiện | GitHub Actions, Node 18/20/22 matrix, coverage >80% |
70
70
  | Documentation | ✅ Hoàn thiện | dev/, user/, api/, videos/, examples/, troubleshooting |
71
71
  | Standards | ✅ Hoàn thiện | SemVer, Conventional Commits, Keep a Changelog |
@@ -167,6 +167,7 @@ Tổng thể / Overall: ██████████████████
167
167
  | `CONTRIBUTING.md` | Contribution guidelines |
168
168
  | `CONTRIBUTORS.md` | Attribution list |
169
169
  | `README.md` | Professional README template |
170
+ | `stakeholder-agent.md` | Agent template for stakeholder reviews (generated by vp-brainstorm Step S2) |
170
171
 
171
172
  ### Phase Templates (5)
172
173
 
@@ -216,6 +216,32 @@ User Request
216
216
  | No external runtime | Works with any AI assistant |
217
217
  | CommonJS (no ESM) | Maximum Node.js compatibility |
218
218
 
219
+ ## Agent Orchestration Model (ENH-096/097)
220
+
221
+ As of v3.7.2, the vp-auto orchestrator is **read + spawn only**. It never calls Edit, Write, or Bash for any write operation. All work is delegated to specialized subagents:
222
+
223
+ | Agent | Role | Tools Permitted |
224
+ |-------|------|-----------------|
225
+ | vp-auto orchestrator | Read state, spawn workers, gate phase transitions | Read, Bash (read-only git only), Agent |
226
+ | vp-task-executor | All implementation — code, docs, config edits | Read, Edit, Write, MultiEdit, Bash, Glob, Grep, LS |
227
+ | vp-quality-gate | Run verification commands, report PASS/FAIL | Read, Bash, Grep, Glob, LS |
228
+ | vp-phase-planner | Build dependency graph, identify parallel task clusters | Read, Glob, Grep, LS |
229
+ | tracker-agent | Write state files: PHASE-STATE.md, TRACKER.md, HANDOFF.json, ROADMAP.md | Read, Edit, Write |
230
+ | vp-git-agent | Git operations: create-tag, push-branch, push-tags, push-all, git-status | Bash only |
231
+ | changelog-agent | Write CHANGELOG.md entries for features and fixes | Read, Edit, Write |
232
+
233
+ **Result formats:**
234
+ - `TASK_RESULT: PASS | FAIL | PARTIAL` — returned by vp-task-executor and vp-quality-gate
235
+ - `GIT_RESULT: PASS | FAIL | SKIP` — returned by vp-git-agent
236
+
237
+ **Orchestration flow:**
238
+ 1. Orchestrator reads PHASE-STATE.md + task contracts
239
+ 2. Spawns tracker-agent → set tasks `in_progress`
240
+ 3. Spawns vp-task-executor(s) — parallel fan-out for independent tasks
241
+ 4. Spawns vp-quality-gate for each completed task
242
+ 5. On PASS: spawns tracker-agent → mark task done, update HANDOFF.json
243
+ 6. On phase complete: spawns vp-git-agent (tag + push), tracker-agent (ROADMAP update), changelog-agent
244
+
219
245
  ## Extension Points
220
246
 
221
247
  | Point | How to Extend |
@@ -547,3 +547,99 @@ Full guide: `docs/user/features/proposal.md`
547
547
  - Fallback: `~/.cursor/viepilot/bin/vp-tools.cjs` for Cursor adapter.
548
548
  - Registry file: `~/.viepilot/skill-registry.json` — shared across all projects.
549
549
  - Confirmation AUQ prompt before destructive `uninstall` (Claude Code terminal only).
550
+
551
+ ---
552
+
553
+ ## /vp-design
554
+
555
+ Visual/UI direction skill. Generates UI architecture: component map, color system, typography,
556
+ responsive breakpoints, and Pencil design file integration.
557
+
558
+ ### Triggers
559
+ `vp-design`, `/vp-design`, "thiết kế UI", "UI direction", "design system"
560
+
561
+ ### Flags
562
+ - `--new` : Start fresh UI direction session
563
+ - `--component <name>` : Design a specific component
564
+ - `--mobile` : Mobile-first emphasis
565
+ - `--architect` : Generate Architect HTML view alongside
566
+
567
+ ### Flow
568
+ 1. Collect product goals + target audience + brand constraints
569
+ 2. Generate UI direction: color palette, typography, spacing scale, component inventory
570
+ 3. Output Pencil design stubs (if Pencil MCP available) or Architect HTML fallback
571
+ 4. Write `docs/ui-direction.md` and `PROJECT-CONTEXT.md ## UI Direction`
572
+
573
+ ### Output
574
+ - `docs/ui-direction.md` (created/updated)
575
+ - `PROJECT-CONTEXT.md` UI Direction section (locked by `/vp-crystallize` Step 1E)
576
+ - Optional: Pencil `.pen` file stubs via `mcp__pencil__batch_design`
577
+
578
+ ### Adapter-Aware Prompts
579
+ Uses `AskUserQuestion` on Claude Code terminal for design-direction questions.
580
+
581
+ ---
582
+
583
+ ## /vp-intake
584
+
585
+ Structured intake from Google Sheets, Excel (M365), CSV files, and browser URLs. Reads rows
586
+ from a configured source, creates ViePilot request files, and optionally writes results back.
587
+
588
+ ### Triggers
589
+ `vp-intake`, `/vp-intake`, "đọc intake", "intake từ sheet", "load requests from sheet"
590
+
591
+ ### Flags
592
+ - `--channel <id>` : Force a specific intake channel (sheets/excel/csv/browser)
593
+ - `--dry-run` : Parse and triage without writing request files
594
+ - `--no-writeback` : Skip writing results back to source
595
+ - `--setup` : Launch AUQ-driven channel configuration wizard (ENH-084)
596
+
597
+ ### Flow
598
+ 1. Load intake manifest (`~/.viepilot/intake-manifests/<project>.json`) or prompt setup
599
+ 2. Read rows from configured channel (Google Sheets via API, Excel via M365 Graph, CSV, or browser-agent for public URLs)
600
+ 3. Triage each row: detect type (bug/feature/enhancement/debt), extract title/description
601
+ 4. Create `.viepilot/requests/{TYPE}-{N}.md` for each valid row
602
+ 5. Write-back status column to source row (if writable channel)
603
+
604
+ ### Output
605
+ - `.viepilot/requests/{TYPE}-{N}.md` per intake row
606
+ - Intake manifest updated with last-read cursor
607
+ - Source row status updated (write-back, if enabled)
608
+
609
+ ### Adapters
610
+ Full support: Claude Code. Partial: Cursor (no AUQ). Text fallback: Codex/Copilot/Antigravity.
611
+
612
+ ---
613
+
614
+ ## /vp-persona
615
+
616
+ Manages the global developer persona profile stored in `~/.viepilot/config.json`. Persona
617
+ controls output style, stack preferences, and team-size assumptions injected into every skill.
618
+
619
+ ### Triggers
620
+ `vp-persona`, `/vp-persona`, "cấu hình persona", "set persona", "developer profile"
621
+
622
+ ### Flags
623
+ - `--set` : Interactively set persona fields
624
+ - `--show` : Print current active persona
625
+ - `--auto-switch` : Switch persona based on current project stack (used internally by skills)
626
+ - `--context` : Print persona as `## User Persona` block (used by skill banners)
627
+
628
+ ### Persona Fields
629
+ | Field | Values | Default |
630
+ |-------|--------|---------|
631
+ | `role` | backend / frontend / fullstack / devops / data / mobile | backend |
632
+ | `domain` | web-saas / mobile / api / data / infra / other | web-saas |
633
+ | `stacks` | comma-separated list | — |
634
+ | `outputStyle` | lean / verbose | lean |
635
+ | `phaseTemplate` | lean-startup / enterprise / research | lean-startup |
636
+ | `teamSize` | solo / small / medium / large | solo |
637
+
638
+ ### Flow
639
+ 1. `vp-tools persona auto-switch` — detects stack from package.json / pyproject.toml / build.gradle
640
+ 2. `vp-tools persona context` — outputs `## User Persona` markdown block
641
+ 3. Skills inject this block silently before task execution
642
+
643
+ ### Output
644
+ - `~/.viepilot/config.json` updated
645
+ - `## User Persona` injected into each skill session
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viepilot",
3
- "version": "3.7.2",
3
+ "version": "3.8.0",
4
4
  "description": "**Autonomous Vibe Coding Framework / Bộ khung phát triển tự động có kiểm soát**",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -201,6 +201,7 @@ Optional flags:
201
201
  - `--research` : Enable proactive research suggestions during the session
202
202
  - `--ui` : Enable UI Direction mode (live HTML/CSS direction artifacts + auto-generates `design.md` when design keywords present — ENH-076)
203
203
  - `--domain embedded` : Force-activate Embedded Domain Mode (hardware topology, RTOS, pin map, memory layout, protocol matrix, power budget pages + topic probes)
204
+ - `--no-stakeholders` : Skip stakeholder agent generation at session end
204
205
 
205
206
  ### Reference URL Input (ENH-092)
206
207
 
@@ -279,6 +280,11 @@ Key steps:
279
280
  9. Before completing the session: **step 5 — Project meta intake (FEAT-009)** in `workflows/brainstorm.md` when binding is missing; sequential Q&A + profile-map disambiguation + write global profile + `.viepilot/META.md`
280
281
  10. Save session with structured format (including **`## Project meta intake (FEAT-009)`**, research notes + UI direction references + **`## Phases`**)
281
282
  11. Suggest next action: `/vp-crystallize`
283
+
284
+ **Stakeholder Generation (ENH-098):**
285
+ At session end (scope locked), automatically infers project stakeholders from the domain and
286
+ creates `.claude/agents/{project-slug}-{role}.md` agent files. These are consumed by
287
+ `/vp-crystallize` Step 1G for parallel context review. Skip with `--no-stakeholders`.
282
288
  </process>
283
289
 
284
290
  <success_criteria>
@@ -58,6 +58,9 @@ Silent if command unavailable or errors.
58
58
  - Skill được gọi khi user mention `vp-crystallize`, `/vp-crystallize`, hoặc "crystallize", "setup project"
59
59
  - Treat all user text after the skill mention as `{{VP_ARGS}}`
60
60
 
61
+ **Flags:**
62
+ - `--no-stakeholders` : Skip the Step 1G Stakeholder Review Gate (ENH-098)
63
+
61
64
  ## B. User Prompting
62
65
  Prompt user conversationally with numbered list options.
63
66
 
@@ -434,3 +437,14 @@ and injects skill best practices per task without re-prompting.
434
437
  Install skills: `vp-tools install-skill <source>`
435
438
  Registry: `vp-tools scan-skills`
436
439
  Docs: `docs/user/features/skill-registry.md`
440
+
441
+ ### Step 1F — Cross-Reference Gate
442
+
443
+ Validates coverage matrix when both Architect and UI Direction workspaces are present.
444
+ Warns on Phase 1 features with no architect OR UI coverage (non-blocking).
445
+
446
+ ### Step 1G — Stakeholder Review Gate (ENH-098)
447
+
448
+ After scope lock, spawns `.claude/agents/` stakeholder agents in parallel fan-out,
449
+ collects gap analysis (Gaps/Risks/Suggestions), synthesizes feedback to enrich
450
+ PROJECT-CONTEXT.md before ROADMAP generation. Can be skipped with `--no-stakeholders` flag.
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: {{project_slug}}-{{role_slug}}
3
+ description: >
4
+ Stakeholder reviewer for {{PROJECT_NAME}}. Reviews the project context document
5
+ from the perspective of a {{ROLE_TITLE}}. Returns a structured gap analysis
6
+ (Gaps / Risks / Suggestions) to enrich PROJECT-CONTEXT.md.
7
+ model: claude-haiku-4-5
8
+ tools:
9
+ - Read
10
+ ---
11
+
12
+ You are a **{{ROLE_TITLE}}** reviewing the initial project definition for **{{PROJECT_NAME}}**.
13
+
14
+ ## Your Perspective
15
+
16
+ {{ROLE_DESCRIPTION}}
17
+
18
+ ## What You Care About
19
+
20
+ {{ROLE_CONCERNS}}
21
+
22
+ ## Your Task
23
+
24
+ Read the project context file at `.viepilot/PROJECT-CONTEXT.md`.
25
+
26
+ Evaluate it from your professional perspective and return a structured review:
27
+
28
+ ### Gaps
29
+
30
+ List definitions, sections, or decisions that are vague, missing, or contradictory
31
+ from your point of view.
32
+
33
+ *(Maximum 5 items. One sentence each.)*
34
+
35
+ ### Risks
36
+
37
+ List concerns, assumptions, or red flags that could cause problems during execution
38
+ or deployment.
39
+
40
+ *(Maximum 5 items. One sentence each.)*
41
+
42
+ ### Suggestions
43
+
44
+ List specific additions, clarifications, or reframings that would make the project
45
+ context more complete and actionable from your perspective.
46
+
47
+ *(Maximum 5 items. One sentence each.)*
48
+
49
+ ---
50
+
51
+ > Return ONLY the structured review above. Do not summarize the project or ask questions.
@@ -2111,6 +2111,107 @@ git push
2111
2111
  ```
2112
2112
  </step>
2113
2113
 
2114
+ <step name="stakeholder_gate">
2115
+ ## 6B. Stakeholder Generation Gate (ENH-098)
2116
+
2117
+ Executed automatically after scope is locked and summary is written.
2118
+ Skipped if: `--no-stakeholders` flag present in session context, or `config.json → crystallize.stakeholders.enabled: false`.
2119
+
2120
+ ### Step S1: Infer Stakeholders
2121
+
2122
+ From the brainstorm summary, extract:
2123
+ - `domain`: the product domain (web-saas, mobile, api, data, e-commerce, infra, other)
2124
+ - `product_type`: what kind of product (SaaS, marketplace, internal tool, SDK, mobile app, etc.)
2125
+ - `team_size`: from PROJECT-META or persona context (solo/small/medium/large)
2126
+ - `project_slug`: short kebab-case name derived from project title (e.g., "myapp", "invoice-app")
2127
+
2128
+ Determine stakeholder count:
2129
+ - solo + simple domain: 3 stakeholders
2130
+ - medium complexity: 4–5 stakeholders
2131
+ - enterprise / regulated (fintech, health, legal): 6 stakeholders
2132
+
2133
+ Generate stakeholder list based on domain. Examples:
2134
+
2135
+ | Domain | Stakeholders |
2136
+ |--------|--------------|
2137
+ | **web-saas** | cto, product-manager, ux-lead, end-user, business-owner |
2138
+ | **mobile** | product-owner, mobile-developer, end-user, app-store-reviewer |
2139
+ | **api/platform** | platform-engineer, api-consumer, devops-lead, sre |
2140
+ | **e-commerce** | business-owner, customer, marketing-manager, logistics-manager |
2141
+ | **data/ml** | data-scientist, ml-engineer, business-analyst, end-user |
2142
+ | **other** | infer contextually from brainstorm content |
2143
+
2144
+ ### Step S2: Write Agent Files
2145
+
2146
+ For each stakeholder, create a file at `.claude/agents/{project_slug}-{role_slug}.md` using the template from `templates/stakeholder-agent.md`.
2147
+
2148
+ Template structure:
2149
+ ```markdown
2150
+ ---
2151
+ name: {project_slug}-{role_slug}
2152
+ description: Stakeholder reviewer for {PROJECT_NAME}. Reviews project context from the
2153
+ perspective of a {ROLE_TITLE}. Returns gap analysis (Gaps/Risks/Suggestions).
2154
+ model: claude-haiku-4-5
2155
+ tools:
2156
+ - Read
2157
+ ---
2158
+
2159
+ You are a {ROLE_TITLE} reviewing the project definition for **{PROJECT_NAME}**.
2160
+
2161
+ ## Your Perspective
2162
+ {2-3 sentence role description — who you are, what you own, what matters to you}
2163
+
2164
+ ## What You Care About
2165
+ {4-6 bullet points of specific concerns from this role's angle}
2166
+
2167
+ ## Your Task
2168
+ Read `.viepilot/PROJECT-CONTEXT.md`. Return a structured review with three sections:
2169
+
2170
+ ### Gaps
2171
+ (sections/definitions that are vague, missing, or contradictory from your perspective)
2172
+
2173
+ ### Risks
2174
+ (concerns or red flags that could cause execution problems)
2175
+
2176
+ ### Suggestions
2177
+ (specific additions or clarifications to strengthen the context)
2178
+
2179
+ Keep each item to 1 sentence. Maximum 5 items per section.
2180
+ ```
2181
+
2182
+ Substitute variables:
2183
+ - `{{project_slug}}` → kebab-case project identifier
2184
+ - `{{role_slug}}` → kebab-case role identifier
2185
+ - `{{PROJECT_NAME}}` → Full project name
2186
+ - `{{ROLE_TITLE}}` → Human-readable role title
2187
+ - `{{ROLE_DESCRIPTION}}` → 2-3 sentence persona description
2188
+ - `{{ROLE_CONCERNS}}` → 4-6 bullet list of role-specific concerns
2189
+
2190
+ Write each file using the Edit/Write tool. Path is relative to project root (where `.claude/` lives).
2191
+
2192
+ > **Note**: `.claude/agents/` is the project-level agents directory for Claude Code.
2193
+ > For other adapters (Cursor, Codex): skip this step gracefully — agent files won't be created,
2194
+ > and the crystallize Step 1G will detect no agents and skip the review gate.
2195
+
2196
+ ### Step S3: Record in Summary
2197
+
2198
+ Append a `## Stakeholders Generated` section to the brainstorm session summary output:
2199
+
2200
+ ```markdown
2201
+ ## Stakeholders Generated
2202
+
2203
+ The following stakeholder agents have been created in `.claude/agents/`:
2204
+
2205
+ | File | Role | Perspective |
2206
+ |------|------|-------------|
2207
+ | `{project_slug}-cto.md` | CTO | Technical feasibility, stack, security |
2208
+ | `{project_slug}-product-manager.md` | Product Manager | Scope, user stories, priorities |
2209
+ | ... | ... | ... |
2210
+
2211
+ These agents will be called in vp-crystallize Step 1G to review PROJECT-CONTEXT.md.
2212
+ ```
2213
+ </step>
2214
+
2114
2215
  <step name="arch_to_ui_sync">
2115
2216
  ## 6C. Architect → UI Direction Sync (ENH-061)
2116
2217
 
@@ -2205,6 +2205,90 @@ Run when BOTH `architect_read_complete: true` AND `ui_direction_read_complete: t
2205
2205
  **Skip condition**: if only one workspace is present (not both) → silently skip Step 1F (single-workspace is valid).
2206
2206
  </step>
2207
2207
 
2208
+ <step name="stakeholder_review_gate">
2209
+ ---
2210
+
2211
+ ## Step 1G: Stakeholder Review Gate (ENH-098)
2212
+
2213
+ **Trigger**: Runs automatically after Step 1F, before Step 2.
2214
+
2215
+ **Skip conditions**:
2216
+ - `--no-stakeholders` flag passed to `/vp-crystallize`
2217
+ - `config.json → crystallize.stakeholders.enabled: false`
2218
+ - No `.claude/agents/{project-slug}-*.md` files found (gate is silently skipped)
2219
+ - Non-Claude-Code adapter (Cursor, Codex, Copilot): skip gracefully
2220
+
2221
+ ### Step 1G.1 — Discover Stakeholder Agents
2222
+
2223
+ ```bash
2224
+ # Find project stakeholder agents
2225
+ ls .claude/agents/ | grep "^{project_slug}-"
2226
+ ```
2227
+
2228
+ If 0 files found: print notice "No stakeholder agents found — skipping Step 1G. Run `/vp-brainstorm` first to generate stakeholder agents, or use `--no-stakeholders` to suppress."
2229
+ Then continue to Step 2.
2230
+
2231
+ If files found: proceed.
2232
+
2233
+ ### Step 1G.2 — Parallel Stakeholder Review
2234
+
2235
+ Spawn all found stakeholder agents simultaneously (parallel fan-out):
2236
+
2237
+ For each `.claude/agents/{project_slug}-{role_slug}.md`:
2238
+ ```
2239
+ Agent({
2240
+ subagent: "{project_slug}-{role_slug}",
2241
+ prompt: "Read .viepilot/PROJECT-CONTEXT.md. Return your structured review (Gaps/Risks/Suggestions)."
2242
+ })
2243
+ ```
2244
+
2245
+ Collect all results. Each result is a structured document with three sections:
2246
+ - `### Gaps` — missing or vague definitions
2247
+ - `### Risks` — execution concerns from this role's perspective
2248
+ - `### Suggestions` — specific additions to strengthen the context
2249
+
2250
+ ### Step 1G.3 — Synthesis
2251
+
2252
+ After all agents return:
2253
+
2254
+ 1. **Aggregate**: collect all Gaps, Risks, Suggestions across all stakeholders
2255
+ 2. **Deduplicate**: merge identical or near-identical points
2256
+ 3. **Rank**: sort by frequency (raised by ≥2 stakeholders = high priority) and severity
2257
+ 4. **Conflict resolution**: if stakeholders disagree (e.g., CTO wants more tech detail, PM wants less), note both perspectives and use the more conservative approach
2258
+ 5. **Filter**: discard suggestions that are already addressed in PROJECT-CONTEXT.md
2259
+
2260
+ ### Step 1G.4 — Enrich PROJECT-CONTEXT.md
2261
+
2262
+ Apply the top-ranked suggestions to `.viepilot/PROJECT-CONTEXT.md`:
2263
+
2264
+ - Add missing sections (e.g., `## Security Considerations`, `## Success Metrics`)
2265
+ - Expand vague definitions with the suggested specifics
2266
+ - Flag unresolved conflicts as `> ⚠️ Open question: {conflict}` inline
2267
+ - Do NOT remove or replace existing content — only add/clarify
2268
+
2269
+ ### Step 1G.5 — Stakeholder Review Summary Banner
2270
+
2271
+ Display to user:
2272
+
2273
+ ```
2274
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2275
+ STAKEHOLDER REVIEW COMPLETE ✓
2276
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2277
+
2278
+ Stakeholders reviewed: {N}
2279
+ Gaps found: {count} ({high-priority} high priority)
2280
+ Risks flagged: {count}
2281
+ Enrichments applied: {count} additions to PROJECT-CONTEXT.md
2282
+ Open questions: {count} (flagged inline for your review)
2283
+
2284
+ Reviewers: {role_1}, {role_2}, ..., {role_N}
2285
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2286
+ ```
2287
+
2288
+ Then continue to Step 2 (ROADMAP generation).
2289
+
2290
+ </step>
2291
+
2208
2292
  <step name="generate_ai_guide">
2209
2293
  ## Step 2: Generate AI-GUIDE.md
2210
2294