viepilot 1.9.10 → 1.14.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
@@ -7,9 +7,90 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Planned
10
+ ## [1.14.0] - 2026-04-06
11
11
 
12
- - None.
12
+ ### Changed (ENH-030 — Phase 46)
13
+
14
+ - **Remove MVP/Post-MVP/Future concept** — all projects now use phase-based planning only:
15
+ - `workflows/brainstorm.md`: replaced `## Product horizon` section + ENH-014 rule with Phase assignment rule (ENH-030) and `## Phases` session template
16
+ - `workflows/crystallize.md`: replaced Horizon validation gate with Phase assignment gate; Step 7 ROADMAP generation now uses `phases_inventory` (no Post-MVP block)
17
+ - `templates/architect/feature-map.html`: mindmap nodes + badge classes updated — MVP/Post-MVP/Future → Phase 1/Phase 2/Phase 3
18
+ - `templates/architect/style.css`: `.badge-mvp/.badge-post-mvp/.badge-future` → `.badge-phase-1/.badge-phase-2/.badge-phase-3`
19
+ - `templates/architect/user-use-cases.html`: Priority column → Phase; badge-mvp/post-mvp/future → badge-phase-1/2/3
20
+ - `templates/architect/index.html`: feature map subtitle updated (no MVP/Post-MVP text)
21
+ - `templates/project/PROJECT-CONTEXT.md`: MVP boundary + Post-MVP themes sections replaced with Project scope + Phase overview table
22
+ - `templates/project/ROADMAP.md`: Post-MVP / Product horizon block removed; maintenance note updated
23
+ - `templates/project/AI-GUIDE.md`: all MVP/horizon reading instructions replaced with phase-centric equivalents
24
+ - `skills/vp-brainstorm/SKILL.md` v1.1.0: phase assignment rule replaces product horizon rule
25
+ - `skills/vp-crystallize/SKILL.md` v0.8.0: phase assignment gate replaces horizon gate
26
+ - `skills/vp-task/SKILL.md`: example updated (no MVP reference)
27
+
28
+ ### Tests
29
+ - Added `tests/unit/vp-enh030-no-mvp-contracts.test.js` (10 tests) — all pass (372 total)
30
+
31
+ ## [1.13.0] - 2026-04-04
32
+
33
+ ### Added
34
+
35
+ - **ENH-029 — Architect Design Mode: C4/Sequence/Deployment/APIs pages (12-page workspace)**:
36
+ - `templates/architect/architecture.html`: C4 Context diagram section (Mermaid `C4Context`) + External Systems table (6 columns: System/Type/Description/Integration method/Owned by/Notes).
37
+ - `templates/architect/sequence-diagram.html` (new): per-scenario sequences — Scenario Index table, 2 placeholder `sequenceDiagram` blocks, differentiation note linking to data-flow.html.
38
+ - `templates/architect/deployment.html` (new): infra `graph TD` with dev/staging/prod, Environments table, Infrastructure Components table, CI/CD `flowchart LR`.
39
+ - `templates/architect/apis.html` (new): per-service endpoint tables (Method/Path/Auth?/Request Body/Response/Status codes/Notes), HTTP method badges, API Design Decisions table with style badges.
40
+ - `templates/architect/style.css`: 5 HTTP method badge classes (`.method-get/post/put/delete/patch`).
41
+ - All 12 architect pages updated with full 12-item sidebar nav (Sequence + Deployment + APIs items added to all existing pages).
42
+ - `templates/architect/index.html`: 3 new hub cards (Sequence Diagram, Deployment, APIs); Architecture card subtitle updated.
43
+ - `workflows/brainstorm.md`: Page Boundary Rules table; Sequence/Deployment/APIs trigger keyword sections; C4Context added to diagram types; `## apis` YAML schema section; 3 new pages in workspace layout.
44
+ - `workflows/crystallize.md` Step 1D: steps 5–6 extract `deployment.html`/`notes.md ## deployment` → `## Deployment & Infrastructure` and `apis.html`/`notes.md ## apis` → `## API Design` in ARCHITECTURE.md; sequence-diagram.html explicitly excluded with rationale.
45
+ - `skills/vp-brainstorm/SKILL.md`: ENH-029 capability note added.
46
+ - `tests/unit/vp-enh029-architect-pages-contracts.test.js` (new): 11 contract tests — all pass (362 total).
47
+
48
+ ## [1.12.0] - 2026-04-04
49
+
50
+ ### Added
51
+
52
+ - **ENH-027 — Architect Design Mode: ERD page**:
53
+ - `templates/architect/erd.html` (new): Mermaid `erDiagram` with sample entities (User/Order/OrderItem/Product), Entity List table (Entity/Attributes/PK/FK/Notes), Relationship Summary table.
54
+ - `workflows/brainstorm.md`: ERD trigger keywords (entity, table, relationship, foreign key, schema, DB, database); `## erd` section in notes.md YAML schema; `erDiagram` added to supported Mermaid types.
55
+ - `workflows/crystallize.md` Step 1D: step 3 — extracts `## erd` → `## Database Schema (from Architect ERD)` in ARCHITECTURE.md.
56
+ - All 7 existing architect templates updated with `🗄️ ERD` sidebar nav link.
57
+ - **ENH-028 — Architect Design Mode: User Use Cases page**:
58
+ - `templates/architect/user-use-cases.html` (new): Mermaid `flowchart LR` with Actors/Use Cases subgraphs, Use Case List table (ID/Actor/Priority), Actor Summary table.
59
+ - `workflows/brainstorm.md`: Use Case trigger keywords (user story, actor, role, use case, scenario); `## use_cases` section in notes.md YAML schema.
60
+ - `workflows/crystallize.md` Step 1D: step 4 — extracts `## use_cases` → `## User Stories & Use Cases (from Architect Mode)` in PROJECT-CONTEXT.md.
61
+ - All architect templates updated with `👤 Use Cases` sidebar nav link; `index.html` adds 2 hub cards.
62
+ - **vp-brainstorm v1.0.0**: bumped from 0.9.0 with ENH-027 + ENH-028 capability notes.
63
+
64
+ ## [1.11.0] - 2026-04-04
65
+
66
+ ### Added
67
+
68
+ - **FEAT-011 — Architect Design Mode**:
69
+ - `workflows/brainstorm.md`: new `### Architect Design Mode` section — activate via `--architect` flag or auto-heuristic (≥3 components OR ≥1 stack mention); generates HTML workspace with 7 sections (architecture, data-flow, decisions, tech-stack, tech-notes, feature-map, hub) + `notes.md` YAML schema; incremental updates per decision with `.updated` CSS highlight; `/review-arch` command for summary + open_questions review.
70
+ - `templates/architect/`: 7 HTML templates + `style.css` — dark/light toggle, Mermaid.js diagrams, `.updated` diff indicator, responsive sidebar nav. Self-contained, open in browser.
71
+ - `workflows/crystallize.md`: new Step 1D `consume_architect_artifacts` — reads `notes.md` YAML; imports `decisions[]` → ARCHITECTURE.md, uses `tech_stack{}` as authoritative, surfaces `open_questions[]` status=open; cross-references `feature-map.html` with Product Horizon; soft suggestion (not hard block) when architect dir missing.
72
+ - `skills/vp-brainstorm/SKILL.md`: bumped to `0.9.0`, FEAT-011 listed in capabilities.
73
+ - `skills/vp-crystallize/SKILL.md`: bumped to `0.7.0`, FEAT-011 listed in capabilities.
74
+ - `docs/user/features/architect-design-mode.md`: new — 8 sections covering overview, activation, HTML artifacts, dialogue cadence, `/review-arch`, crystallize integration, notes.md schema, tips.
75
+ - `tests/unit/vp-feat011-architect-design-mode-contracts.test.js`: 8 contract tests (333 total, all pass).
76
+
77
+ ## [1.10.0] - 2026-04-04
78
+
79
+ ### Added
80
+
81
+ - **ENH-026 — Background UI Extraction + Crystallize Hard Gate**:
82
+ - `workflows/brainstorm.md`: new `### Background UI Extraction (silent mode)` section — auto-detects 35 UI signal keywords in any brainstorm session; silent `ui_idea_buffer[]` accumulation; surfaces 3-option confirmation dialogue (save to notes, activate UI Direction Mode, or keep buffer) at topic end / `/save` / ≥5 signals. Non-blocking.
83
+ - `workflows/crystallize.md`: Step 1A upgraded to **hard gate** — scans brainstorm sessions for ≥3 UI signals; if `ui_scope_detected = true` and artifacts missing → STOP with 2-option dialogue; Option 2 bypass writes `## UI Direction Assumptions` to `.viepilot/ARCHITECTURE.md`.
84
+ - `skills/vp-brainstorm/SKILL.md`: bumped to `0.8.0`, ENH-026 background extraction listed in capabilities.
85
+ - `skills/vp-crystallize/SKILL.md`: bumped to `0.6.0`, ENH-026 hard gate listed in capabilities.
86
+ - `docs/user/features/ui-direction.md`: new `## Background Extraction` and updated `## Crystallize Integration` sections with hard gate docs, dialogue examples, and diff table vs `--ui` mode.
87
+ - `tests/unit/vp-enh026-ui-extraction-contracts.test.js`: 6 contract tests (325 total, all pass).
88
+
89
+ ## [1.9.11] - 2026-04-02
90
+
91
+ ### Fixed
92
+
93
+ - **BUG-007**: `vp-tools info` crash "Could not locate viepilot package root" khi CWD không phải viepilot source repo. Fix: `buildInstallPlan()` claude-code block nay copy `package.json` → `~/.claude/viepilot/package.json`, cho phép `resolveViepilotPackageRoot()` tìm thấy root ngay cả khi install từ `~/.claude/viepilot/`. (+2 tests, 319 total pass)
13
94
 
