viepilot 1.3.1 → 1.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.
@@ -5,10 +5,12 @@
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- # Sau khi install ViePilot
8
+ # Sau khi install ViePilot (global: npm i -g viepilot — có `vp-tools` trên PATH)
9
9
  vp-tools help
10
10
  ```
11
11
 
12
+ Sau `npm i -g viepilot`, lệnh `vp-tools` (cùng bundle với `npx viepilot`) có sẵn để gọi `info` / `update` mà không cần clone repo.
13
+
12
14
  ---
13
15
 
14
16
  ## Commands
@@ -291,6 +293,73 @@ vp-tools help version
291
293
 
292
294
  ---
293
295
 
296
+ ### `info [--json]`
297
+
298
+ Hiển thị metadata bundle ViePilot: thư mục gốc package đã resolve, version đã cài, (nếu có mạng) version mới nhất trên npm, optional `git HEAD`, danh sách **skills** và **workflows** kèm semver trong frontmatter (skills).
299
+
300
+ **Không cần** project có `.viepilot/` — CLI resolve gói `viepilot` từ vị trí `vp-tools.cjs` hoặc từ `process.cwd()`.
301
+
302
+ ```bash
303
+ vp-tools info
304
+ vp-tools info --json
305
+ ```
306
+
307
+ **Flags**:
308
+
309
+ | Flag | Description |
310
+ |------|-------------|
311
+ | `--json` | In một object JSON duy nhất (parse-friendly) |
312
+
313
+ **JSON shape** (`vp-tools info --json`, rút gọn):
314
+
315
+ ```json
316
+ {
317
+ "packageRoot": "/path/to/viepilot",
318
+ "packageName": "viepilot",
319
+ "installedVersion": "1.5.1",
320
+ "latestNpm": { "ok": true, "version": "1.5.1" },
321
+ "gitHead": "abc1234…",
322
+ "skills": [
323
+ { "id": "vp-auto", "version": "0.1.0", "relativePath": "skills/vp-auto/SKILL.md" }
324
+ ],
325
+ "workflows": [
326
+ { "id": "autonomous", "relativePath": "workflows/autonomous.md", "semverInFile": null, "note": "no semver in workflow markdown" }
327
+ ]
328
+ }
329
+ ```
330
+
331
+ **Errors**:
332
+ - `Could not locate viepilot package root` — Cài global, thêm dependency `viepilot`, hoặc chạy `node path/to/viepilot/bin/vp-tools.cjs info` từ clone.
333
+
334
+ ---
335
+
336
+ ### `update [--dry-run] [--yes] [--global]`
337
+
338
+ Nâng cấp package `viepilot` qua **npm** (local `node_modules`, global install, hoặc ép global).
339
+
340
+ ```bash
341
+ vp-tools update --dry-run
342
+ vp-tools update --yes
343
+ vp-tools update --global --dry-run
344
+ vp-tools update --global --yes
345
+ ```
346
+
347
+ **Flags**:
348
+
349
+ | Flag | Description |
350
+ |------|-------------|
351
+ | `--dry-run` | Chỉ in lệnh npm dự kiến và hướng dẫn rollback, **không** chạy npm |
352
+ | `--yes` | Bỏ qua prompt; **bắt buộc** trong môi trường non-interactive khi thực sự apply |
353
+ | `--global` | Ép `npm install -g viepilot@latest` |
354
+
355
+ **Lưu ý**:
356
+ - Trong repo **ứng dụng** có `node_modules/viepilot`, bản mặc định có thể cập nhật **dependency local** — dùng `--global` nếu chỉ muốn nâng bản global.
357
+ - Non-interactive: dùng `vp-tools update --dry-run` trước, sau đó `vp-tools update --yes` (hoặc `--global --yes`).
358
+
359
+ **Success**: Thông báo `npm update completed` hoặc `already up to date` (no-op).
360
+
361
+ ---
362
+
294
363
  ## Exit Codes
295
364
 
296
365
  | Code | Meaning |
@@ -14,6 +14,10 @@ Hướng dẫn đóng góp cho ViePilot framework.
14
14
  ```bash
