viepilot 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +230 -0
  2. package/LICENSE +23 -0
  3. package/README.md +550 -0
  4. package/bin/viepilot.cjs +222 -0
  5. package/bin/vp-tools.cjs +912 -0
  6. package/dev-install.sh +109 -0
  7. package/docs/README.md +125 -0
  8. package/docs/advanced-usage.md +366 -0
  9. package/docs/api/README.md +12 -0
  10. package/docs/api/graphql-schema.md +5 -0
  11. package/docs/api/kafka-events.md +5 -0
  12. package/docs/api/rest-api.md +19 -0
  13. package/docs/api/websocket-api.md +5 -0
  14. package/docs/dev/architecture.md +226 -0
  15. package/docs/dev/cli-reference.md +324 -0
  16. package/docs/dev/contributing.md +195 -0
  17. package/docs/dev/deployment.md +204 -0
  18. package/docs/dev/getting-started.md +16 -0
  19. package/docs/dev/testing.md +171 -0
  20. package/docs/dev/ui-components-library.md +36 -0
  21. package/docs/getting-started.md +163 -0
  22. package/docs/skills-reference.md +399 -0
  23. package/docs/troubleshooting.md +297 -0
  24. package/docs/user/faq.md +117 -0
  25. package/docs/user/features/autonomous-mode.md +111 -0
  26. package/docs/user/features/checkpoint-recovery.md +76 -0
  27. package/docs/user/features/debug-mode.md +77 -0
  28. package/docs/user/features/ui-direction.md +29 -0
  29. package/docs/user/quick-start.md +157 -0
  30. package/docs/videos/01-installation.md +113 -0
  31. package/docs/videos/02-first-project.md +132 -0
  32. package/docs/videos/03-autonomous-mode.md +147 -0
  33. package/install.sh +144 -0
  34. package/lib/cli-shared.cjs +108 -0
  35. package/package.json +78 -0
  36. package/skills/vp-audit/SKILL.md +140 -0
  37. package/skills/vp-auto/SKILL.md +204 -0
  38. package/skills/vp-brainstorm/SKILL.md +75 -0
  39. package/skills/vp-crystallize/SKILL.md +175 -0
  40. package/skills/vp-debug/SKILL.md +96 -0
  41. package/skills/vp-docs/SKILL.md +258 -0
  42. package/skills/vp-evolve/SKILL.md +165 -0
  43. package/skills/vp-pause/SKILL.md +150 -0
  44. package/skills/vp-request/SKILL.md +250 -0
  45. package/skills/vp-resume/SKILL.md +141 -0
  46. package/skills/vp-rollback/SKILL.md +116 -0
  47. package/skills/vp-status/SKILL.md +137 -0
  48. package/skills/vp-task/SKILL.md +139 -0
  49. package/skills/vp-ui-components/SKILL.md +64 -0
  50. package/templates/phase/PHASE-STATE.md +35 -0
  51. package/templates/phase/SPEC.md +40 -0
  52. package/templates/phase/SUMMARY.md +67 -0
  53. package/templates/phase/TASK.md +101 -0
  54. package/templates/phase/VERIFICATION.md +49 -0
  55. package/templates/project/AI-GUIDE.md +114 -0
  56. package/templates/project/ARCHITECTURE.md +70 -0
  57. package/templates/project/CHANGELOG.md +36 -0
  58. package/templates/project/CONTRIBUTING.md +154 -0
  59. package/templates/project/CONTRIBUTORS.md +41 -0
  60. package/templates/project/PROJECT-CONTEXT.md +74 -0
  61. package/templates/project/PROJECT-META.md +133 -0
  62. package/templates/project/README.md +197 -0
  63. package/templates/project/ROADMAP.md +56 -0
  64. package/templates/project/SYSTEM-RULES.md +368 -0
  65. package/templates/project/TRACKER.md +50 -0
  66. package/ui-components/INDEX.md +9 -0
  67. package/ui-components/base/button/README.md +8 -0
  68. package/ui-components/base/button/metadata.json +8 -0
  69. package/ui-components/base/card/README.md +8 -0
  70. package/ui-components/base/card/metadata.json +8 -0
  71. package/ui-components/base/input/README.md +8 -0
  72. package/ui-components/base/input/metadata.json +8 -0
  73. package/workflows/audit.md +549 -0
  74. package/workflows/autonomous.md +425 -0
  75. package/workflows/brainstorm.md +257 -0
  76. package/workflows/crystallize.md +418 -0
  77. package/workflows/debug.md +241 -0
  78. package/workflows/documentation.md +587 -0
  79. package/workflows/evolve.md +258 -0
  80. package/workflows/pause-work.md +255 -0
  81. package/workflows/request.md +534 -0
  82. package/workflows/resume-work.md +226 -0
  83. package/workflows/rollback.md +202 -0
  84. package/workflows/ui-components.md +109 -0
