viepilot 1.14.0 → 2.4.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 (58) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/README.md +27 -17
  3. package/bin/viepilot.cjs +19 -9
  4. package/bin/vp-tools.cjs +193 -0
  5. package/docs/user/features/adapters.md +74 -0
  6. package/docs/user/features/hooks.md +93 -0
  7. package/lib/adapters/antigravity.cjs +33 -0
  8. package/lib/adapters/claude-code.cjs +42 -0
  9. package/lib/adapters/codex.cjs +34 -0
  10. package/lib/adapters/cursor.cjs +32 -0
  11. package/lib/adapters/index.cjs +28 -0
  12. package/lib/hooks/brainstorm-staleness.cjs +231 -0
  13. package/lib/viepilot-config.cjs +103 -0
  14. package/lib/viepilot-install.cjs +125 -152
  15. package/package.json +1 -3
  16. package/skills/vp-audit/SKILL.md +23 -23
  17. package/skills/vp-auto/SKILL.md +23 -9
  18. package/skills/vp-brainstorm/SKILL.md +44 -38
  19. package/skills/vp-crystallize/SKILL.md +25 -19
  20. package/skills/vp-debug/SKILL.md +4 -4
  21. package/skills/vp-docs/SKILL.md +8 -8
  22. package/skills/vp-evolve/SKILL.md +26 -13
  23. package/skills/vp-info/SKILL.md +24 -24
  24. package/skills/vp-pause/SKILL.md +7 -7
  25. package/skills/vp-request/SKILL.md +14 -14
  26. package/skills/vp-resume/SKILL.md +6 -6
  27. package/skills/vp-rollback/SKILL.md +4 -4
  28. package/skills/vp-status/SKILL.md +4 -4
  29. package/skills/vp-task/SKILL.md +2 -2
  30. package/skills/vp-ui-components/SKILL.md +14 -14
  31. package/skills/vp-update/SKILL.md +18 -18
  32. package/templates/architect/apis.html +11 -10
  33. package/templates/architect/architect-actions.js +217 -0
  34. package/templates/architect/architecture.html +8 -7
  35. package/templates/architect/data-flow.html +5 -4
  36. package/templates/architect/decisions.html +4 -3
  37. package/templates/architect/deployment.html +10 -9
  38. package/templates/architect/erd.html +7 -6
  39. package/templates/architect/feature-map.html +5 -4
  40. package/templates/architect/sequence-diagram.html +6 -5
  41. package/templates/architect/style.css +146 -0
  42. package/templates/architect/tech-notes.html +3 -2
  43. package/templates/architect/tech-stack.html +8 -7
  44. package/templates/architect/user-use-cases.html +8 -7
  45. package/templates/project/AI-GUIDE.md +49 -49
  46. package/workflows/audit.md +3 -3
  47. package/workflows/autonomous.md +70 -5
  48. package/workflows/brainstorm.md +398 -222
  49. package/workflows/crystallize.md +51 -33
  50. package/workflows/debug.md +9 -9
  51. package/workflows/documentation.md +5 -5
  52. package/workflows/evolve.md +46 -12
  53. package/workflows/pause-work.md +2 -2
  54. package/workflows/request.md +8 -8
  55. package/workflows/resume-work.md +1 -1
  56. package/workflows/rollback.md +1 -1
  57. package/dev-install.sh +0 -150
  58. package/install.sh +0 -125
@@ -1,70 +1,70 @@
1
1
  # {{PROJECT_NAME}} - AI Navigation Guide
2
2
 
3
- > **Đọc file này TRƯỚC KHI làm bất kỳ task nào**
4
- > File này giúp bạn tìm đúng context không cần load tất cả
3
+ > **Read this file BEFORE starting any task**
4
+ > This file helps you find the right context without loading everything
5
5
 
6
6
  ## Quick Lookup
7
7
 
8
- | Tôi cần... | Đọc file | Section |
9
- |------------|----------|---------|
10
- | Hiểu project làm | `PROJECT-CONTEXT.md` | `<domain_knowledge>` |
11
- | Tầm nhìn & scope theo pha | `PROJECT-CONTEXT.md` | `<product_vision>` |
12
- | Roadmap phases (không chỉ task hiện tại) | `ROADMAP.md` | Phases sau phase hiện tại |
13
- | Biết tech stack | `ARCHITECTURE.md` | `## Technology Decisions` |
14
- | Xem service nào làm | `ARCHITECTURE.md` | `## Services` |
15
- | Biết đang phase nào | `TRACKER.md` | `## Current State` |
16
- | Xem task tiếp theo | `ROADMAP.md` | Tìm phase đang `In Progress` |
8
+ | I need to... | Read file | Section |
9
+ |--------------|-----------|---------|
10
+ | Understand what the project does | `PROJECT-CONTEXT.md` | `<domain_knowledge>` |
11
+ | Vision & phased scope | `PROJECT-CONTEXT.md` | `<product_vision>` |
12
+ | Roadmap phases (beyond current task) | `ROADMAP.md` | Phases after current phase |
13
+ | Know the tech stack | `ARCHITECTURE.md` | `## Technology Decisions` |
14
+ | See what each service does | `ARCHITECTURE.md` | `## Services` |
15
+ | Know current phase | `TRACKER.md` | `## Current State` |
16
+ | See next task | `ROADMAP.md` | Find phase marked `In Progress` |
17
17
  | Coding conventions | `SYSTEM-RULES.md` | `<coding_rules>` |