15
15
  ./dev-install.sh
16
16
  ```
17
+ Để **symlink** toàn bộ `skills/vp-*` về repo (sửa skill là Cursor thấy ngay), dùng:
18
+ ```bash
19
+ VIEPILOT_SYMLINK_SKILLS=1 ./dev-install.sh
20
+ ```
17
21
  4. Tạo branch cho feature/fix:
18
22
  ```bash
19
23
  git checkout -b feat/my-new-skill
@@ -24,11 +24,10 @@ cd viepilot
24
24
  ./install.sh
25
25
  ```
26
26
 
27
- `install.sh` copies:
27
+ `install.sh` is a thin **bash** wrapper: optional **cloc** / **PATH** prompts, then **`node bin/viepilot.cjs install`** (same **Node** engine as `npx viepilot install`). It installs to:
28
28
  - `skills/vp-*/` → `~/.cursor/skills/`
29
- - `workflows/` → `~/.cursor/viepilot/workflows/`
30
- - `templates/` `~/.cursor/viepilot/templates/`
31
- - `bin/vp-tools.cjs` → `~/.local/bin/vp-tools`
29
+ - `workflows/`, `templates/`, `bin/`, `lib/` → `~/.cursor/viepilot/…`
30
+ - Optional PATH symlinks (Unix) via `VIEPILOT_ADD_PATH=1`
32
31
 
33
32
  ### Method 3: Development Mode
34
33
 
@@ -26,6 +26,8 @@ Complete reference for all ViePilot skills.
26
26
 
27
27
  ### Output
28
28
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
29
+ - **Product horizon:** session file giữ **`## Product horizon`** (MVP / Post-MVP / Future tags, deferred capabilities, hoặc single-release statement) để `/vp-crystallize` không bỏ sót post-MVP — xem `workflows/brainstorm.md`.
30
+ - UI Direction (optional): `.viepilot/ui-direction/{session-id}/` — legacy (`index.html`) hoặc multi-page (`pages/*.html` + hub + `## Pages inventory` trong `notes.md`). Chi tiết: [UI Direction](user/features/ui-direction.md).
29
31
 
30
32
  ---
31
33
 
@@ -33,6 +35,14 @@ Complete reference for all ViePilot skills.
33
35
 
34
36
  **Purpose**: Chuyển đổi brainstorm thành executable artifacts
35
37
 
38
+ ### UI direction intake
39
+ - Nếu có `.viepilot/ui-direction/{session-id}/` với `pages/*.html`: đọc `notes.md` (**Pages inventory**), từng file page, và hub `index.html` để architecture UI không bỏ sót màn hình.
40
+
41
+ ### Product horizon (brainstorm → ROADMAP / context)
42
+ - Step 1: trích **`## Product horizon`** từ mọi session; **horizon inventory** + cổng single-release / thiếu section — `workflows/crystallize.md`.
43
+ - `ROADMAP.md`: luôn có block **Post-MVP / Product horizon** (hoặc ghi rõ single-release); `PROJECT-CONTEXT.md`: khối **`<product_vision>`** từ `templates/project/PROJECT-CONTEXT.md`.
44
+ - Hướng dẫn user tổng quan: [product-horizon.md](user/features/product-horizon.md). Thứ tự load cho AI: `templates/project/AI-GUIDE.md` (bản crystallize copy vào `.viepilot/AI-GUIDE.md`).
45
+
36
46
  ### Metadata Collection
37
47
  - Project name, description
38
48
  - Organization name, website
@@ -190,6 +200,23 @@ AI pauses for user input when:
190
200
 
191
201
  ---
192
202
 
