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,297 @@
1
+ # ViePilot Troubleshooting Guide
2
+
3
+ Common issues and solutions when using ViePilot.
4
+
5
+ ---
6
+
7
+ ## Installation Issues
8
+
9
+ ### `npx viepilot install` fails: "command not found" or "404"
10
+
11
+ **Cause**: Package không có trong npm context hiện tại hoặc chưa publish phiên bản mới.
12
+
13
+ ```bash
14
+ # Run from repository source as fallback
15
+ cd /path/to/viepilot
16
+ node bin/viepilot.cjs install --target all --yes
17
+ ```
18
+
19
+ ---
20
+
21
+ ### `npx viepilot install` asks too many prompts in CI
22
+
23
+ **Cause**: Missing non-interactive flags.
24
+
25
+ ```bash
26
+ npx viepilot install --target cursor-agent --yes --dry-run
27
+ ```
28
+
29
+ Use `--yes` for no prompt and `--target` to avoid interactive selection.
30
+
31
+ ---
32
+
33
+ ### `./install.sh: Permission denied`
34
+
35
+ **Cause**: Script not executable.
36
+
37
+ ```bash
38
+ chmod +x install.sh
39
+ ./install.sh
40
+ ```
41
+
42
+ ---
43
+
44
+ ### `vp-tools: command not found`
45
+
46
+ **Cause**: ViePilot bin not in PATH.
47
+
48
+ ```bash
49
+ # Check if symlink exists
50
+ ls -la ~/.local/bin/vp-tools
51
+
52
+ # If missing, re-run dev install
53
+ cd /path/to/viepilot
54
+ ./dev-install.sh
55
+ ```
56
+
57
+ ---
58
+
59
+ ### Skills not showing in Cursor
60
+
61
+ **Cause**: Skills not copied to the right directory.
62
+
63
+ ```bash
64
+ ls ~/.cursor/skills/vp-*/SKILL.md
65
+ ```
66
+
67
+ If empty:
68
+ ```bash
69
+ cd /path/to/viepilot
70
+ cp -r skills/vp-* ~/.cursor/skills/
71
+ ```
72
+
73
+ Then restart Cursor.
74
+
75
+ ---
76
+
77
+ ## Project Initialization Issues
78
+
79
+ ### `/vp-brainstorm` doesn't produce a template
80
+
81
+ **Cause**: AI model not following the skill structure.
82
+
83
+ **Fix**: Ensure Cursor is using Claude (not GPT). Check Cursor settings → Model.
84
+
85
+ ---
86
+
87
+ ### `vp-tools init` fails: "No ViePilot project found"
88
+
89
+ **Cause**: Running command outside a project with `.viepilot/` directory.
90
+
91
+ ```bash
92
+ # Verify .viepilot/ exists
93
+ ls .viepilot/
94
+
95
+ # If missing, run crystallize first
96
+ # In Cursor: /vp-crystallize
97
+ ```
98
+
99
+ ---
100
+
101
+ ### `HANDOFF.json` is corrupted
102
+
103
+ **Cause**: Interrupted write during state save.
104
+
105
+ ```bash
106
+ # Check the file
107
+ cat .viepilot/HANDOFF.json
108
+
109
+ # If invalid JSON, delete and let ViePilot recreate
110
+ rm .viepilot/HANDOFF.json
111
+ # In Cursor: /vp-auto (will start from TRACKER.md state)
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Autonomous Execution Issues
117
+
118
+ ### `/vp-auto` starts but stops immediately
119
+
120
+ **Cause**: TRACKER.md says all phases complete.
121
+
122
+ ```bash
123
+ cat .viepilot/TRACKER.md
124
+ # Check "Current Phase" section
125
+
126
+ # If ROADMAP.md has new phases not in TRACKER.md:
127
+ # In Cursor: /vp-status
128
+ # Then: /vp-auto --from N (where N is the new phase)
129
+ ```
130
+
131
+ ---
132
+
133
+ ### `/vp-auto` runs one task then the AI ends the turn
134
+
135
+ **Cause**: In chat (Cursor, etc.), one invocation often spans **one task** (implement → verify → update state). Spec does **not** require “no extra args ⇒ stop after every task”; that is typical **session** behavior, not `VP_ARGS` parsing.
136
+
137
+ **Fix**:
138
+
139
+ 1. Send another message: continue the same phase/task from `HANDOFF.json` / `PHASE-STATE.md`, or run `/vp-auto` again.
140
+ 2. Use `/vp-auto --fast` to skip **optional** verification steps (fewer pauses).
141
+ 3. If the task file defines **manual** verification, you will be prompted — that is intentional.
142
+
143
+ See: [Autonomous mode](user/features/autonomous-mode.md).
144
+
145
+ ---
146
+
147
+ ### Phase stuck at 0% for a long time
148
+
149
+ **Cause**: AI model is not executing the task — just planning.
150
+
151
+ **Fix**: Be more direct in the chat:
152
+
153
+ > "Execute the task now. Create the files. Don't just describe what to do."
154
+
155
+ Or use:
156
+ ```
157
+ /vp-task start 1
158
+ ```
159
+
160
+ ---
161
+
162
+ ### Task marked done but code wasn't written
163
+
164
+ **Cause**: AI confirmed acceptance criteria without verifying actual implementation.
165
+
166
+ ```bash
167
+ # Check if files exist
168
+ ls -la src/
169
+
170
+ # Roll back to before the task
171
+ /vp-rollback
172
+ # Select the task's start checkpoint
173
+
174
+ # Restart with explicit instruction
175
+ /vp-task retry 1
176
+ ```
177
+
178
+ ---
179
+
180
+ ### Git tag creation fails: "tag already exists"
181
+
182
+ **Cause**: Previous run created the tag.
183
+
184
+ ```bash
185
+ # Delete the conflicting tag
186
+ git tag -d vp-p2-t3
187
+
188
+ # Resume
189
+ /vp-auto --from 2
190
+ ```
191
+
192
+ ---
193
+
194
+ ## CLI Issues
195
+
196
+ ### `vp-tools progress` shows 0% even after tasks done
197
+
198
+ **Cause**: PHASE-STATE.md uses different status format than expected.
199
+
200
+ ViePilot's `progress` command looks for `✅ Done` pattern in PHASE-STATE.md.
201
+
202
+ ```bash
203
+ # Check what's in the file
204
+ grep -i "done\|complete" .viepilot/phases/*/PHASE-STATE.md
205
+
206
+ # If status uses different emoji/text, manually update:
207
+ # Change "✔ Complete" to "✅ Done"
208
+ ```
209
+
210
+ ---
211
+
212
+ ### `vp-tools version bump` shows wrong version
213
+
214
+ **Cause**: TRACKER.md version block uses non-standard format.
215
+
216
+ Expected format in TRACKER.md:
217
+ ```markdown
218
+ ### Current Version
219
+ \`\`\`
220
+ 0.1.0
221
+ \`\`\`
222
+ ```
223
+
224
+ If your TRACKER.md uses a different format, `version bump` may not parse correctly.
225
+ Edit TRACKER.md to match this exact format.
226
+
227
+ ---
228
+
229
+ ## State Recovery
230
+
231
+ ### How to fully reset ViePilot state
232
+
233
+ ```bash
234
+ # Option 1: Reset to a checkpoint
235
+ /vp-rollback
236
+ # Select earliest checkpoint
237
+
238
+ # Option 2: Manual reset (nuclear option)
239
+ vp-tools reset all --force
240
+ # WARNING: Resets all task statuses to not_started
241
+ # Does NOT undo git commits
242
+
243
+ # Option 3: Start fresh
244
+ rm -rf .viepilot/
245
+ # In Cursor: /vp-crystallize (re-generates .viepilot/)
246
+ ```
247
+
248
+ ---
249
+
250
+ ### Resume after a crash
251
+
252
+ ```bash
253
+ # Check last known state
254
+ cat .viepilot/HANDOFF.json
255
+
256
+ # Check git log for last checkpoint tag
257
+ git log --oneline --tags
258
+
259
+ # Resume from last complete phase
260
+ /vp-resume
261
+ # Or specify:
262
+ /vp-auto --from 2
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Performance Issues
268
+
269
+ ### `/vp-auto` is very slow
270
+
271
+ **Common causes**:
272
+ 1. Large codebase being read every task → Use minimal context loading
273
+ 2. AI generating overly verbose responses → Not controllable, but `/vp-auto --fast` skips optional steps
274
+ 3. Many small tasks → Consider merging small tasks in ROADMAP.md
275
+
276
+ ---
277
+
278
+ ### Tests taking too long in CI
279
+
280
+ **Cause**: Integration tests spawn subprocesses per test.
281
+
282
+ ```bash
283
+ # Check test timing
284
+ npx jest --verbose
285
+
286
+ # Run only unit tests in CI for fast feedback
287
+ npx jest tests/unit/ --no-coverage
288
+ ```
289
+
290
+ ---
291
+
292
+ ## Getting Help
293
+
294
+ 1. **Check the status**: `/vp-status` — shows blockers, current state
295
+ 2. **Debug mode**: `/vp-debug investigate: <your issue>`
296
+ 3. **GitHub Issues**: https://github.com/0-CODE/viepilot/issues
297
+ 4. **Review HANDOFF.json**: Contains full context of last session
@@ -0,0 +1,117 @@
1
+ # Frequently Asked Questions
2
+
3
+ ## General
4
+
5
+ ### Q: ViePilot có yêu cầu AI provider cụ thể không?
6
+
7
+ A: ViePilot hoạt động với bất kỳ AI assistant nào có thể đọc Markdown và thực thi code. Được test tốt nhất với **Cursor + Claude**. Cũng hoạt động với Claude CLI và các AI assistants khác.
8
+
9
+ ---
10
+
11
+ ### Q: ViePilot có thể dùng với VS Code không?
12
+
13
+ A: Skills được thiết kế cho Cursor IDE. Tuy nhiên, workflows và CLI (`vp-tools`) hoạt động với bất kỳ editor nào. Bạn có thể dùng Claude CLI để chạy skills trong terminal.
14
+
15
+ ---
16
+
17
+ ### Q: Tôi có cần biết code để dùng ViePilot không?
18
+
19
+ A: Không nhất thiết. ViePilot giúp AI code cho bạn. Tuy nhiên, để review code và approve control points, hiểu biết cơ bản về programming sẽ hữu ích.
20
+
21
+ ---
22
+
23
+ ### Q: ViePilot có tốn tiền không?
24
+
25
+ A: ViePilot framework là **miễn phí và open source**. Bạn chỉ trả tiền cho AI provider (Cursor subscription hoặc Claude API).
26
+
27
+ ---
28
+
29
+ ## Technical
30
+
31
+ ### Q: `.viepilot/` directory là gì?
32
+
33
+ A: Thư mục chứa toàn bộ project state của ViePilot:
34
+ ```
35
+ .viepilot/
36
+ ├── AI-GUIDE.md # Navigation guide cho AI
37
+ ├── TRACKER.md # Progress tracking
38
+ ├── ROADMAP.md # Phases và tasks
39
+ ├── HANDOFF.json # Machine-readable state
40
+ └── phases/ # Phase-specific files
41
+ ```
42
+
43
+ Commit thư mục này vào git — nó là "memory" của dự án.
44
+
45
+ ---
46
+
47
+ ### Q: HANDOFF.json là gì?
48
+
49
+ A: File JSON chứa machine-readable state: phase hiện tại, task, git HEAD, context. Được update sau mỗi task. Dùng để resume chính xác sau khi pause.
50
+
51
+ ---
52
+
53
+ ### Q: Tôi có thể edit `.viepilot/` files thủ công không?
54
+
55
+ A: Có, nhưng cẩn thận:
56
+ - `TRACKER.md`, `ROADMAP.md` — OK để edit
57
+ - `HANDOFF.json` — Dùng `vp-tools save-state` thay vì edit trực tiếp
58
+ - Phase PHASE-STATE.md — OK để edit status
59
+
60
+ ---
61
+
62
+ ### Q: Git tags `vp-p*` là gì?
63
+
64
+ A: Checkpoint tags được tạo tự động bởi ViePilot:
65
+ - `vp-p1-t1` — Bắt đầu task 1 của phase 1
66
+ - `vp-p1-t1-done` — Hoàn thành task 1
67
+ - `vp-p1-complete` — Hoàn thành phase 1
68
+
69
+ Dùng để rollback an toàn. Xem: `vp-tools checkpoints`
70
+
71
+ ---
72
+
73
+ ### Q: Tại sao `vp-tools progress` hiển thị 0% dù đã làm xong tasks?
74
+
75
+ A: `progress` command đọc `✅ Done` pattern trong PHASE-STATE.md. Nếu AI dùng format khác (ví dụ: `✔ Complete`), progress sẽ không tính đúng.
76
+
77
+ Fix: Update PHASE-STATE.md để dùng `✅ Done` format.
78
+
79
+ ---
80
+
81
+ ### Q: Tôi có thể dùng ViePilot cho dự án đã có sẵn không?
82
+
83
+ A: Có! Chạy `/vp-brainstorm` trong thư mục dự án hiện tại. ViePilot sẽ analyze existing code và tạo roadmap cho phần còn lại.
84
+
85
+ ---
86
+
87
+ ## Workflow
88
+
89
+ ### Q: Khác nhau giữa `/vp-pause` và đóng Cursor là gì?
90
+
91
+ A: `/vp-pause` lưu full context vào `HANDOFF.json` và tạo `.continue-here.md` với instructions. Đóng Cursor không lưu context — bạn sẽ cần `/vp-resume` để restore state đúng cách.
92
+
93
+ ---
94
+
95
+ ### Q: Tôi có thể chạy nhiều phases song song không?
96
+
97
+ A: Không — ViePilot chạy phases tuần tự theo dependency order. Tuy nhiên, trong một phase, các independent tasks có thể được execute song song (tùy AI implementation).
98
+
99
+ ---
100
+
101
+ ### Q: `/vp-auto` dừng giữa chừng — phải làm gì?
102
+
103
+ A: Dùng `/vp-resume` để tiếp tục từ điểm dừng. Nếu có lỗi, dùng `/vp-debug` để investigate, sau đó `/vp-auto --from N` để restart từ phase N.
104
+
105
+ ---
106
+
107
+ ### Q: Làm sao thêm feature mới khi project đang chạy?
108
+
109
+ A: Dùng `/vp-request --feature` — ViePilot sẽ insert phase mới vào roadmap mà không disrupt phases hiện tại.
110
+
111
+ ---
112
+
113
+ ### Q: Khi nào nên dùng `/vp-evolve` vs `/vp-request`?
114
+
115
+ A:
116
+ - `/vp-request --feature` — Thêm feature nhỏ vào milestone hiện tại
117
+ - `/vp-evolve` — Bắt đầu milestone mới (M2, M3) với scope lớn hơn
@@ -0,0 +1,111 @@
1
+ # Feature: Autonomous Mode (`/vp-auto`)
2
+
3
+ Autonomous mode điều phối **toàn bộ** phase và task theo `workflows/autonomous.md`. Bạn **ít can thiệp** so với làm tay từng file, nhưng vẫn có **control points** và (trong chat) thường **phải tiếp tục** qua nhiều lượt nếu một lượt AI chỉ kịp một task.
4
+
5
+ ## Overview
6
+
7
+ ```
8
+ /vp-auto
9
+
10
+ ├── Phase 1 → Task 1.1 → Task 1.2 → Task 1.3 → Phase 1 ✅
11
+ ├── Phase 2 → Task 2.1 → Task 2.2 → ... → Phase 2 ✅
12
+ └── Phase N → ... → Done 🎉
13
+ ```
14
+
15
+ Mỗi task:
16
+ 1. Tạo git checkpoint tag (`vp-p{N}-t{T}`)
17
+ 2. Implement theo acceptance criteria
18
+ 3. Verify (automated + manual nếu cần)
19
+ 4. Commit với conventional commit message
20
+ 5. Tạo done tag (`vp-p{N}-t{T}-done`)
21
+
22
+ ## Flags
23
+
24
+ ```bash
25
+ /vp-auto # Bắt đầu từ phase chưa complete (không bật --fast)
26
+ /vp-auto --from 3 # Bắt đầu từ phase 3
27
+ /vp-auto --phase 2 # Chỉ chạy phase 2
28
+ /vp-auto --fast # Skip optional verifications
29
+ /vp-auto --dry-run # Preview, không execute
30
+ ```
31
+
32
+ ### Doc-first gate (v0.8.2 / BUG-001)
33
+
34
+ Workflow `autonomous.md` yêu cầu **ghi nhận kế hoạch trong file task** và **`PHASE-STATE` → `in_progress`** trước khi chỉnh sửa deliverable. Xem `workflows/autonomous.md` — *Pre-execution documentation gate*.
35
+
36
+ ### `/vp-auto` không có thêm arg — hiểu đúng
37
+
38
+ - **Không** có nghĩa “mỗi task bắt buộc dừng một lần” trong tài liệu workflow; đó không phải cờ ẩn.
39
+ - Có nghĩa bạn không truyền `--fast`, `--from`, `--phase`, `--dry-run` — verify *tùy chọn* sẽ được xử lý đầy đủ hơn so với `--fast`.
40
+ - Nếu **mọi phase** đã complete, workflow dừng ở banner “All phases complete” (không còn lặp task).
41
+
42
+ ### Tại sao vẫn thấy “dừng” sau mỗi task?
43
+
44
+ 1. **Chat / Cursor** — Một turn thường đủ cho một task (implement → verify → cập nhật state). Task tiếp theo: gọi lại `/vp-auto` hoặc nhắc tiếp trong cùng thread.
45
+ 2. **Control points** — Conflict, fail quality gate, blocker, hoặc menu retry/skip/rollback.
46
+ 3. **Manual verification** — Nếu `tasks/*.md` định nghĩa bước manual, AI được hướng dẫn hỏi bạn.
47
+ 4. **Task contract** — Task thiếu mục bắt buộc (ENH-010) thì phải refine task trước khi code (dừng có chủ đích).
48
+
49
+ **Gợi ý:** Dùng `--fast` khi muốn giảm các bước verify *optional* (vẫn không bỏ gate bắt buộc đã mô tả trong task).
50
+
51
+ ## Control Points
52
+
53
+ ViePilot tự động dừng và hỏi bạn khi:
54
+
55
+ ```
56
+ ⚠ Phase 2 (Database): Issue Encountered
57
+
58
+ Conflicting migration files detected.
59
+
60
+ Options:
61
+ 1. Fix and retry
62
+ 2. Skip task
63
+ 3. Rollback task
64
+ 4. Stop autonomous mode
65
+ ```
66
+
67
+ **Khi nào xảy ra**:
68
+ - Conflicts với existing code
69
+ - Quality gate failures (tests fail, lint errors)
70
+ - Task cần user decision
71
+ - Blockers không thể tự resolve
72
+
73
+ ## Quality Gates
74
+
75
+ Trước khi mark task done, ViePilot kiểm tra:
76
+
77
+ ```
78
+ ✅ acceptance_criteria_met
79
+ ✅ automated_tests_pass
80
+ ✅ no_lint_errors
81
+ ```
82
+
83
+ Nếu bất kỳ gate nào fail → control point.
84
+
85
+ ## Checkpoints
86
+
87
+ Mỗi task tạo 2 git tags:
88
+
89
+ ```bash
90
+ vp-p2-t3 # Bắt đầu task 3 của phase 2
91
+ vp-p2-t3-done # Hoàn thành task 3 của phase 2
92
+ ```
93
+
94
+ Khi phase complete:
95
+ ```bash
96
+ vp-p2-complete # Phase 2 hoàn thành
97
+ ```
98
+
99
+ Xem tất cả checkpoints:
100
+ ```bash
101
+ vp-tools checkpoints
102
+ ```
103
+
104
+ ## Tips
105
+
106
+ - **Đừng interrupt** khi AI đang execute — đợi đến control point
107
+ - **`/vp-auto` không arg** ≠ bắt buộc dừng từng task trong spec; **`--fast`** giúp ít dừng ở verify tùy chọn
108
+ - **Sau mỗi task xong** — nếu AI kết thúc turn, chạy tiếp `/vp-auto` hoặc yêu cầu rõ task kế theo `PHASE-STATE.md`
109
+ - **Dùng `--dry-run`** trước khi chạy phase mới để preview
110
+ - **Mở terminal riêng** để chạy `vp-tools progress` theo dõi
111
+ - **Commit thường xuyên** — mỗi task là một atomic commit
@@ -0,0 +1,76 @@
1
+ # Feature: Checkpoint Recovery (`/vp-rollback`)
2
+
3
+ ViePilot tạo git checkpoint tags tại mỗi task — cho phép rollback an toàn đến bất kỳ điểm nào.
4
+
5
+ ## Overview
6
+
7
+ ```
8
+ vp-p1-t1 ──► vp-p1-t1-done ──► vp-p1-t2 ──► vp-p1-t2-done ──► vp-p1-complete
9
+
10
+ Rollback đến đây
11
+ ```
12
+
13
+ ## How to Rollback
14
+
15
+ ```
16
+ /vp-rollback
17
+ ```
18
+
19
+ ViePilot hiển thị danh sách checkpoints:
20
+
21
+ ```
22
+ Select checkpoint to restore:
23
+
24
+ 1. vp-p2-t3-done (Phase 2 Task 3 complete) 2026-03-30 14:30
25
+ 2. vp-p2-t2-done (Phase 2 Task 2 complete) 2026-03-30 13:45
26
+ 3. vp-p2-t1-done (Phase 2 Task 1 complete) 2026-03-30 12:00
27
+ 4. vp-p2-complete (Phase 2 complete) 2026-03-30 11:00
28
+ 5. vp-p1-complete (Phase 1 complete) 2026-03-29 18:00
29
+ ```
30
+
31
+ Chọn số → ViePilot rollback về checkpoint đó.
32
+
33
+ ## Safety
34
+
35
+ Rollback dùng `git revert` — **không phải** `git reset`:
36
+ - Lịch sử git được giữ nguyên
37
+ - Có thể undo rollback nếu cần
38
+ - Không mất commits
39
+
40
+ ## Listing Checkpoints
41
+
42
+ ```bash
43
+ vp-tools checkpoints
44
+ ```
45
+
46
+ Output:
47
+ ```
48
+ ViePilot Checkpoints
49
+
50
+ TAG COMMIT DATE
51
+ ─────────────────────────────────────────────────────
52
+ ✅ vp-p2-complete a1b2c3d 2026-03-30 14:00
53
+ ✔️ vp-p2-t3-done b2c3d4e 2026-03-30 13:45
54
+ 📌 vp-p2-t3 c3d4e5f 2026-03-30 12:00
55
+
56
+ Total: 8 checkpoints
57
+ ```
58
+
59
+ **Icons**:
60
+ - ✅ Phase complete
61
+ - ✔️ Task done
62
+ - 📌 Task start
63
+
64
+ ## Manual Rollback (Advanced)
65
+
66
+ ```bash
67
+ # Rollback đến specific tag
68
+ git revert --no-commit $(git rev-list vp-p2-t3..HEAD)
69
+ git commit -m "revert: rollback to vp-p2-t3"
70
+ ```
71
+
72
+ ## When to Use
73
+
74
+ - Task tạo ra code không đúng → rollback về task start
75
+ - Phase có vấn đề → rollback về phase start
76
+ - Muốn thử approach khác → rollback và retry
@@ -0,0 +1,77 @@
1
+ # Feature: Debug Mode (`/vp-debug`)
2
+
3
+ `/vp-debug` giúp bạn track và resolve issues một cách có hệ thống, với state được lưu lại qua các sessions.
4
+
5
+ ## Overview
6
+
7
+ Thay vì debug theo kiểu "thử cái này, thử cái kia", `/vp-debug` tổ chức:
8
+ - **Problem statement** rõ ràng
9
+ - **Hypotheses** được track
10
+ - **Attempts** với kết quả
11
+ - **Resolution** khi tìm ra
12
+
13
+ ## Starting a Debug Session
14
+
15
+ ```
16
+ /vp-debug investigate: API returns 500 after adding auth middleware
17
+ ```
18
+
19
+ ViePilot tạo `DEBUG-001.md`:
20
+
21
+ ```markdown
22
+ # Debug Session: API returns 500 after adding auth middleware
23
+
24
+ ## Problem
25
+ API returns 500 after adding auth middleware
26
+
27
+ ## Hypotheses
28
+ - [ ] Middleware order incorrect
29
+ - [ ] JWT secret not loaded from env
30
+ - [ ] Token format mismatch
31
+
32
+ ## Attempts
33
+ ### Attempt 1: Check middleware order
34
+ ...
35
+
36
+ ## Resolution
37
+ _Pending_
38
+ ```
39
+
40
+ ## Continuing Across Sessions
41
+
42
+ Debug state được lưu — có thể tiếp tục sau khi close Cursor:
43
+
44
+ ```
45
+ /vp-debug continue
46
+ ```
47
+
48
+ ViePilot load lại debug session và tiếp tục từ hypothesis chưa test.
49
+
50
+ ## Closing a Session
51
+
52
+ ```
53
+ /vp-debug close: Fixed by moving auth middleware before route handlers
54
+ ```
55
+
56
+ ViePilot:
57
+ - Mark session resolved
58
+ - Log fix vào CHANGELOG.md
59
+ - Archive debug file
60
+
61
+ ## Multiple Sessions
62
+
63
+ ```
64
+ /vp-debug list
65
+ ```
66
+
67
+ ```
68
+ Active debug sessions:
69
+ 1. DEBUG-001 — API 500 error (in progress)
70
+ 2. DEBUG-002 — Test flakiness (open)
71
+ ```
72
+
73
+ ## Tips
74
+
75
+ - Mô tả problem cụ thể: "X happens when Y" thay vì "something is broken"
76
+ - Một session per issue — không mix nhiều bugs
77
+ - Dùng `/vp-debug continue` sau context reset để không mất progress
@@ -0,0 +1,29 @@
1
+ # UI Direction Mode
2
+
3
+ `/vp-brainstorm --ui` bật flow thiết kế trực quan ngay trong phiên brainstorm.
4
+
5
+ ## Mục tiêu
6
+ - Chốt hướng UI/UX sớm bằng prototype định hướng
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`
9
+
10
+ ## Artifacts
11
+ Mỗi session UI tạo/cập nhật:
12
+
13
+ ```text
14
+ .viepilot/ui-direction/{session-id}/
15
+ index.html
16
+ style.css
17
+ notes.md
18
+ ```
19
+
20
+ `notes.md` là nguồn sự thật cho:
21
+ - rationale
22
+ - assumptions
23
+ - references (bao gồm 21st.dev links/prompts)
24
+
25
+ ## Flow khuyến nghị
26
+ 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