@@ -0,0 +1,157 @@
1
+ # Quick Start Guide
2
+
3
+ Bắt đầu với ViePilot trong 5 phút.
4
+
5
+ ## What is ViePilot?
6
+
7
+ ViePilot là framework giúp bạn phát triển phần mềm với AI một cách **có hệ thống và kiểm soát**. Thay vì chat với AI và copy-paste code, ViePilot tổ chức toàn bộ dự án thành phases, tasks, và checkpoints — với AI thực thi từng bước một.
8
+
9
+ ```
10
+ Bạn: Mô tả ý tưởng
11
+
12
+ ViePilot: Tạo roadmap, phases, tasks
13
+
14
+ AI: Tự động code từng task
15
+
16
+ Bạn: Review, approve, hoặc rollback
17
+ ```
18
+
19
+ ---
20
+
21
+ ## Step 1: Install
22
+
23
+ ```bash
24
+ git clone https://github.com/0-CODE/viepilot
25
+ cd viepilot
26
+ npx @0/viepilot install
27
+ ```
28
+
29
+ Chọn profile cài đặt trong wizard:
30
+ - `claude-code`
31
+ - `cursor-agent`
32
+ - `cursor-ide`
33
+
34
+ Non-interactive:
35
+ ```bash
36
+ npx @0/viepilot install --target cursor-agent --yes
37
+ ```
38
+
39
+ Verify:
40
+ ```bash
41
+ viepilot --list-targets
42
+ vp-tools help
43
+ # Hiển thị targets + ViePilot CLI Tools
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Step 2: Create a New Project
49
+
50
+ ```bash
51
+ mkdir my-project && cd my-project
52
+ git init
53
+ ```
54
+
55
+ Mở thư mục trong **Cursor IDE**.
56
+
57
+ ---
58
+
59
+ ## Step 3: Brainstorm
60
+
61
+ Trong Cursor Chat:
62
+
63
+ ```
64
+ /vp-brainstorm Build a REST API for managing tasks
65
+ ```
66
+
67
+ ViePilot sẽ hỏi bạn về:
68
+ - Tech stack (Node.js? Python? Java?)
69
+ - Features cần thiết
70
+ - Constraints (deadline, team size, etc.)
71
+
72
+ Trả lời tự nhiên — không cần format đặc biệt.
73
+
74
+ Nếu dự án thiên về UI/UX:
75
+
76
+ ```text
77
+ /vp-brainstorm --ui
78
+ ```
79
+
80
+ Workflow sẽ duy trì direction artifacts tại `.viepilot/ui-direction/{session-id}/`.
81
+
82
+ ---
83
+
84
+ ## Step 4: Crystallize
85
+
86
+ ```
87
+ /vp-crystallize
88
+ ```
89
+
90
+ ViePilot tạo `.viepilot/` directory với:
91
+ - `ROADMAP.md` — Phases và tasks
92
+ - `TRACKER.md` — Progress tracking
93
+ - `ARCHITECTURE.md` — System design
94
+ - `SYSTEM-RULES.md` — Coding standards
95
+
96
+ ---
97
+
98
+ ## Step 5: Run Autonomous Mode
99
+
100
+ ```
101
+ /vp-auto
102
+ ```
103
+
104
+ ViePilot sẽ:
105
+ 1. Đọc phase đầu tiên (hoặc phase tiếp theo) từ ROADMAP.md / TRACKER
106
+ 2. Tạo git checkpoint tag
107
+ 3. Implement từng task
108
+ 4. Verify acceptance criteria
109
+ 5. Commit và cập nhật state; lặp task kế hoặc phase kế
110
+
111
+ **Can thiệp của bạn:** Tại **control points** (lỗi, conflict, bước manual trong task, menu retry/skip). **Không arg** trên `/vp-auto` không có nghĩa bị “khóa” dừng sau mỗi task trong spec — nhưng trong chat một lượt AI thường xử lý một task; muốn chạy tiếp, gọi lại `/vp-auto` hoặc nhắc tiếp. Dùng `/vp-auto --fast` nếu muốn **bỏ qua verify tùy chọn** (ít dừng hơn). Chi tiết: [Autonomous mode](features/autonomous-mode.md).
112
+
113
+ ---
114
+
115
+ ## Step 6: Check Progress
116
+
117
+ ```
118
+ /vp-status
119
+ ```
120
+
121
+ Hiển thị:
122
+ ```
123
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
124
+ VIEPILOT ► STATUS
125
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
126
+
127
+ Phase 1: Setup [██████████] 100% ✅
128
+ Phase 2: Core API [████░░░░░░] 40% 🔄
129
+ Phase 3: Tests [░░░░░░░░░░] 0% ⏳
130
+
131
+ Overall: [████░░░░░░] 47%
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Common Commands
137
+
138
+ | Command | When to Use |
139
+ |---------|-------------|
140
+ | `/vp-brainstorm` | Bắt đầu project mới hoặc feature mới |
141
+ | `/vp-crystallize` | Sau brainstorm, tạo artifacts |
142
+ | `/vp-auto` | Chạy autonomous execution |
143
+ | `/vp-status` | Xem progress dashboard |
144
+ | `/vp-pause` | Dừng và lưu state |
145
+ | `/vp-resume` | Tiếp tục từ lần dừng |
146
+ | `/vp-request --feature` | Thêm feature mới |
147
+ | `/vp-rollback` | Quay lại checkpoint trước |
148
+ | `/vp-debug` | Debug issue có hệ thống |
149
+
150
+ ---
151
+
152
+ ## Next Steps
153
+
154
+ - [Skills Reference](../skills-reference.md) — Chi tiết tất cả commands
155
+ - [Advanced Usage](../advanced-usage.md) — Power user features
156
+ - [Troubleshooting](../troubleshooting.md) — Common issues
157
+ - [Examples](../../examples/) — 3 example projects
@@ -0,0 +1,113 @@
1
+ # Video Script: ViePilot Installation
2
+
3
+ **Target duration**: 5 minutes
4
+ **Audience**: Developers new to ViePilot
5
+ **Tool**: Terminal + Cursor IDE
6
+
7
+ ---
8
+
9
+ ## 0:00 — Introduction
10
+
11
+ > "Welcome to ViePilot — the autonomous vibe coding framework. In this video,
12
+ > we'll get ViePilot installed and running your first project in under 5 minutes."
13
+
14
+ Show: ViePilot README on GitHub
15
+
16
+ ---
17
+
18
+ ## 0:30 — Prerequisites
19
+
20
+ > "You'll need: Git, Node.js 18+, and Cursor IDE with Claude enabled."
21
+
22
+ ```bash
23
+ node --version # v18+
24
+ git --version # any recent version
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 1:00 — Installation
30
+
31
+ > "Clone the repository and run the install script."
32
+
33
+ ```bash
34
+ git clone https://github.com/0-CODE/viepilot
35
+ cd viepilot
36
+ ./install.sh
37
+ ```
38
+
39
+ > "The installer copies skills to `~/.cursor/skills/` and workflows to
40
+ > `~/.cursor/viepilot/`. You'll see confirmation for each file."
41
+
42
+ Show: installer output with ✔ checkmarks
43
+
44
+ ---
45
+
46
+ ## 1:45 — Verify Installation
47
+
48
+ > "Let's verify everything is set up correctly."
49
+
50
+ ```bash
51
+ vp-tools help
52
+ ```
53
+
54
+ Show: help output listing all 13 commands
55
+
56
+ > "And check that skills are accessible in Cursor:"
57
+
58
+ Show: Cursor → open a project → type `/vp-` to see skill completions
59
+
60
+ ---
61
+
62
+ ## 2:30 — Create Your First Project
63
+
64
+ > "Navigate to your project directory and initialize ViePilot."
65
+
66
+ ```bash
67
+ cd ~/my-project
68
+ /vp-brainstorm
69
+ ```
70
+
71
+ Show: Cursor Chat with /vp-brainstorm producing a brainstorm template
72
+
73
+ ---
74
+
75
+ ## 3:30 — Run Crystallize
76
+
77
+ > "Now crystallize the brainstorm into executable artifacts."
78
+
79
+ ```bash
80
+ /vp-crystallize
81
+ ```
82
+
83
+ Show: Cursor generating `.viepilot/` directory structure with TRACKER.md, ROADMAP.md
84
+
85
+ ---
86
+
87
+ ## 4:15 — Start Autonomous Mode
88
+
89
+ > "With your project structure ready, kick off autonomous execution:"
90
+
91
+ ```bash
92
+ /vp-auto
93
+ ```
94
+
95
+ Show: vp-auto banner displaying project name, phase, progress bar
96
+
97
+ ---
98
+
99
+ ## 4:45 — Summary
100
+
101
+ > "In just 5 minutes you've installed ViePilot and initialized your first project.
102
+ > Next video: Creating your first feature with `/vp-brainstorm` in depth."
103
+
104
+ Show: `/vp-status` dashboard with progress bars
105
+
106
+ ---
107
+
108
+ ## Recording Notes
109
+
110
+ - Record at 1920×1080
111
+ - Use large terminal font (18pt+)
112
+ - Pause 2 seconds after each command before showing output
113
+ - Add captions for accessibility
@@ -0,0 +1,132 @@
1
+ # Video Script: Your First ViePilot Project
2
+
3
+ **Target duration**: 8 minutes
4
+ **Audience**: Developers who completed installation
5
+ **Tool**: Cursor IDE with a blank Node.js project
6
+
7
+ ---
8
+
9
+ ## 0:00 — What We're Building
10
+
11
+ > "We're building a simple REST API with ViePilot guiding us through every step —
12
+ > from brainstorm to deployed code."
13
+
14
+ Show: final project structure in file tree
15
+
16
+ ---
17
+
18
+ ## 0:30 — Start Brainstorm
19
+
20
+ > "Open your project in Cursor and start a brainstorm session."
21
+
22
+ ```
23
+ /vp-brainstorm Build a REST API for managing todo items
24
+ ```
25
+
26
+ Show: ViePilot asking clarifying questions about tech stack, features, constraints
27
+
28
+ ---
29
+
30
+ ## 1:30 — Answer Questions
31
+
32
+ > "ViePilot gathers requirements through conversation. Answer naturally."
33
+
34
+ Demo conversation:
35
+ - Tech stack: Node.js + Express + SQLite
36
+ - Features: CRUD todos, tags, due dates
37
+ - Constraints: No auth needed for MVP
38
+
39
+ ---
40
+
41
+ ## 2:30 — Crystallize
42
+
43
+ > "Now convert the brainstorm into your project plan."
44
+
45
+ ```
46
+ /vp-crystallize
47
+ ```
48
+
49
+ Show: `.viepilot/` directory being created with:
50
+ - `ROADMAP.md` (phases)
51
+ - `TRACKER.md` (current state)
52
+ - `HANDOFF.json` (machine state)
53
+
54
+ ---
55
+
56
+ ## 3:30 — Review the Roadmap
57
+
58
+ > "Let's see what ViePilot planned for us."
59
+
60
+ ```bash
61
+ cat .viepilot/ROADMAP.md
62
+ ```
63
+
64
+ Show: 3 phases — Project Setup, Core API, Testing
65
+
66
+ ---
67
+
68
+ ## 4:00 — Start Autonomous Execution
69
+
70
+ > "One command to start building:"
71
+
72
+ ```
73
+ /vp-auto
74
+ ```
75
+
76
+ Show: progress banner, then watch Phase 1 tasks execute:
77
+ - Creating project structure
78
+ - Installing dependencies
79
+ - Setting up Express
80
+
81
+ ---
82
+
83
+ ## 5:30 — Check Progress
84
+
85
+ > "At any point, check where you are:"
86
+
87
+ ```
88
+ /vp-status
89
+ ```
90
+
91
+ Show: visual dashboard with progress bars and current task
92
+
93
+ ---
94
+
95
+ ## 6:00 — Phase Complete
96
+
97
+ > "When Phase 1 completes, ViePilot creates a checkpoint tag and moves on."
98
+
99
+ Show: git log with `vp-p1-complete` tag
100
+
101
+ ---
102
+
103
+ ## 6:30 — Pause and Resume
104
+
105
+ > "Need to step away? Pause cleanly:"
106
+
107
+ ```
108
+ /vp-pause
109
+ ```
110
+
111
+ > "When you're back:"
112
+
113
+ ```
114
+ /vp-resume
115
+ ```
116
+
117
+ Show: context restored with same phase and task
118
+
119
+ ---
120
+
121
+ ## 7:30 — Summary
122
+
123
+ > "That's the core ViePilot flow: brainstorm → crystallize → auto.
124
+ > Next: Advanced features with `/vp-debug` and `/vp-rollback`."
125
+
126
+ ---
127
+
128
+ ## Recording Notes
129
+
130
+ - Use a fresh project directory
131
+ - Pre-configure with working Node.js and git initialized
132
+ - Keep Cursor Chat visible throughout
@@ -0,0 +1,147 @@
1
+ # Video Script: Mastering Autonomous Mode
2
+
3
+ **Target duration**: 7 minutes
4
+ **Audience**: Developers comfortable with ViePilot basics
5
+ **Tool**: Cursor IDE with an existing ViePilot project
6
+
7
+ ---
8
+
9
+ ## 0:00 — Overview
10
+
11
+ > "Autonomous mode is ViePilot's superpower. In this video, we cover advanced
12
+ > techniques: control points, recovery, parallel tasks, and quality gates."
13
+
14
+ ---
15
+
16
+ ## 0:30 — Control Points
17
+
18
+ > "vp-auto pauses automatically when it needs your input."
19
+
20
+ Show: a blocker scenario — conflicting files detected
21
+
22
+ ```
23
+ ⚠ Phase 2 (Database): Issue Encountered
24
+ Conflicting migration files detected.
25
+
26
+ Options:
27
+ 1. Fix and retry
28
+ 2. Skip task
29
+ 3. Rollback task
30
+ 4. Stop autonomous mode
31
+ ```
32
+
33
+ > "Enter '1' to auto-fix, '2' to skip, '3' to rollback, '4' to stop."
34
+
35
+ ---
36
+
37
+ ## 1:30 — Rollback
38
+
39
+ > "Made a mistake? Roll back to any checkpoint."
40
+
41
+ ```
42
+ /vp-rollback
43
+ ```
44
+
45
+ Show: list of available checkpoints (git tags)
46
+
47
+ ```
48
+ 1. vp-p2-t3 (Phase 2 Task 3 start)
49
+ 2. vp-p2-t2-done (Phase 2 Task 2 complete)
50
+ 3. vp-p2-t1-done (Phase 2 Task 1 complete)
51
+ ```
52
+
53
+ > "Select a checkpoint to restore."
54
+
55
+ ---
56
+
57
+ ## 2:30 — Debug Mode
58
+
59
+ > "When something goes wrong and you need to track down why:"
60
+
61
+ ```
62
+ /vp-debug investigate: API tests failing after database migration
63
+ ```
64
+
65
+ Show: vp-debug creating a debug session, tracking hypothesis attempts
66
+
67
+ ---
68
+
69
+ ## 3:30 — Running Specific Phases
70
+
71
+ > "Skip ahead or repeat a specific phase:"
72
+
73
+ ```
74
+ /vp-auto --phase 3
75
+ ```
76
+
77
+ > "Or start from a specific phase:"
78
+
79
+ ```
80
+ /vp-auto --from 2
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 4:00 — Fast Mode
86
+
87
+ > "Skip optional verifications for speed (not recommended for production):"
88
+
89
+ ```
90
+ /vp-auto --fast
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 4:30 — Dry Run
96
+
97
+ > "Preview what would happen without executing:"
98
+
99
+ ```
100
+ /vp-auto --dry-run
101
+ ```
102
+
103
+ Show: plan displayed without any file changes
104
+
105
+ ---
106
+
107
+ ## 5:00 — Quality Gates
108
+
109
+ > "vp-auto enforces quality at every step. Here's what it checks:"
110
+
111
+ ```
112
+ quality_gate:
113
+ ✅ acceptance_criteria_met
114
+ ✅ automated_tests_pass
115
+ ✅ no_lint_errors
116
+ ```
117
+
118
+ > "If any gate fails, you get a control point — not a silent failure."
119
+
120
+ ---
121
+
122
+ ## 5:30 — Monitoring with vp-status
123
+
124
+ > "Keep a second terminal open with status:"
125
+
126
+ ```
127
+ /vp-status
128
+ ```
129
+
130
+ Show: updating dashboard as phases complete
131
+
132
+ ---
133
+
134
+ ## 6:30 — Summary
135
+
136
+ > "Key takeaways: control points keep you in charge, rollback makes mistakes safe,
137
+ > and quality gates ensure every commit is clean. ViePilot's autonomy has guardrails."
138
+
139
+ Show: final project with all phases complete, `vp-p4-complete` tag in git log
140
+
141
+ ---
142
+
143
+ ## Recording Notes
144
+
145
+ - Use a project with a deliberate error in phase 2 to demonstrate control points
146
+ - Show the git log with checkpoint tags prominently
147
+ - Keep terminal font large for readability
package/install.sh ADDED
@@ -0,0 +1,144 @@
1
+ #!/bin/bash
2
+
3
+ # ViePilot Installation Script
4
+ # Installs ViePilot skills and tools to Cursor/Claude environment
5
+
6
+ set -e
7
+
8
+ # Colors for output
9
+ RED='\033[0;31m'
10
+ GREEN='\033[0;32m'
11
+ YELLOW='\033[1;33m'
12
+ BLUE='\033[0;34m'
13
+ NC='\033[0m' # No Color
14
+
15
+ # Get script directory
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+
18
+ # Default installation paths
19
+ CURSOR_SKILLS_DIR="$HOME/.cursor/skills"
20
+ VIEPILOT_DIR="$HOME/.cursor/viepilot"
21
+ AUTO_YES="${VIEPILOT_AUTO_YES:-0}"
22
+ INSTALL_PROFILE="${VIEPILOT_INSTALL_PROFILE:-cursor-ide}"
23
+ ADD_PATH_CHOICE="${VIEPILOT_ADD_PATH:-0}"
24
+
25
+ echo -e "${BLUE}"
26
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
27
+ echo " VIEPILOT INSTALLER"
28
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
29
+ echo -e "${NC}"
30
+
31
+ # Check if running from viepilot directory
32
+ if [ ! -f "$SCRIPT_DIR/README.md" ] || [ ! -d "$SCRIPT_DIR/skills" ]; then
33
+ echo -e "${RED}Error: Please run this script from the viepilot directory${NC}"
34
+ exit 1
35
+ fi
36
+
37
+ echo -e "${YELLOW}Installation paths:${NC}"
38
+ echo " Skills: $CURSOR_SKILLS_DIR"
39
+ echo " ViePilot: $VIEPILOT_DIR"
40
+ echo " Profile: $INSTALL_PROFILE"
41
+ echo ""
42
+
43
+ # Confirm installation
44
+ if [ "$AUTO_YES" != "1" ]; then
45
+ read -p "Continue with installation? (y/n) " -n 1 -r
46
+ echo
47
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
48
+ echo "Installation cancelled."
49
+ exit 0
50
+ fi
51
+ else
52
+ echo "Auto-yes enabled via VIEPILOT_AUTO_YES=1"
53
+ fi
54
+
55
+ echo ""
56
+ echo -e "${BLUE}Installing...${NC}"
57
+
58
+ # Create directories
59
+ echo " Creating directories..."
60
+ mkdir -p "$CURSOR_SKILLS_DIR"
61
+ mkdir -p "$VIEPILOT_DIR/workflows"
62
+ mkdir -p "$VIEPILOT_DIR/templates/project"
63
+ mkdir -p "$VIEPILOT_DIR/templates/phase"
64
+ mkdir -p "$VIEPILOT_DIR/bin"
65
+ mkdir -p "$VIEPILOT_DIR/lib"
66
+ mkdir -p "$VIEPILOT_DIR/ui-components"
67
+
68
+ # Install skills
69
+ echo " Installing skills..."
70
+ for skill_dir in "$SCRIPT_DIR/skills"/*; do
71
+ if [ -d "$skill_dir" ]; then
72
+ skill_name=$(basename "$skill_dir")
73
+ cp -r "$skill_dir" "$CURSOR_SKILLS_DIR/"
74
+ echo " ✓ $skill_name"
75
+ fi
76
+ done
77
+
78
+ # Install workflows
79
+ echo " Installing workflows..."
80
+ cp -r "$SCRIPT_DIR/workflows"/* "$VIEPILOT_DIR/workflows/"
81
+ echo " ✓ workflows"
82
+
83
+ # Install templates
84
+ echo " Installing templates..."
85
+ cp -r "$SCRIPT_DIR/templates/project"/* "$VIEPILOT_DIR/templates/project/"
86
+ cp -r "$SCRIPT_DIR/templates/phase"/* "$VIEPILOT_DIR/templates/phase/"
87
+ echo " ✓ templates"
88
+
89
+ # Install stock UI components
90
+ echo " Installing stock UI components..."
91
+ if [ -d "$SCRIPT_DIR/ui-components" ]; then
92
+ cp -r "$SCRIPT_DIR/ui-components"/* "$VIEPILOT_DIR/ui-components/"
93
+ echo " ✓ ui-components"
94
+ fi
95
+
96
+ # Install CLI tools
97
+ echo " Installing CLI tools..."
98
+ cp "$SCRIPT_DIR/bin/vp-tools.cjs" "$VIEPILOT_DIR/bin/"
99
+ cp "$SCRIPT_DIR/bin/viepilot.cjs" "$VIEPILOT_DIR/bin/"
100
+ cp "$SCRIPT_DIR/lib/cli-shared.cjs" "$VIEPILOT_DIR/lib/"
101
+ chmod +x "$VIEPILOT_DIR/bin/vp-tools.cjs"
102
+ chmod +x "$VIEPILOT_DIR/bin/viepilot.cjs"
103
+ echo " ✓ vp-tools.cjs + viepilot.cjs + lib/cli-shared.cjs"
104
+
105
+ # Create symlink in PATH (optional)
106
+ echo ""
107
+ if [ "$AUTO_YES" != "1" ]; then
108
+ read -p "Add vp-tools + viepilot to PATH? (creates symlink in /usr/local/bin) (y/n) " -n 1 -r
109
+ echo
110
+ else
111
+ REPLY=$([ "$ADD_PATH_CHOICE" = "1" ] && echo "y" || echo "n")
112
+ fi
113
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
114
+ if [ -w "/usr/local/bin" ]; then
115
+ ln -sf "$VIEPILOT_DIR/bin/vp-tools.cjs" "/usr/local/bin/vp-tools"
116
+ ln -sf "$VIEPILOT_DIR/bin/viepilot.cjs" "/usr/local/bin/viepilot"
117
+ echo " ✓ vp-tools + viepilot added to PATH"
118
+ else
119
+ echo -e "${YELLOW} Note: Need sudo to create symlink${NC}"
120
+ sudo ln -sf "$VIEPILOT_DIR/bin/vp-tools.cjs" "/usr/local/bin/vp-tools"
121
+ sudo ln -sf "$VIEPILOT_DIR/bin/viepilot.cjs" "/usr/local/bin/viepilot"
122
+ echo " ✓ vp-tools + viepilot added to PATH"
123
+ fi
124
+ fi
125
+
126
+ echo ""
127
+ echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
128
+ echo -e "${GREEN} INSTALLATION COMPLETE ✓${NC}"
129
+ echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
130
+ echo ""
131
+ echo "Installed:"
132
+ echo " - Skills: $CURSOR_SKILLS_DIR/vp-*"
133
+ echo " - Workflows: $VIEPILOT_DIR/workflows/"
134
+ echo " - Templates: $VIEPILOT_DIR/templates/"
135
+ echo " - CLI: $VIEPILOT_DIR/bin/vp-tools.cjs"
136
+ echo ""
137
+ echo "Quick Start:"
138
+ echo " 1. Open your project in Cursor"
139
+ echo " 2. Run: /vp-brainstorm"
140
+ echo " 3. After brainstorm: /vp-crystallize"
141
+ echo " 4. Start coding: /vp-auto"
142
+ echo ""
143
+ echo "Documentation: $SCRIPT_DIR/docs/getting-started.md"
144
+ echo ""