203
+ ## /vp-info
204
+
205
+ **Purpose**: Xem metadata bundle ViePilot — version đã cài, npm latest, danh sách skills/workflows (FEAT-008).
206
+
207
+ ### CLI
208
+ | Invocation | Description |
209
+ |------------|-------------|
210
+ | `vp-tools info` | Bảng human-readable |
211
+ | `vp-tools info --json` | JSON parse được: `packageRoot`, `packageName`, `installedVersion`, `latestNpm`, `gitHead`, `skills[]`, `workflows[]` |
212
+ | `node node_modules/viepilot/bin/vp-tools.cjs info` | Từ project có dependency `viepilot` |
213
+
214
+ ### JSON fields (tóm tắt)
215
+ - **`skills[]`**: `id`, `version`, `relativePath`
216
+ - **`workflows[]`**: `id`, `relativePath`, `semverInFile`, `note`
217
+
218
+ ---
219
+
193
220
  ## /vp-docs
194
221
 
195
222
  **Purpose**: Generate documentation
@@ -399,3 +426,20 @@ CHANGELOG.md (updated)
399
426
  | `skip N --reason "..."` | Skip task N |
400
427
  | `retry N` | Retry failed task N |
401
428
  | `rollback N` | Rollback task N changes |
429
+
430
+ ---
431
+
432
+ ## /vp-update
433
+
434
+ **Purpose**: Nâng cấp package `viepilot` qua npm — có dry-run và xác nhận non-interactive (FEAT-008).
435
+
436
+ ### Flags
437
+ | Flag | Description |
438
+ |------|-------------|
439
+ | `--dry-run` | In planned npm command, không chạy |
440
+ | `--yes` | Bỏ qua prompt; **bắt buộc** trong non-interactive khi apply |
441
+ | `--global` | Ép `npm install -g viepilot@latest` |
442
+
443
+ ### Lưu ý
444
+ - Trong repo **application** có `node_modules/viepilot`, update mặc định có thể target **local** — dùng **`--global`** nếu chỉ muốn global.
445
+ - Luồng an toàn: `vp-tools update --dry-run` → sau đó `vp-tools update --yes` (hoặc `--global --yes`).
@@ -68,6 +68,43 @@ chmod +x install.sh
68
68
 
69
69
  ---
70
70
 
71
+ ### `npx viepilot install` vs dev clone — upgrade / cài lại có “conflict” không?
72
+
73
+ **Không có** giao diện merge từng file. Hành vi phụ thuộc **script nào** chạy:
74
+
75
+ | Cách cài | Script | Trước khi ghi file mới |
76
+ |----------|--------|-------------------------|
77
+ | **`npx viepilot install`** (mọi `--target`) | **`bin/viepilot.cjs`** + `lib/viepilot-install.cjs` (Node, **không** bash) | **Không** xóa `~/.cursor/skills/vp-*` hay `~/.cursor/viepilot`; copy đè tương đương **`cp -r`**. File cùng tên bị ghi đè; file **chỉ còn ở bản cũ** có thể **vẫn nằm lại** (orphan). |
78
+ | **`./install.sh`** từ clone / tarball | Thin **bash** wrapper → gọi `node bin/viepilot.cjs install` | Cùng engine Node như NPX; bash chỉ còn prompt (cloc, PATH) khi không `VIEPILOT_AUTO_YES=1`. |
79
+ | **`./dev-install.sh`** từ clone repo | `dev-install.sh` | **Có** xóa sạch `vp-*` skills + **`rm -rf ~/.cursor/viepilot`** rồi cài lại → gần như cài mới hoàn toàn. |
80
+
81
+ `npx viepilot install` chạy **trực tiếp** Node installer — **không** spawn `bash install.sh`. `install.sh` dùng khi bạn chạy tay từ repo và muốn prompt cloc/PATH giống trước.
82
+
83
+ **Muốn cài sạch sau bản cũ** (tránh sót file):
84
+
85
+ ```bash
86
+ npx viepilot uninstall --yes
87
+ npx viepilot install --target cursor-agent --yes
88
+ ```
89
+
90
+ (Chọn lại `--target` đúng profile bạn dùng.)
91
+
92
+ ---
93
+
94
+ ### Windows / đa OS: `install.sh` và `npx viepilot install` chạy thế nào?
95
+
96
+ **`npx viepilot install`** dùng **Node** (`lib/viepilot-install.cjs`) — **không** cần Bash. **`./install.sh`** là wrapper Bash (prompt cloc/PATH) rồi gọi `node bin/viepilot.cjs install …`. **`dev-install.sh`** vẫn là Bash đầy đủ (xóa + copy).
97
+
98
+ | OS | `npx viepilot install` | `./install.sh` |
99
+ |----|------------------------|----------------|
100
+ | **macOS**, **Linux** | Chỉ cần Node trên PATH | Bash → Node (cùng engine với NPX) |
101
+ | **Windows (CMD/PowerShell)** | Chạy được với Node | Cần Git Bash / WSL cho file `.sh`, hoặc: `node bin\viepilot.cjs install --target cursor-agent --yes` |
102
+ | **PATH `/usr/local/bin`** | Tùy chọn trong installer (Unix); Windows bỏ qua / PATH thủ công | |
103
+
104
+ Với ViePilot **Node-native install**, lỗi **`bash: command not found`** khi chạy **`npx viepilot install`** không còn điển hình — nếu vẫn gặp trên bản cũ, hãy nâng ViePilot hoặc dùng `node bin/viepilot.cjs install …` từ source.
105
+
106
+ ---
107
+
71
108
  ### `vp-tools: command not found`