18
- | Những KHÔNG được làm | `SYSTEM-RULES.md` | `<do_not>` |
18
+ | What NOT to do | `SYSTEM-RULES.md` | `<do_not>` |
19
19
  | Database schema | `schemas/database-schema.sql` | - |
20
20
  | API contracts | `schemas/api-contracts.yaml` | - |
21
- | Decisions đã quyết định | `TRACKER.md` | `## Decision Log` |
22
- | Resume công việc dở | `HANDOFF.json` | - |
21
+ | Past decisions | `TRACKER.md` | `## Decision Log` |
22
+ | Resume in-progress work | `HANDOFF.json` | - |
23
23
  | Package structure | `PROJECT-META.md` | `## Package Structure` |
24
24
  | File headers | `PROJECT-META.md` | `## File Headers` |
25
25
 
26
26
  ## Context Loading Strategy
27
27
 
28
- ### Minimal Context (cho quick tasks)
28
+ ### Minimal Context (for quick tasks)
29
29
  ```
30
- Chỉ đọc:
31
- 1. AI-GUIDE.md (file này)
30
+ Read only:
31
+ 1. AI-GUIDE.md (this file)
32
32
  2. TRACKER.md → Current State
33
- 3. File cụ thể liên quan đến task
33
+ 3. The specific file related to the task
34
34
  ```
35
35
 
36
- ### Standard Context (cho coding tasks)
36
+ ### Standard Context (for coding tasks)
37
37
  ```
38
- Đọc theo thứ tự:
39
- 1. AI-GUIDE.md (file này)
40
- 2. TRACKER.md → biết đang đâu
41
- 3. PROJECT-CONTEXT.md → <product_vision> + phased scope (đọc TRƯỚC khi khóa thiết kế chi tiết)
42
- 4. ROADMAP.md → skim phases sau phase hiện tại, rồi task hiện tại
38
+ Read in order:
39
+ 1. AI-GUIDE.md (this file)
40
+ 2. TRACKER.md → know where you are
41
+ 3. PROJECT-CONTEXT.md → <product_vision> + phased scope (read BEFORE locking detailed design)
42
+ 4. ROADMAP.md → skim phases after current phase, then current task
43
43
  5. SYSTEM-RULES.md → coding rules
44
- 6. Schema file nếu cần
44
+ 6. Schema file if needed
45
45
  ```
46
46
 
47
- ### Full Context (cho architecture decisions)
47
+ ### Full Context (for architecture decisions)
48
48
  ```
49
- Đọc theo thứ tự:
49
+ Read in order:
50
50
  1. AI-GUIDE.md + TRACKER.md
51
- 2. PROJECT-CONTEXT.md → domain + <product_vision> (đầy đủ)
51
+ 2. PROJECT-CONTEXT.md → domain + <product_vision> (complete)
52
52
  3. ROADMAP.md → phases + tasks
53
53
  4. ARCHITECTURE.md
54
54
  5. SYSTEM-RULES.md
55
- 6. Brainstorm session gốc (nếu cần rationale chi tiết)
55
+ 6. Original brainstorm session (if detailed rationale needed)
56
56
  ```
57
57
 
58
- ### Product vision & phase planning (trước khi “lock” architecture)
58
+ ### Product vision & phase planning (before "locking" architecture)
59
59
 
60
- - Trước task implementation sâu hoặc quyết định kiến trúc lớn: đọc phần `<product_vision>` phase goals trong `ROADMAP.md` **cùng lúc** với task hiện tại.
60
+ - Before deep implementation tasks or major architecture decisions: read `<product_vision>` and phase goals in `ROADMAP.md` **together** with the current task.
61
61
 
62
62
  ## File Relationships
63
63
 
64
64
  ```
65
- AI-GUIDE.md (đọc đầu tiên)
65
+ AI-GUIDE.md (read first)
66
66
 
67
- ├── TRACKER.md (state hiện tại)
67
+ ├── TRACKER.md (current state)
68
68
  │ └── points to → current phase in ROADMAP.md
69
69
 
70
70
  ├── PROJECT-CONTEXT.md (domain + <product_vision> / phased scope)
@@ -102,24 +102,24 @@ AI-GUIDE.md (đọc đầu tiên)
102
102
 
103
103
  Full guidelines: `SYSTEM-RULES.md#comment_standards`