14
95
  ## [1.9.10] - 2026-04-02
15
96
 
@@ -0,0 +1,145 @@
1
+ # Brainstorm Session: Multi-Agent Support Expansion
2
+
3
+ **Date:** 2026-04-02
4
+ **Status:** In Progress
5
+ **Topic:** Mở rộng hỗ trợ các coding agent ngoài Codex
6
+
7
+ ---
8
+
9
+ ## Objective
10
+
11
+ Nghiên cứu và lên kế hoạch để ViePilot hỗ trợ thêm các coding agent phổ biến ngoài OpenAI Codex hiện tại.
12
+
13
+ ---
14
+
15
+ ## Research: Coding Agents Landscape 2025-2026
16
+
17
+ ### Tier 1 — CLI-native / Có thể tích hợp trực tiếp
18
+
19
+ | Agent | Maker | CLI | API/SDK | ACP | MCP | Notes |
20
+ |-------|-------|-----|---------|-----|-----|-------|
21
+ | **Codex CLI** | OpenAI | ✓ | ✓ | ✓ | ✓ | Đang hỗ trợ |
22
+ | **Claude Code** | Anthropic | ✓ | ✓ | ✓ | ✓ | CLI `claude`, SDK @anthropic-ai/claude-agent-sdk |
23
+ | **Aider** | OSS | ✓ | ✓ | ✗ | ✓ | CLI `aider`, Python-based, Git-native |
24
+ | **Goose** | Block/LF | ✓ | ✓ | ✓ | ✓ | CLI + desktop, 25+ LLM providers |
25
+ | **OpenCode** | OSS | ✓ | ✓ | ✓ | ✓ | 75+ models, terminal-native |
26
+ | **Kimi Code** | Moonshot AI | ✓ | ✓ | ✓ | ✓ | 1T param MoE, 256K context |
27
+ | **GitHub Copilot CLI** | GitHub/MS | ✓ | ✓ | Planned | ✓ | `gh copilot` command |
28
+
29
+ ### Tier 2 — IDE-primary (CLI hạn chế)
30
+
31
+ | Agent | Maker | CLI | Notes |
32
+ |-------|-------|-----|-------|
33
+ | **Cursor** | Cursor | ✗ | IDE-only, không có CLI programmatic |
34
+ | **Windsurf** | Cognition | ✗ | IDE-only |
35
+ | **Continue.dev** | OSS | ✗ | VS Code / JetBrains extension |
36
+ | **Cline** | OSS | ✗ | VS Code extension, MCP support |
37
+ | **Gemini Code Assist** | Google | Limited | IDE plugin chính |
38
+ | **Amazon Q Dev** | AWS | Limited | IDE plugin, `q` CLI |
39
+ | **Devin** | Cognition | Limited | Web app + API |
40
+
41
+ ### Tier 3 — Web-only / Specialized
42
+
43
+ - **v0 by Vercel** — full-stack web generation
44
+ - **Bolt.new** — in-browser WebContainers
45
+ - **Tabnine** — IDE plugin + Jira integration
46
+ - **Cody (Sourcegraph)** — multi-repo search agent
47
+
48
+ ---
49
+
50
+ ## Integration Protocols
51
+
52
+ ### Model Context Protocol (MCP)
53
+ - Chuẩn hóa cách agent truy cập tools bên ngoài
54
+ - Adopted by: OpenAI, Google, Microsoft, Anthropic
55
+ - Rủi ro security: prompt injection (April 2025 report)
56
+
57
+ ### Agent Client Protocol (ACP)
58
+ - JSON RPC over stdio — standardized editor ↔ agent communication
59
+ - Created by: JetBrains & Zed (Aug 2025)
60
+ - Supported agents: Claude Code, Codex CLI, Gemini, Goose
61
+ - Supported editors: Zed, Neovim, Marimo
62
+
63
+ ---
64
+
65
+ ## Open Questions
66
+
67
+ 1. ViePilot hiện tại hỗ trợ Codex theo cơ chế nào? (CLI wrapper, API, hay file convention?)
68
+ 2. Agent nào nên ưu tiên hỗ trợ trước? (Claude Code, Aider, hay GitHub Copilot?)
69
+ 3. Mô hình integration: ViePilot gọi agent như thế nào — cùng CLI pattern hay adapter layer?
70
+ 4. Có cần abstraction layer (agent-agnostic interface) không?
71
+ 5. Phạm vi support: code generation only, hay cả agentic execution (file edit, terminal)?
72
+
73
+ ---
74
+
75
+ ## Product Horizon
76
+
77
+ ### MVP
78
+ - Hỗ trợ **Claude Code** (Anthropic CLI) — CLI pattern tương tự Codex (MVP)
79
+ - Hỗ trợ **Aider** — CLI-native, OSS, Git-native (MVP)
80
+ - Abstraction: config-based agent selection (MVP)
81
+
82
+ ### Post-MVP
83
+ - Hỗ trợ **GitHub Copilot CLI** — `gh copilot` (Post-MVP)
84
+ - Hỗ trợ **Goose** (Block) — MCP-compatible (Post-MVP)
85
+ - Hỗ trợ **OpenCode** (Post-MVP)
86
+
87
+ ### Future
88
+ - ACP-based integration cho IDE agents (Future)
89
+ - MCP server để expose ViePilot tools sang các agent (Future)
90
+ - Agent routing: tự động chọn agent phù hợp theo task type (Future)
91
+
92
+ ### Non-goals (MVP)
93
+ - Không hỗ trợ IDE-only agents (Cursor, Windsurf) ở MVP
94
+ - Không hỗ trợ web-only agents (v0, Bolt.new)
95
+ - Không build MCP server ở MVP
96
+
97
+ ---
98
+
99
+ ## Research Notes
100
+
101
+ ### Candidates Được Đề Xuất Theo Priority
102
+
103
+ **Priority 1: Claude Code**
104
+ - `claude` CLI — tương tự pattern của `codex`
105
+ - SDK: `@anthropic-ai/claude-agent-sdk`
106
+ - Supports: file editing, terminal, MCP, remote sessions
107
+ - Pricing: subscription (user đã có nếu dùng Claude Code)
108
+
109
+ **Priority 2: Aider**
110
+ - `aider` CLI — Python, OSS, Apache 2.0
111
+ - Git-native: tự commit sau mỗi change
112
+ - Multi-LLM: Claude, OpenAI, local models
113
+ - Strong community: 100K+ GitHub stars
114
+
115
+ **Priority 3: GitHub Copilot CLI**
116
+ - `gh copilot` — requires GitHub Copilot subscription
117
+ - GA: Feb 2026
118
+ - Custom agents support
119
+ - MCP integration
120
+
121
+ **Key Insight:** Tất cả Tier 1 agents đều có CLI interface và hỗ trợ MCP — ViePilot có thể build một adapter layer chung dựa trên:
122
+ 1. CLI command pattern
123
+ 2. Config file location
124
+ 3. Prompt/task passing convention
125
+
126
+ ---
127
+
128
+ ## Action Items
129
+
130
+ - [ ] Xem lại cơ chế hiện tại ViePilot gọi Codex (source code)
131
+ - [ ] Quyết định: adapter pattern hay agent-specific skills
132
+ - [ ] Prototype integration với Claude Code trước (priority 1)
133
+ - [ ] Tạo `docs/dev/agents.md` — agent support matrix
134
+
135
+ ---
136
+
137
+ ## Session Notes
138
+
139
+ Research conducted 2026-04-02. Landscape nhanh thay đổi — re-verify agent CLI APIs trước khi implement.
140
+
141
+ ---
142
+
143
+ ## Project meta intake (FEAT-009)
144
+
145
+ _Chưa hoàn tất — cần binding profile trước khi close session._
@@ -0,0 +1,170 @@
1
+ # Architect Design Mode (FEAT-011)
2
+
3
+ `/vp-brainstorm --architect` bật chế độ brainstorm kiến trúc với live HTML generation — workspace trực quan để review, chỉnh sửa, và trình bày trước khi chạy `/vp-crystallize`.
4
+
5
+ ## Overview
6
+
7
+ Architect Design Mode giải quyết gap: brainstorm architecture thông thường chỉ là text/markdown. Không có visualization trực quan → khó detect lỗi sớm, khó align với stakeholders.
8
+
9
+ **Architect Mode tạo ra:**
10
+ - HTML workspace với 7 sections (architecture, data-flow, decisions, tech-stack, tech-notes, feature-map)
11
+ - Machine-readable `notes.md` với YAML schema (decisions, open_questions, tech_stack)
12
+ - Mermaid.js diagrams tự động render trong browser
13
+ - Incremental updates khi decisions thay đổi — không tái tạo toàn bộ workspace
14
+
15
+ ## Activation
16
+
17
+ ### Explicit flag
18
+ ```
19
+ /vp-brainstorm --architect
20
+ ```
21
+ Kích hoạt ngay khi bắt đầu phiên. ViePilot sẽ tạo workspace và bắt đầu generate HTML sau mỗi major decision.
22
+
23
+ ### Auto-activate heuristic
24
+ Khi đang brainstorm thông thường, ViePilot theo dõi:
25
+ - **Component/service mentions**: tên theo pattern `{capitalized} Service|API|Module|Layer|Server|Database`
26
+ - **Stack mentions**: bất kỳ technology keyword nào (React, Node.js, PostgreSQL, Kafka, AWS, Docker, v.v.)
27
+
28
+ Khi **≥3 components** hoặc **≥1 stack suggestion** → prompt:
29
+ ```
30
+ 🏗️ Tôi nhận thấy bạn đang thiết kế kiến trúc với nhiều components.
31
+ Kích hoạt Architect Design Mode để tôi tạo HTML visualization không?
32
+ 1. Có — tạo workspace và generate initial HTML
33
+ 2. Không — tiếp tục text-only
34
+ ```
35
+
36
+ ## HTML Artifacts
37
+
38
+ ### Workspace layout
39
+
40
+ ```
41
+ .viepilot/architect/{session-id}/
42
+ index.html # Hub: sidebar nav → tất cả sections
43
+ architecture.html # System diagram (Mermaid) + component table
44
+ data-flow.html # Sequence/flow diagrams
45
+ decisions.html # ADR log: Date | Decision | Options | Chosen | Rationale | Status
46
+ tech-stack.html # Layer-by-layer: frontend, backend, infra, data, DevOps
47
+ tech-notes.html # 3 columns: Assumptions | Risks | Open Questions
48
+ feature-map.html # Features: layer, phase, MVP/Post-MVP/Future tags
49
+ style.css # Shared: dark/light mode, .updated highlight, Mermaid container
50
+ notes.md # Machine-readable YAML (xem Schema bên dưới)
51
+ ```
52
+
53
+ ### File descriptions
54
+
55
+ | File | Nội dung | Diagram type |
56
+ |------|----------|-------------|
57
+ | `index.html` | Hub: card links tới 6 sections | — |
58
+ | `architecture.html` | System components, service boundaries | `graph TD` hoặc `C4Context` |
59
+ | `data-flow.html` | Request/event flows | `sequenceDiagram` hoặc `flowchart LR` |
60
+ | `decisions.html` | ADR log với status badges | — |
61
+ | `tech-stack.html` | Layer table + alternatives | — |
62
+ | `tech-notes.html` | 3 cột: Assumptions, Risks, Open Questions | — |
63
+ | `feature-map.html` | Feature list + mindmap | `mindmap` hoặc `quadrantChart` |
64
+
65
+ ### Opening the workspace
66
+ Mở `index.html` trong browser để xem toàn bộ workspace. Các trang tự liên kết nhau qua sidebar nav.
67
+
68
+ ### Dark/light mode
69
+ Mỗi trang có nút toggle dark/light. Mermaid diagrams tự điều chỉnh theme.
70
+
71
+ ## Dialogue Cadence
72
+
73
+ Sau **mỗi major decision** trong Architect Mode:
74
+ 1. ViePilot cập nhật HTML section liên quan (chỉ section đó — không tái tạo toàn bộ)
75
+ 2. Thêm `class="updated"` + `data-updated="true"` → CSS highlight (yellow left border + "updated" badge)
76
+ 3. Update `notes.md` YAML (`updated` date + entry tương ứng)
77
+
78
+ **Ví dụ luồng:**
79
+ ```
80
+ User: "Chọn PostgreSQL cho database vì cần ACID compliance"
81
+ → AI update decisions.html (thêm row D001)
82
+ → AI update tech-stack.html (Database layer)
83
+ → AI update notes.md (decisions[] + tech_stack.database)
84
+ → Highlight các section đã thay đổi với .updated class
85
+ ```
86
+
87
+ ## `/review-arch` command
88
+
89
+ Gõ `/review-arch` trong phiên Architect Mode để xem tóm tắt:
90
+
91
+ ```
92
+ 📊 Architecture Review
93
+
94
+ Decisions so far:
95
+ | ID | Topic | Chosen | Status |
96
+ |------|-----------------|-------------|----------|
97
+ | D001 | Database | PostgreSQL | decided |
98
+ | D002 | Caching layer | Redis | decided |
99
+ | D003 | Queue system | — | open |
100
+
101
+ Open Questions:
102
+ - Q001: Caching layer Redis hay Memcached? (due: before crystallize)
103
+ - Q002: Deploy ECS hay Kubernetes? (due: open)
104
+
105
+ Tiếp tục brainstorm không?
106
+ ```
107
+
108
+ ## Crystallize Integration
109
+
110
+ ### Step 1D — Consume Architect Artifacts
111
+
112
+ Khi chạy `/vp-crystallize`, Step 1D tự động đọc `.viepilot/architect/`:
113
+
114
+ 1. **decisions[]** → import vào `.viepilot/ARCHITECTURE.md` section `## Architecture Decisions (from Architect Mode)`
115
+ 2. **tech_stack{}** → dùng làm authoritative stack (override brainstorm text nếu conflict; khi có conflict → hỏi user)
116
+ 3. **open_questions[] status=open** → surface trước khi tiếp tục
117
+ 4. **feature-map.html** → cross-check với `## Product Horizon` trong brainstorm session
118
+
119
+ **Soft suggestion** (không block) khi architect dir chưa có nhưng brainstorm có ≥5 services:
120
+ ```
121
+ 💡 Bạn muốn quay lại /vp-brainstorm --architect để tạo visualization trước không?
122
+ 1. Có — quay lại architect mode
123
+ 2. Không — tiếp tục crystallize với text-only brainstorm
124
+ ```
125
+
126
+ ## notes.md Schema
127
+
128
+ File `notes.md` trong architect workspace là machine-readable YAML + Markdown:
129
+
130
+ ```yaml
131
+ ---
132
+ session_id: {id}
133
+ project: {name}
134
+ created: {date}
135
+ updated: {date}
136
+ ---
137
+ ## decisions
138
+ - id: D001
139
+ topic: Database choice
140
+ options: [PostgreSQL, MongoDB, DynamoDB]
141
+ chosen: PostgreSQL
142
+ rationale: ACID compliance needed for financial data
143
+ status: decided # decided | open | deferred
144
+
145
+ ## open_questions
146
+ - id: Q001
147
+ question: Caching layer Redis hay Memcached?
148
+ context: High read traffic expected
149
+ due: before crystallize
150
+
151
+ ## tech_stack
152
+ frontend: React + TypeScript
153
+ backend: Node.js + Express
154
+ database: PostgreSQL
155
+ infra: AWS ECS + RDS
156
+ devops: GitHub Actions + Terraform
157
+ ```
158
+
159
+ `crystallize` đọc file này trực tiếp — giữ schema nhất quán để import hoạt động đúng.
160
+
161
+ ## Tips & Best Practices
162
+
163
+ 1. **Bắt đầu với Architecture** — chốt component boundaries trước khi đi vào data-flow và decisions
164
+ 2. **Dùng `/review-arch` thường xuyên** — đặc biệt khi có nhiều open_questions; resolve trước khi crystallize
165
+ 3. **Decisions.html là lịch sử** — không xóa rows cũ; chỉ update `status` khi quyết định thay đổi
166
+ 4. **tech_stack{} là authoritative** — crystallize sẽ dùng đây làm stack chính; đảm bảo đúng trước khi `/vp-crystallize`
167
+ 5. **Mở index.html trong browser** — workspace được thiết kế để share với stakeholders trực tiếp từ file
168
+
169
+ ---
170
+ _Cập nhật: 1.11.0 (FEAT-011 — Architect Design Mode)_
@@ -84,12 +84,85 @@ Gợi ý: kèm tên sản phẩm hoặc ngữ cảnh trong cùng tin nhắn (vd.
84
84
 
85
85
  **Khác `/research {chủ đề}`**: lệnh tự do chỉ cần research ngắn và quay lại topic; **`/research-ui`** bắt buộc 3 phase + log + chỉnh prototype khi phù hợp.
86
86
 
87
+ ## Background Extraction (ENH-026)
88
+
89
+ Kể từ **1.10.0**, bạn **không cần** gọi `--ui` để thu thập ý tưởng UI — `/vp-brainstorm` tự động nhận diện tín hiệu UI trong mọi phiên.
90
+
91
+ ### Cách hoạt động
92
+
93
+ | Bước | Mô tả |
94
+ |------|-------|
95
+ | **1. Silent detection** | AI theo dõi các keyword UI (`màu`, `layout`, `page`, `button`, `giao diện`, v.v.) trong suốt hội thoại — không interrupt |
96
+ | **2. Accumulation** | Khi ≥3 keyword xuất hiện, ý tưởng UI được ghi vào buffer ngầm (`ui_idea_buffer`) |
97
+ | **3. Surface** | Khi topic kết thúc, bạn gõ `/save`/`/review`, hoặc ≥5 signals tích luỹ → AI đề xuất lưu |
98
+
99
+ ### Ví dụ thực tế
100
+
101
+ Bạn đang brainstorm về tính năng đặt vé và nhắc đến:
102
+
103
+ > "tôi muốn **nút** màu **xanh**, **màn hình** danh sách vé cần rõ ràng, và **form** thanh toán đơn giản"
104
+
105
+ → 3 keywords (`nút`, `màn hình`, `form`) → threshold đạt → buffer bắt đầu tích luỹ im lặng.
106
+
107
+ Khi topic kết thúc, AI hỏi:
108
+
109
+ ```
110
+ 💡 Tôi phát hiện một số ý tưởng UI trong phiên này:
111
+ - Nút màu xanh (CTA)
112
+ - Màn hình danh sách vé — yêu cầu layout rõ ràng
113
+ - Form thanh toán — thiết kế đơn giản
114
+
115
+ Bạn muốn:
116
+ 1. Lưu vào ui-direction/notes.md (background extraction)
117
+ 2. Lưu + kích hoạt UI Direction Mode để generate HTML direction
118
+ 3. Bỏ qua, tiếp tục brainstorm
119
+ ```
120
+
121
+ ### Khác biệt với `--ui` mode
122
+
123
+ | | Background Extraction | UI Direction Mode (`--ui`) |
124
+ |---|---|---|
125
+ | **Kích hoạt** | Tự động (silent) | Chủ động (`--ui` hoặc chọn Option 2) |
126
+ | **Artifact tạo ra** | `notes.md` (`## Background extracted ideas`) | `index.html`, `style.css`, `notes.md` |
127
+ | **Gián đoạn brainstorm?** | Không (non-blocking) | Có thể (chuyển sang UI mode) |
128
+ | **Dùng khi** | UI là phụ, main focus là domain/arch | UI là trọng tâm phiên |
129
+
130
+ ## Crystallize Integration
131
+
132
+ `/vp-crystallize` đọc `notes.md` trước, sau đó `index.html`, `style.css`, và **từng** `pages/*.html` (nếu có) để lên kiến trúc UI đủ page.
133
+
134
+ ### Hard gate (ENH-026)
135
+
136
+ Kể từ **1.10.0**, Step 1A áp dụng **hard gate** khi phát hiện UI scope trong brainstorm nhưng thiếu artifacts:
137
+
138
+ ```
139
+ ⚠️ UI Direction artifacts missing
140
+
141
+ Phiên brainstorm cho thấy dự án có UI scope nhưng `.viepilot/ui-direction/` chưa có artifacts.
142
+
143
+ 1. Quay lại /vp-brainstorm --ui để tạo direction trước (khuyến nghị)
144
+ 2. Tiếp tục với assumptions — ghi vào ARCHITECTURE.md và proceed
145
+ ```
146
+
147
+ **Option 1** (khuyến nghị): quay lại brainstorm và tạo direction trước — đảm bảo UI vision được capture đầy đủ.
148
+
149
+ **Option 2** (bypass): crystallize tiếp tục nhưng ghi block `## UI Direction Assumptions` vào `.viepilot/ARCHITECTURE.md`:
150
+
151
+ ```markdown
152
+ ## UI Direction Assumptions
153
+ > Auto-generated by crystallize (ENH-026 gate bypassed by user)
154
+ - UI scope detected in brainstorm but no ui-direction artifacts present
155
+ - Proceeding without visual direction; architecture decisions may need UI review later
156
+ ```
157
+
158
+ Gate **chỉ kích hoạt** khi `ui_scope_detected = true` (≥3 UI signals trong brainstorm sessions). Dự án không có UI scope đi qua bình thường.
159
+
87
160
  ## Flow khuyến nghị
88
- 1. `/vp-brainstorm --ui`
89
- 2. Chọn legacy hoặc multi-page theo số màn hình.
161
+ 1. `/vp-brainstorm` (mọi phiên — background extraction hoạt động im lặng)
162
+ 2. Hoặc `/vp-brainstorm --ui` nếu UI trọng tâm.
90
163
  3. (Optional) `/research-ui` để chạy walkthrough và nâng cấp prototype + `notes.md`.
91
164
  4. Mỗi thay đổi page → cập nhật HTML + **hub + `## Pages inventory`** trong cùng một lượt.
92
- 5. `/vp-crystallize` đọc `notes.md` trước, sau đó `index.html`, `style.css`, **từng** `pages/*.html` (nếu có) để lên kiến trúc UI đủ page.
165
+ 5. `/vp-crystallize` Step 1A hard gate kiểm tra artifacts trước khi tiến hành.
93
166
 
94
167
  ## Kiểm tra nhanh (optional)
95
168
 
@@ -98,3 +171,6 @@ node scripts/verify-ui-direction-pages.cjs
98
171
  ```
99
172
 
100
173
  Script báo lỗi nếu có session có `pages/*.html` nhưng thiếu `## Pages inventory` hoặc thiếu tên file page trong `notes.md`.
174
+
175
+ ---
176
+ _Cập nhật: 1.10.0 (ENH-026 — background extraction + crystallize hard gate)_
@@ -190,6 +190,9 @@ function buildInstallPlan(packageRoot, envSource = process.env, opts = {}) {
190
190
  for (const f of ['cli-shared.cjs', 'viepilot-info.cjs', 'viepilot-update.cjs', 'viepilot-install.cjs']) {
191
191
  steps.push({ kind: 'copy_file', from: path.join(root, 'lib', f), to: path.join(claudeViepilotDir, 'lib', f) });
192
192
  }
193
+ // BUG-007: copy package.json so resolveViepilotPackageRoot() finds the root
194
+ // when vp-tools runs from ~/.claude/viepilot/ (CWD ≠ viepilot source repo)
195
+ steps.push({ kind: 'copy_file', from: path.join(root, 'package.json'), to: path.join(claudeViepilotDir, 'package.json') });
193
196
 
194
197
  // Rewrite execution_context paths in mirrored skill files
195
198
  steps.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viepilot",
3
- "version": "1.9.10",
3
+ "version": "1.14.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": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: vp-brainstorm
3
3
  description: "Brainstorm session để thu thập ý tưởng, quyết định cho dự án"
4
- version: 0.6.3
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  <cursor_skill_adapter>
@@ -39,9 +39,14 @@ Hỗ trợ:
39
39
  - Landing page layout discovery (hỏi thêm để chốt bố cục)
40
40
  - In-session research (research ngay trong phiên brainstorm theo yêu cầu)
41
41
  - UI Direction mode: tạo/cập nhật HTML prototype + notes trong `.viepilot/ui-direction/{session-id}/` — hỗ trợ **multi-page** (`pages/{slug}.html` + hub `index.html`) và hook **`## Pages inventory`** trong `notes.md` khi có `pages/` (FEAT-007)
42
- - **Product horizon (ENH-014):** mọi session phải duy trì **`## Product horizon`** khi thảo luận capability/milestonetier tags `(MVP)` / `(Post-MVP)` / `(Future)`, non-goals, deferred capabilities; hoặc ghi **single-release / no deferred epics** (contract: `workflows/brainstorm.md`)
42
+ - **Phase assignment (ENH-030):** trong mọi session, features/capabilities được gán trực tiếp vào Phase 1, Phase 2, Phase 3... không dùng MVP/Post-MVP/Future tiers. Session file lưu trong `## Phases` section.
43
43
  - **Project meta intake (FEAT-009):** sau khi **scope locked**, **trước** `Completed` / `/end`, nếu thiếu `.viepilot/META.md` (`viepilot_profile_id`) — chạy Q&A **tuần tự** có proposal; đọc/ghi `~/.viepilot/profile-map.md`; tạo `~/.viepilot/profiles/<slug>.md` + binding theo **`docs/dev/global-profiles.md`**. Nếu đã có profile bound — skip intake mặc định (hỏi đổi nếu cần).
44
44
  - **UX walkthrough (FEAT-010 + ENH-019 + ENH-020):** trong **`--ui`**, lệnh **`/research-ui`** hoặc **`/research ui`** chạy 3 phase — mô phỏng **end-user** (kèm **content stress pass** + **stress recipes theo archetype** → **Stress findings**) → **UX designer + web research** → chỉnh `index.html` / `pages/*.html` / `style.css` và ghi **`## UX walkthrough log`** trong `notes.md` (đồng bộ hub + **Pages inventory** khi multi-page).
45
+ - **Background UI extraction (ENH-026):** tự động nhận diện UI signal keywords trong mọi phiên brainstorm (không cần `--ui` flag); silent accumulation buffer; surface để xác nhận khi topic kết thúc, `/save`, hoặc ≥5 signals — không interrupt hội thoại chính.
46
+ - **Architect Design Mode (FEAT-011):** `/vp-brainstorm --architect` hoặc auto-activate khi ≥3 components/services; generate HTML workspace (architecture, data-flow, decisions, tech-stack, tech-notes, feature-map) với Mermaid diagrams; incremental update per decision; `/review-arch` command; machine-readable `notes.md` YAML schema.
47
+ - **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.
48
+ - **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.
49
+ - **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).
45
50
 
46
51
  **Creates/Updates:**
47
52
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
@@ -75,9 +80,9 @@ Key steps:
75
80
  6. Nếu topic cần UI/UX: tạo/cập nhật UI Direction artifacts trong `.viepilot/ui-direction/{session-id}/` — legacy: `index.html` + `style.css` + `notes.md`; multi-page: thêm `pages/*.html`, `index.html` làm hub, và sau mỗi thay đổi page cập nhật **`## Pages inventory`** trong `notes.md` (xem `docs/user/features/ui-direction.md`)
76
81
  6b. Khi user gõ **`/research-ui`** hoặc **`/research ui`** trong phiên UI: làm đúng **`workflows/brainstorm.md`** (FEAT-010) — không gộp vào bước research ngắn thường lệ
77
82
  7. Nếu user yêu cầu research hoặc cần làm rõ quyết định: research ngay trong session và quay lại topic
78
- 8. Khi topic thêm/sửa capability hoặc release scope: cập nhật **`## Product horizon`** trong session (merge, không xóa tier tags im lặng) theo `workflows/brainstorm.md`
83
+ 8. Khi topic thêm/sửa capability: cập nhật **`## Phases`** trong session theo `workflows/brainstorm.md`
79
84
  9. Trước khi hoàn tất phiên: **bước 5 — Project meta intake (FEAT-009)** trong `workflows/brainstorm.md` khi binding thiếu; sequential Q&A + profile-map disambiguation + ghi global profile + `.viepilot/META.md`
80
- 10. Save session with structured format (bao gồm **`## Project meta intake (FEAT-009)`**, research notes + UI direction references + **Product horizon** khi có)
85
+ 10. Save session with structured format (bao gồm **`## Project meta intake (FEAT-009)`**, research notes + UI direction references + **`## Phases`**)
81
86
  11. Suggest next action: `/vp-crystallize`
82
87
  </process>
83
88
 
@@ -92,7 +97,7 @@ Key steps:
92
97
  - [ ] UI Direction artifacts created/updated when UI mode is active
93
98
  - [ ] Multi-page sessions: hub links + `## Pages inventory` stay in sync with `pages/*.html`
94
99
  - [ ] **FEAT-010 + ENH-019 + ENH-020**: `/research-ui` (khi `--ui`) chạy đủ 3 phase, gồm **content stress pass** + **archetype recipes** + **`## UX walkthrough log`** (có **Stress findings**) khi có chỉnh prototype
95
- - [ ] `## Product horizon` present với MVP / Post-MVP / Future (hoặc explicit single-release statement) khi scope được thảo luận
100
+ - [ ] `## Phases` present với Phase 1 nội dung thật khi scope được thảo luận
96
101
  - [ ] **FEAT-009**: intake hoàn tất hoặc binding đã có **hoặc** waiver có lý do trước Completed; session ghi **`## Project meta intake (FEAT-009)`**
97
102
  - [ ] Next steps suggested
98
103
  </success_criteria>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: vp-crystallize
3
3
  description: "Chuyển đổi brainstorm thành executable artifacts"
4
- version: 0.5.2
4
+ version: 0.8.0
5
5
  ---
6
6
 
7
7
  <cursor_skill_adapter>
@@ -41,7 +41,7 @@ Chuyển đổi brainstorm sessions thành structured artifacts để AI có th
41
41
  ├── architecture/ # ENH-022: *.mermaid sidecars (mirror fenced diagrams)
42
42
  ├── PROJECT-CONTEXT.md # Domain knowledge + `<product_vision>` (phased scope)
43
43
  ├── SYSTEM-RULES.md # Coding rules & standards
44
- ├── ROADMAP.md # MVP phases & tasks + **Post-MVP / Product horizon** block (mandatory)
44
+ ├── ROADMAP.md # Phases & tasks in order from phases_inventory
45
45
  ├── TRACKER.md # Progress tracking
46
46
  ├── HANDOFF.json # Machine-readable state
47
47
  └── schemas/ # Database, API, Kafka schemas
@@ -65,6 +65,12 @@ Chuyển đổi brainstorm sessions thành structured artifacts để AI có th
65
65
  - `.viepilot/STACKS.md` (project-local index to global cache)
66
66
 
67
67
  **After:** Ready for `/vp-auto`
68
+
69
+ **UI direction hard gate (ENH-026):**
70
+ - Step 1A scans brainstorm for UI signal keywords; if ≥3 signals detected + no artifacts → **STOP** with 2-option dialogue (go back to brainstorm --ui OR proceed with assumptions written to ARCHITECTURE.md). Enforces direction-first workflow before crystallize proceeds.
71
+
72
+ **Architect artifacts consumption (FEAT-011):**
73
+ - 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.
68
74
  </objective>
69
75
 
70
76
  <execution_context>
@@ -93,8 +99,8 @@ Ask user for (confirm proposals từ profile nếu có):
93
99
  - Load all brainstorm sessions
94
100
  - Extract: decisions, architecture, schemas, features
95
101
  - Extract selected tech stacks
96
- - **Product horizon (ENH-014):** parse each session **`## Product horizon`**; build consolidated **horizon inventory**; record **single-release** mode when stated; run **validation gate** (missing section vs multi-release discussion → stop and ask; tier conflicts → stop) — full contract: `workflows/crystallize.md` Step 1
97
- - Validate completeness (tech stack, features, schema/API clarity, **horizon gate**)
102
+ - **Phase assignment (ENH-030):** parse `## Phases` từ brainstorm sessions; build `phases_inventory`; run phase assignment gate (mọi feature phải phase — full contract: `workflows/crystallize.md` Step 1)
103
+ - Validate completeness (tech stack, features, schema/API clarity, **phase assignment gate**)
98
104
 
99
105
  ### Step 1A: Consume UI direction (if present)
100
106
  - Read `.viepilot/ui-direction/{session-id}/notes.md` first, then `style.css`, then HTML:
@@ -152,7 +158,7 @@ Ask user for (confirm proposals từ profile nếu có):
152
158
  - Business rules
153
159
  - Conventions
154
160
  - Constraints
155
- - Fill **`<product_vision>`** from template (`templates/project/PROJECT-CONTEXT.md`): MVP boundary, Post-MVP / Future themes, anti-goals — aligned with brainstorm horizon + Step 1 inventory
161
+ - Fill **`<product_vision>`** from template (`templates/project/PROJECT-CONTEXT.md`): Project scope, Phase overview, anti-goals — aligned with brainstorm `## Phases` + Step 1 phases_inventory
156
162
 
157
163
  ### Step 6: Generate SYSTEM-RULES.md
158
164
  - Architecture rules
@@ -165,9 +171,9 @@ Ask user for (confirm proposals từ profile nếu có):
165
171
  - Stack-specific rules from cache
166
172
 
167
173
  ### Step 7: Generate ROADMAP.md
168
- - Use `templates/project/ROADMAP.md` — **executable MVP phases** first (tasks, criteria, verification)
169
- - **Mandatory `## Post-MVP / Product horizon`:** epic-level deferred work from horizon inventory **or** explicit single-release statement (no silent omission)
170
- - **Self-check before finalize:** non-empty horizon inventory must appear in ROADMAP; if mismatch → stop and ask user — see `workflows/crystallize.md` Step 7
174
+ - Use `templates/project/ROADMAP.md` — phases in order (Phase 1, Phase 2...) from `phases_inventory`; no Post-MVP block
175
+ - Each phase: tasks, acceptance criteria, verification commands
176
+ - **Self-check before finalize:** all phases from phases_inventory appear in ROADMAP; if mismatch → stop and ask user — see `workflows/crystallize.md` Step 7
171
177
 
172
178
  ### Step 8: Generate schemas/
173
179
  - database-schema.sql
@@ -201,9 +207,9 @@ Ask user for (confirm proposals từ profile nếu có):
201
207
  - [ ] All artifacts created in .viepilot/
202
208
  - [ ] PROJECT-META.md has complete metadata
203
209
  - [ ] SYSTEM-RULES.md has all standards
204
- - [ ] Step 1 horizon extracted or explicit single-release recorded; validation gate satisfied
210
+ - [ ] Step 1 phase assignment gate satisfied (phases_inventory recorded, all features assigned)
205
211
  - [ ] PROJECT-CONTEXT.md includes populated **`<product_vision>`** (template placeholders filled from brainstorm)
206
- - [ ] ROADMAP.md has MVP phases with tasks **and** mandatory Post-MVP / horizon block (or explicit single-release statement)
212
+ - [ ] ROADMAP.md has phases with tasks in order from phases_inventory
207
213
  - [ ] TRACKER.md initialized
208
214
  - [ ] Project files created
209
215
  - [ ] Git committed