72
109
 
73
110
  **Cause**: ViePilot bin not in PATH.
@@ -0,0 +1,28 @@
1
+ # Brainstorm sessions — product horizon (MVP / Post-MVP / Future)
2
+
3
+ ViePilot brainstorm lưu session tại `docs/brainstorm/session-*.md`. Để **không mất** ý tưởng sau MVP khi chạy `/vp-crystallize`, mỗi session nên có section **`## Product horizon`** (workflow tự gợi ý cấu trúc khi lưu).
4
+
5
+ ## Tag trên từng bullet
6
+
7
+ | Tag | Ý nghĩa |
8
+ |-----|---------|
9
+ | `(MVP)` | Ship trong bản đầu tiên |
10
+ | `(Post-MVP)` | Đã thống nhất nhưng sau release đầu |
11
+ | `(Future)` | Hướng thử nghiệm / chưa cam kết |
12
+
13
+ ## Các subsection khuyến nghị
14
+
15
+ - **Non-goals for MVP** — Cố tình không làm ở bản đầu (tránh bị hiểu là “quên”).
16
+ - **Deferred capabilities** — Tính năng rõ ràng bị lùi khỏi MVP để crystallize map vào roadmap horizon.
17
+
18
+ ## Single-release (không có post-MVP)
19
+
20
+ Ghi một dòng explicit trong `## Product horizon`, ví dụ: **Single-release product — no separate horizon epics.**
21
+
22
+ ## Tiếp tục session cũ
23
+
24
+ Khi **Continue** session, giữ và cập nhật `## Product horizon`; không xóa section này trừ khi bạn chủ động đổi scope.
25
+
26
+ ## Bước tiếp
27
+
28
+ Sau brainstorm: `/vp-crystallize` — horizon trong session được dùng để bổ sung roadmap và project context (xem workflow crystallize). Tổng quan end-to-end: [Product horizon](product-horizon.md).
@@ -0,0 +1,18 @@
1
+ # Product horizon — từ brainstorm tới roadmap (không để post-MVP “chết” trong session)
2
+
3
+ Ý tưởng **sau MVP** dễ chỉ nằm trong file brainstorm rồi bị AI bỏ qua khi code. ViePilot chuẩn hóa **horizon** để mọi người (và AI) luôn thấy nó ở chỗ đúng.
4
+
5
+ ## Quy tắc ngắn
6
+
7
+ 1. Trong brainstorm: luôn có section **`## Product horizon`** với tag `(MVP)` / `(Post-MVP)` / `(Future)` — xem [Brainstorm & product horizon](brainstorm.md).
8
+ 2. Sau **`/vp-crystallize`**: horizon phải xuất hiện trong **`ROADMAP.md`** (Post-MVP / Future) và **vision theo pha** trong **`PROJECT-CONTEXT.md`** — không được “chỉ để trong `docs/brainstorm/`”.
9
+ 3. Khi AI bắt đầu task implementation sâu: đọc **vision + horizon trước**, rồi mới khóa kiến trúc chi tiết — xem thứ tự trong `AI-GUIDE.md` (file được crystallize tạo dưới `.viepilot/AI-GUIDE.md`).
10
+
11
+ ## Single-release
12
+
13
+ Nếu không có lộ trình sau MVP, ghi rõ một dòng trong horizon (ví dụ *Single-release — no separate horizon epics*) để crystallize không bịa thêm epic.
14
+
15
+ ## Liên kết
16
+
17
+ - Workflow brainstorm: `workflows/brainstorm.md` (trong repo ViePilot).
18
+ - Workflow crystallize: `workflows/crystallize.md` — bước trích horizon và gate “không được lặng lẽ bỏ sót”.
@@ -5,25 +5,76 @@
5
5
  ## Mục tiêu