104
104
 
105
- ## Khi Nào Cần Đọc Lại
105
+ ## When to Re-read
106
106
 
107
- | Trigger | Cần refresh |
108
- |---------|-------------|
109
- | Bắt đầu session mới | `TRACKER.md`, `HANDOFF.json` |
110
- | Chuyển phase | `ROADMAP.md` section của phase mới |
111
- | Gặp lỗi architecture | `ARCHITECTURE.md`, `SYSTEM-RULES.md` |
112
- | Không business rule | `PROJECT-CONTEXT.md` |
113
- | Cần quyết định mới | `TRACKER.md` → Decision Log |
107
+ | Trigger | Refresh |
108
+ |---------|---------|
109
+ | Starting a new session | `TRACKER.md`, `HANDOFF.json` |
110
+ | Switching phases | `ROADMAP.md` section for the new phase |
111
+ | Encountering architecture issues | `ARCHITECTURE.md`, `SYSTEM-RULES.md` |
112
+ | Unclear business rule | `PROJECT-CONTEXT.md` |
113
+ | Need to make a new decision | `TRACKER.md` → Decision Log |
114
114
 
115
115
  ## Commands Reference
116
116
 
117
- | Command | Dùng khi |
118
- |---------|----------|
119
- | `/vp-status` | Xem progress nhanh |
120
- | `/vp-auto` | Chạy autonomous |
121
- | `/vp-pause` | Dừng, lưu state |
122
- | `/vp-resume` | Tiếp tục từ pause |
123
- | `/vp-evolve` | Thêm features/milestone mới |
117
+ | Command | When to use |
118
+ |---------|-------------|
119
+ | `/vp-status` | Quick progress view |
120
+ | `/vp-auto` | Run autonomous execution |
121
+ | `/vp-pause` | Stop and save state |
122
+ | `/vp-resume` | Continue from pause |
123
+ | `/vp-evolve` | Add features / start new milestone |
124
124
  | `/vp-docs` | Generate documentation |
125
- | `/vp-task` | Quản task thủ công |
125
+ | `/vp-task` | Manage tasks manually |
@@ -1,7 +1,7 @@
1
1
  <purpose>
2
- Audit ViePilot project state documentation để phát hiện drift.
3
- Hoạt động trên bất kỳ project nào đang dùng ViePilot.
4
- Auto-detect nếu đang chạy trong viepilot framework repo để thêm framework-specific checks.
2
+ Audit ViePilot project state and documentation to detect drift.
3
+ Works on any project using ViePilot.
4
+ Auto-detects if running inside the viepilot framework repo to enable framework-specific checks.
5
5
  </purpose>
6
6
 
7
7
  ## ViePilot Skill Scope Policy (BUG-004)
@@ -1,6 +1,6 @@
1
1
  <purpose>
2
- Autonomous execution của project phases. Cho mỗi phase: analyze → execute tasks → verify → iterate.
3
- Pauses at control points cho user decisions.
2
+ Autonomous execution of project phases. For each phase: analyze → execute tasks → verify → iterate.
3
+ Pauses at control points for user decisions.
4
4
  </purpose>
5
5
 
6
6
  ## ViePilot Skill Scope Policy (BUG-004)
@@ -11,7 +11,7 @@ Pauses at control points cho user decisions.
11
11
 
12
12
  ## Implementation entry (cross-skill)
13
13
 
14
- - **`/vp-auto`** + workflow này **lane mặc định** để **implement** work đã **phase/task plan** ( doc-first **BUG-001**). **`/vp-request`** **`/vp-evolve`** **không** thay thế bước này trừ user explicit overridexem **Implementation routing guard** trong `workflows/request.md` `workflows/evolve.md`.
14
+ - **`/vp-auto`** + this workflow is the **default lane** for **implementing** work that already has a **phase/task plan** (and doc-first **BUG-001**). **`/vp-request`** and **`/vp-evolve`** do **not** replace this step unless the user explicitly overridessee **Implementation routing guard** in `workflows/request.md` and `workflows/evolve.md`.
15
15
 
16
16
 
17
17
  <process>
@@ -20,8 +20,8 @@ Pauses at control points cho user decisions.
20
20
  ## 1. Initialize
21
21
 
22
22
  Parse `{{VP_ARGS}}` for flags:
23
- - `--from N` : Start từ phase N
24
- - `--phase N` : Chỉ chạy phase N
23
+ - `--from N` : Start from phase N
24
+ - `--phase N` : Run only phase N
25
25
  - `--fast` : Skip optional verifications
26
26
  - `--dry-run` : Plan only
27
27
 