6
6
  - Chốt hướng UI/UX sớm bằng prototype định hướng
7
7
  - Ghi quyết định thiết kế cùng ngữ cảnh nghiệp vụ
8
- - Tạo đầu vào rõ ràng cho `/vp-crystallize`
8
+ - Tạo đầu vào rõ ràng cho `/vp-crystallize`, kể cả khi sản phẩm có **nhiều page** (FEAT-007)
9
9
 
10
- ## Artifacts
11
- Mỗi session UI tạo/cập nhật:
10
+ ## Hai layout được hỗ trợ
11
+
12
+ ### A) Legacy — một file chính (FEAT-002)
13
+ Dùng khi chỉ có một màn hình / một luồng prototype đơn.
12
14
 
13
15
  ```text
14
16
  .viepilot/ui-direction/{session-id}/
15
- index.html
17
+ index.html # toàn bộ direction
16
18
  style.css
17
- notes.md
19
+ notes.md # rationale, assumptions, references
20
+ ```
21
+
22
+ ### B) Multi-page — mỗi page một HTML (khuyến nghị khi ≥2 màn)
23
+ Dễ diff, dễ review, dễ map sang routing thật sau này.
24
+
25
+ ```text
26
+ .viepilot/ui-direction/{session-id}/
27
+ index.html # hub: liên kết tới mọi page (nav / danh sách)
28
+ style.css # shared styles (tránh copy lớn giữa các file)
29
+ pages/
30
+ landing.html
31
+ dashboard.html
32
+ ...
33
+ notes.md # rationale + bảng inventory (bắt buộc khi có pages/)
18
34
  ```
19
35
 
20
- `notes.md`nguồn sự thật cho:
21
- - rationale
22
- - assumptions
23
- - references (bao gồm 21st.dev links/prompts)
36
+ - **`index.html`**: không bắt buộc trùng nội dung với một page cụ thể; nên **mục lục + link** tới `pages/*.html` để mở nhanh từng màn.
37
+ - **`pages/{slug}.html`**: một file cho một page/screen; đặt `slug` ổn định (trùng tên route dự kiến nếu đã biết).
38
+
39
+ ## `notes.md` nguồn sự thật
40
+
41
+ Luôn ghi:
42
+ - rationale, assumptions, references (21st.dev, v.v.)
43
+
44
+ ### Hook bắt buộc khi thư mục `pages/` tồn tại
45
+
46
+ Sau **mỗi** lần thêm / đổi tên / xóa file trong `pages/`, assistant **phải** cập nhật:
47
+
48
+ 1. Liên kết trong `index.html` (hub).
49
+ 2. Section **`## Pages inventory`** trong `notes.md` (bảng đầy đủ mọi page hiện có).
50
+
51
+ Mẫu bảng (copy-paste và điền):
52
+
53
+ ```markdown
54
+ ## Pages inventory
55
+
56
+ | Slug | File | Title | Purpose | Key sections | Nav to |
57
+ |------|------|-------|---------|--------------|--------|
58
+ | landing | pages/landing.html | Marketing home | Acquire signups | hero, features, CTA | signup, login |
59
+ | dashboard | pages/dashboard.html | App shell | Overview metrics | sidebar, charts, alerts | settings |
60
+ ```
61
+
62
+ - **Slug**: định danh ngắn, ổn định.
63
+ - **File**: đường dẫn tương đối từ thư mục session.
64
+ - **Nav to**: slug hoặc tên page đích (comma-separated).
65
+
66
+ Nếu **không** có thư mục `pages/`, không cần section `## Pages inventory` (layout legacy).
24
67
 
25
68
  ## Flow khuyến nghị
26
69
  1. `/vp-brainstorm --ui`
27
- 2. Cập nhật yêu cầu/điều chỉnh layout trong chat
28
- 3. Assistant cập nhật artifacts theo từng quyết định
29
- 4. `/vp-crystallize` đọc artifacts để map sang tech stack thật
70
+ 2. Chọn legacy hoặc multi-page theo số màn hình.
71
+ 3. Mỗi thay đổi page → cập nhật HTML + **hub + `## Pages inventory`** trong cùng một lượt.
72
+ 4. `/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.
73
+
74
+ ## Kiểm tra nhanh (optional)
75
+
76
+ ```bash
77
+ node scripts/verify-ui-direction-pages.cjs
78
+ ```
79
+
80
+ 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`.
@@ -54,6 +54,25 @@ npm run readme:sync
54
54
  # refresh README Total LOC metrics via cloc
55
55
  ```
56
56
 
57
+ ### Version check & update
58
+
59
+ Sau khi có `vp-tools` trên PATH (ví dụ `npm i -g viepilot` hoặc cài qua `npx viepilot install` copy bundle):
60
+
61
+ ```bash
62
+ vp-tools info
63
+ vp-tools info --json
64
+ ```
65
+
66
+ Cập nhật ViePilot qua npm — nên xem trước bằng dry-run; trong script/CI thêm `--yes` khi apply:
67
+
68
+ ```bash
69
+ vp-tools update --dry-run
70
+ vp-tools update --yes
71
+ vp-tools update --global --yes
72
+ ```
73
+
74
+ Trong project có dependency `viepilot`, có thể chạy: `node node_modules/viepilot/bin/vp-tools.cjs info`.
75
+
57
76
  ---
58
77
 
59
78
  ## Step 2: Create a New Project
@@ -103,6 +122,9 @@ ViePilot tạo `.viepilot/` directory với:
103
122
  - `TRACKER.md` — Progress tracking
104
123
  - `ARCHITECTURE.md` — System design
105
124
  - `SYSTEM-RULES.md` — Coding standards
125
+ - `AI-GUIDE.md` — Thứ tự đọc context (kể cả **vision / horizon** trước khi khóa kiến trúc sâu)
126
+
127
+ **Post-MVP không chỉ nằm trong brainstorm:** sau crystallize, horizon phải vào `ROADMAP.md` + vision theo pha trong `PROJECT-CONTEXT.md`. Tóm tắt cho user: [Product horizon end-to-end](features/product-horizon.md).
106
128
 
107
129
  ---
108
130
 
package/install.sh CHANGED
@@ -1,21 +1,22 @@
1
1
  #!/bin/bash
2
2
 
3
- # ViePilot Installation Script
4
- # Installs ViePilot skills and tools to Cursor/Claude environment
3
+ # ViePilot installation — thin wrapper around the Node installer (bin/viepilot.cjs).
4
+ # Implements prompts + optional cloc install here; file copy/symlink/chmod/path is in lib/viepilot-install.cjs.
5
+ #
6
+ # Optional: VIEPILOT_SYMLINK_SKILLS=1 — passed through to Node (symlink skills into ~/.cursor/skills/)
7
+ # Optional: VIEPILOT_INSTALL_DRY_RUN=1 — runs `viepilot install --dry-run` (for CI/tests)
5
8
 
6
9
  set -e
7
10
 
8
- # Colors for output
9
11
  RED='\033[0;31m'
10
12
  GREEN='\033[0;32m'
11
13
  YELLOW='\033[1;33m'
12
14
  BLUE='\033[0;34m'
13
- NC='\033[0m' # No Color
15
+ NC='\033[0m'
14
16
 
15
- # Get script directory
16
17
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18
+ cd "$SCRIPT_DIR" || exit 1
17
19
 
18
- # Default installation paths
19
20
  CURSOR_SKILLS_DIR="$HOME/.cursor/skills"
20
21
  VIEPILOT_DIR="$HOME/.cursor/viepilot"
21
22
  AUTO_YES="${VIEPILOT_AUTO_YES:-0}"
@@ -28,7 +29,6 @@ echo " VIEPILOT INSTALLER"
28
29
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
29
30
  echo -e "${NC}"
30
31
 
31
- # Check if running from viepilot directory
32
32
  if [ ! -f "$SCRIPT_DIR/README.md" ] || [ ! -d "$SCRIPT_DIR/skills" ]; then
33
33
  echo -e "${RED}Error: Please run this script from the viepilot directory${NC}"
34
34
  exit 1
@@ -38,6 +38,7 @@ echo -e "${YELLOW}Installation paths:${NC}"
38
38
  echo " Skills: $CURSOR_SKILLS_DIR"
39
39
  echo " ViePilot: $VIEPILOT_DIR"
40
40
  echo " Profile: $INSTALL_PROFILE"
41
+ echo " Engine: Node (bin/viepilot.cjs) — no bash copy logic"
41
42
  echo ""
42
43
 
43
44
  install_cloc_best_effort() {
@@ -84,7 +85,6 @@ install_cloc_best_effort() {
84
85
  fi
85
86
  }
86
87
 
87
- # Confirm installation
88
88
  if [ "$AUTO_YES" != "1" ]; then
89
89
  read -p "Continue with installation? (y/n) " -n 1 -r
90
90
  echo
@@ -97,95 +97,29 @@ else
97
97
  fi
98
98
 
99
99
  echo ""
100
- echo -e "${BLUE}Installing...${NC}"
101
-
102
- # Create directories
103
- echo " Creating directories..."
104
- mkdir -p "$CURSOR_SKILLS_DIR"
105
- mkdir -p "$VIEPILOT_DIR/workflows"
106
- mkdir -p "$VIEPILOT_DIR/templates/project"
107
- mkdir -p "$VIEPILOT_DIR/templates/phase"
108
- mkdir -p "$VIEPILOT_DIR/bin"
109
- mkdir -p "$VIEPILOT_DIR/lib"
110
- mkdir -p "$VIEPILOT_DIR/ui-components"
111
-
112
- # Install skills
113
- echo " Installing skills..."
114
- for skill_dir in "$SCRIPT_DIR/skills"/*; do
115
- if [ -d "$skill_dir" ]; then
116
- skill_name=$(basename "$skill_dir")
117
- cp -r "$skill_dir" "$CURSOR_SKILLS_DIR/"
118
- echo " ✓ $skill_name"
119
- fi
120
- done
121
-
122
- # Install workflows
123
- echo " Installing workflows..."
124
- cp -r "$SCRIPT_DIR/workflows"/* "$VIEPILOT_DIR/workflows/"
125
- echo " ✓ workflows"
126
-
127
- # Install templates
128
- echo " Installing templates..."
129
- cp -r "$SCRIPT_DIR/templates/project"/* "$VIEPILOT_DIR/templates/project/"
130
- cp -r "$SCRIPT_DIR/templates/phase"/* "$VIEPILOT_DIR/templates/phase/"
131
- echo " ✓ templates"
132
-
133
- # Install stock UI components
134
- echo " Installing stock UI components..."
135
- if [ -d "$SCRIPT_DIR/ui-components" ]; then
136
- cp -r "$SCRIPT_DIR/ui-components"/* "$VIEPILOT_DIR/ui-components/"
137
- echo " ✓ ui-components"
138
- fi
139
-
140
- # Install CLI tools
141
- echo " Installing CLI tools..."
142
- cp "$SCRIPT_DIR/bin/vp-tools.cjs" "$VIEPILOT_DIR/bin/"
143
- cp "$SCRIPT_DIR/bin/viepilot.cjs" "$VIEPILOT_DIR/bin/"
144
- cp "$SCRIPT_DIR/lib/cli-shared.cjs" "$VIEPILOT_DIR/lib/"
145
- chmod +x "$VIEPILOT_DIR/bin/vp-tools.cjs"
146
- chmod +x "$VIEPILOT_DIR/bin/viepilot.cjs"
147
- echo " ✓ vp-tools.cjs + viepilot.cjs + lib/cli-shared.cjs"
148
-
149
- echo " Checking optional dependency for README metric sync..."
100
+ echo -e "${BLUE}Preparing Node installer...${NC}"
150
101
  install_cloc_best_effort
151
102
 
152
- # Create symlink in PATH (optional)
153
103
  echo ""
154
104
  if [ "$AUTO_YES" != "1" ]; then
155
- read -p "Add vp-tools + viepilot to PATH? (creates symlink in /usr/local/bin) (y/n) " -n 1 -r
105
+ read -p "Add vp-tools + viepilot to PATH? (symlinks via Node installer, often /usr/local/bin) (y/n) " -n 1 -r
156
106
  echo
107
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
108
+ export VIEPILOT_ADD_PATH=1
109
+ fi
157
110
  else
158
- REPLY=$([ "$ADD_PATH_CHOICE" = "1" ] && echo "y" || echo "n")
159
- fi
160
- if [[ $REPLY =~ ^[Yy]$ ]]; then
161
- if [ -w "/usr/local/bin" ]; then
162
- ln -sf "$VIEPILOT_DIR/bin/vp-tools.cjs" "/usr/local/bin/vp-tools"
163
- ln -sf "$VIEPILOT_DIR/bin/viepilot.cjs" "/usr/local/bin/viepilot"
164
- echo " ✓ vp-tools + viepilot added to PATH"
165
- else
166
- echo -e "${YELLOW} Note: Need sudo to create symlink${NC}"
167
- sudo ln -sf "$VIEPILOT_DIR/bin/vp-tools.cjs" "/usr/local/bin/vp-tools"
168
- sudo ln -sf "$VIEPILOT_DIR/bin/viepilot.cjs" "/usr/local/bin/viepilot"
169
- echo " ✓ vp-tools + viepilot added to PATH"
111
+ if [ "$ADD_PATH_CHOICE" = "1" ]; then
112
+ export VIEPILOT_ADD_PATH=1
170
113
  fi
171
114
  fi
172
115
 
116
+ export VIEPILOT_AUTO_YES=1
117
+
118
+ NODE_ARGS=(install --target "$INSTALL_PROFILE" --yes)
119
+ if [ "${VIEPILOT_INSTALL_DRY_RUN:-0}" = "1" ]; then
120
+ NODE_ARGS+=(--dry-run)
121
+ fi
122
+
173
123
  echo ""
174
- echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
175
- echo -e "${GREEN} INSTALLATION COMPLETE ✓${NC}"
176
- echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
177
- echo ""
178
- echo "Installed:"
179
- echo " - Skills: $CURSOR_SKILLS_DIR/vp-*"
180
- echo " - Workflows: $VIEPILOT_DIR/workflows/"
181
- echo " - Templates: $VIEPILOT_DIR/templates/"
182
- echo " - CLI: $VIEPILOT_DIR/bin/vp-tools.cjs"
183
- echo ""
184
- echo "Quick Start:"
185
- echo " 1. Open your project in Cursor"
186
- echo " 2. Run: /vp-brainstorm"
187
- echo " 3. After brainstorm: /vp-crystallize"
188
- echo " 4. Start coding: /vp-auto"
189
- echo ""
190
- echo "Documentation: $SCRIPT_DIR/docs/getting-started.md"
191
- echo ""
124
+ echo -e "${BLUE}Running: node bin/viepilot.cjs ${NODE_ARGS[*]}${NC}"
125
+ exec node "$SCRIPT_DIR/bin/viepilot.cjs" "${NODE_ARGS[@]}"