@@ -32,6 +32,10 @@ cat .viepilot/TRACKER.md
32
32
  cat .viepilot/ROADMAP.md
33
33
  ```
34
34
 
35
+ ### load_language_config
36
+ Read `~/.viepilot/config.json` → `COMMUNICATION_LANG` (default: `en`).
37
+ Use `COMMUNICATION_LANG` for all banners, control-point messages, and user-facing output in this session.
38
+
35
39
  Display startup banner:
36
40
  ```
37
41
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -101,6 +105,54 @@ read:
101
105
  - context_required files from task file
102
106
  ```
103
107
 
108
+ #### ⛔ Preflight: Task Paths Validation (BUG-009)
109
+
110
+ **Before any implementation**, read the `## Paths` block of the task file and validate each listed path:
111
+
112
+ ```
113
+ FOR EACH path in ## Paths:
114
+ IF path starts with "~/" OR starts with "/" (absolute):
115
+ → STOP. Do NOT execute this task.
116
+ → Output:
117
+
118
+ ⛔ TASK PATH ERROR (BUG-009)
119
+ Task {phase}.{task} contains an absolute or external path:
120
+ "{offending_path}"
121
+
122
+ Expected: a repo-relative path (e.g., workflows/foo.md, skills/vp-bar/SKILL.md)
123
+
124
+ Fix the task file before continuing:
125
+ .viepilot/phases/{phase-dir}/tasks/{phase}.{task}.md
126
+
127
+ Replace: {offending_path}
128
+ With the repo-relative equivalent (e.g., without ~/.claude/viepilot/ prefix).
129
+
130
+ ELSE:
131
+ → Pass. Continue with task execution.
132
+ ```
133
+
134
+ This check fires on `~/`, `~\`, and any path starting with `/`.
135
+ It does NOT fire on paths inside code block content within the task (only the `## Paths` header block is validated).
136
+
137
+ #### ⛔ PATH RESOLUTION RULE (BUG-012)
138
+
139
+ **All file reads and edits during task execution MUST be resolved from `{cwd}`** — the repository root where `package.json` lives (e.g. `/Users/.../my-project/`).
140
+
141
+ ```
142
+ WHEN executing a task with:
143
+ ## Paths
144
+ workflows/brainstorm.md
145
+
146
+ → Read and edit: {cwd}/workflows/brainstorm.md
147
+ → NEVER: ~/.claude/viepilot/workflows/brainstorm.md
148
+ → NEVER: ~/.cursor/viepilot/workflows/brainstorm.md
149
+ → NEVER: any path outside {cwd}
150
+ ```
151
+
152
+ **Rule**: If a file exists at both `{cwd}/workflows/foo.md` (codebase) and `~/.claude/viepilot/workflows/foo.md` (production install), **ALWAYS use the `{cwd}` copy**.
153
+
154
+ The install directory (`~/.claude/`, `~/.cursor/`) is a **deployment artifact** — it is populated by `dev-install.sh`. Editing it directly bypasses version control and will be silently overwritten on the next install.
155
+
104
156
  ### ViePilot Skill Scope Policy (BUG-004 baseline)
105
157
  - **Default mode**: only reference/route skills in the ViePilot namespace (`vp-*`).
106
158
  - **External skills** (`non vp-*`) are out of scope by default and must not be suggested implicitly.
@@ -181,6 +233,16 @@ Ensure `PHASE-STATE.md` already shows current task `in_progress` (set during the
181
233
  git commit -m "{type}({scope}): {description}"
182
234
  git push
183
235
  ```
236
+
237
+ ⛔ **GITIGNORE-AWARE STAGING RULE (BUG-013)**: Before staging any file, verify it is
238
+ not gitignored. NEVER stage or commit gitignored files — they are internal state, not
239
+ shipping artifacts.
240
+ ```bash
241
+ # Check before staging:
242
+ git check-ignore -q {file} && echo "IGNORED — skip" || git add {file}
243
+ ```
244
+ `.viepilot/` is ALWAYS gitignored in ViePilot repos. **Never run `git add .viepilot/`.**
245
+
184
246
  8. Log notes in task file after each sub-task
185
247
 
186
248
  #### Verify Task
@@ -205,6 +267,9 @@ Before marking a task PASS, require durable git persistence:
205
267
  ```bash
206
268
  # Must have no unstaged/staged residue for this task
207
269
  git status --porcelain
270
+ # NOTE (BUG-013): lines starting with "??" are UNTRACKED files — NOT a dirty state.
271
+ # Porcelain is CLEAN when output is empty OR contains only "??" lines.
272
+ # Gitignored files (e.g. .viepilot/) must never be staged, so they appear as ?? here.
208
273
 
209
274
  # Must track an upstream branch
210
275
  git rev-parse --abbrev-ref --symbolic-full-name @{u}