viepilot 1.9.11 → 2.1.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 +175 -2
- package/README.md +3 -3
- package/bin/viepilot.cjs +7 -5
- package/bin/vp-tools.cjs +193 -0
- package/dev-install.sh +34 -13
- package/docs/user/features/architect-design-mode.md +170 -0
- package/docs/user/features/hooks.md +93 -0
- package/docs/user/features/ui-direction.md +79 -3
- package/lib/adapters/claude-code.cjs +42 -0
- package/lib/adapters/cursor.cjs +31 -0
- package/lib/adapters/index.cjs +26 -0
- package/lib/hooks/brainstorm-staleness.cjs +231 -0
- package/lib/viepilot-config.cjs +103 -0
- package/lib/viepilot-install.cjs +128 -153
- package/package.json +1 -1
- package/skills/vp-audit/SKILL.md +21 -21
- package/skills/vp-auto/SKILL.md +21 -7
- package/skills/vp-brainstorm/SKILL.md +46 -35
- package/skills/vp-crystallize/SKILL.md +37 -25
- package/skills/vp-debug/SKILL.md +2 -2
- package/skills/vp-docs/SKILL.md +7 -7
- package/skills/vp-evolve/SKILL.md +25 -12
- package/skills/vp-info/SKILL.md +23 -23
- package/skills/vp-pause/SKILL.md +5 -5
- package/skills/vp-request/SKILL.md +12 -12
- package/skills/vp-resume/SKILL.md +4 -4
- package/skills/vp-rollback/SKILL.md +3 -3
- package/skills/vp-status/SKILL.md +4 -4
- package/skills/vp-task/SKILL.md +3 -3
- package/skills/vp-ui-components/SKILL.md +12 -12
- package/skills/vp-update/SKILL.md +17 -17
- package/templates/architect/apis.html +159 -0
- package/templates/architect/architect-actions.js +217 -0
- package/templates/architect/architecture.html +160 -0
- package/templates/architect/data-flow.html +109 -0
- package/templates/architect/decisions.html +96 -0
- package/templates/architect/deployment.html +184 -0
- package/templates/architect/erd.html +154 -0
- package/templates/architect/feature-map.html +113 -0
- package/templates/architect/index.html +108 -0
- package/templates/architect/sequence-diagram.html +133 -0
- package/templates/architect/style.css +365 -0
- package/templates/architect/tech-notes.html +89 -0
- package/templates/architect/tech-stack.html +114 -0
- package/templates/architect/user-use-cases.html +154 -0
- package/templates/project/AI-GUIDE.md +53 -54
- package/templates/project/PROJECT-CONTEXT.md +7 -11
- package/templates/project/README.md +43 -0
- package/templates/project/ROADMAP.md +1 -27
- package/workflows/audit.md +3 -3
- package/workflows/autonomous.md +38 -5
- package/workflows/brainstorm.md +575 -191
- package/workflows/crystallize.md +168 -58
- package/workflows/debug.md +9 -9
- package/workflows/documentation.md +5 -5
- package/workflows/evolve.md +44 -12
- package/workflows/pause-work.md +2 -2
- package/workflows/request.md +8 -8
- package/workflows/resume-work.md +1 -1
- package/workflows/rollback.md +1 -1
|
@@ -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)_
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# ViePilot Hooks
|
|
2
|
+
|
|
3
|
+
ViePilot integrates with Claude Code's hook system to automate actions after each AI response. Hooks are shell commands that fire at specific Claude Code events — no manual typing required.
|
|
4
|
+
|
|
5
|
+
## Brainstorm Staleness Hook
|
|
6
|
+
|
|
7
|
+
**Event**: `Stop` (fires after each Claude response)
|
|
8
|
+
**Script**: `~/.viepilot/hooks/brainstorm-staleness.cjs`
|
|
9
|
+
**Config**: `~/.claude/settings.json`
|
|
10
|
+
|
|
11
|
+
### What it does
|
|
12
|
+
|
|
13
|
+
After each exchange in a `vp-brainstorm` session, the hook automatically:
|
|
14
|
+
|
|
15
|
+
1. Finds the most recently modified brainstorm session file (`notes.md` or `session-*.md`)
|
|
16
|
+
2. Scans session content for keywords that match architect HTML pages
|
|
17
|
+
3. Marks relevant architect items with `data-arch-stale="true"` — rendered as an amber "⚠ gap" badge in the browser
|
|
18
|
+
4. Exits cleanly — if it fails or finds nothing, your session continues normally
|
|
19
|
+
|
|
20
|
+
This is **flag-only** (Option A) — the hook does not rewrite architect HTML content, only marks items for review. Use `/sync-arch` to perform a full content sync.
|
|
21
|
+
|
|
22
|
+
### Install
|
|
23
|
+
|
|
24
|
+
Run once per machine:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node bin/vp-tools.cjs hooks install
|
|
28
|
+
# or if installed globally:
|
|
29
|
+
vp-tools hooks install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This writes the hook entry into `~/.claude/settings.json`. Running it again is safe (idempotent).
|
|
33
|
+
|
|
34
|
+
To verify the install:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cat ~/.claude/settings.json | grep brainstorm-staleness
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Preview (scaffold)
|
|
41
|
+
|
|
42
|
+
To see what will be written without installing:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
node bin/vp-tools.cjs hooks scaffold
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Cursor users
|
|
49
|
+
|
|
50
|
+
Cursor does not support `settings.json` hook events. Use `/sync-arch` manually within the brainstorm session to trigger architect delta sync (ENH-034).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Adapter support
|
|
55
|
+
|
|
56
|
+
Hook behavior is adapter-dependent:
|
|
57
|
+
|
|
58
|
+
| Adapter | Config file | Programmatic events |
|
|
59
|
+
|---------|-------------|---------------------|
|
|
60
|
+
| `claude-code` | `~/.claude/settings.json` | Stop, PreToolUse, PostToolUse, UserPromptSubmit, … |
|
|
61
|
+
| `cursor` | `.cursorrules` / MDC | None (no programmatic hook events) |
|
|
62
|
+
|
|
63
|
+
Check your adapter's supported events:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
node bin/vp-tools.cjs hooks scaffold --adapter claude-code
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Adding custom hooks
|
|
72
|
+
|
|
73
|
+
1. Create your hook script in `~/.viepilot/hooks/` (or anywhere accessible)
|
|
74
|
+
2. Get the config format: `vp-tools hooks scaffold`
|
|
75
|
+
3. Add your command to the relevant event array in `~/.claude/settings.json`
|
|
76
|
+
|
|
77
|
+
Claude Code passes a JSON payload on stdin with `session_id`, `cwd`, `transcript_path`, and event-specific data. Your hook script should read from stdin and always exit 0.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Troubleshooting
|
|
82
|
+
|
|
83
|
+
**Hook not firing**
|
|
84
|
+
- Confirm `~/.claude/settings.json` has a `Stop` entry: `vp-tools hooks install` (idempotent)
|
|
85
|
+
- Restart your Claude Code session after modifying `settings.json`
|
|
86
|
+
|
|
87
|
+
**No stale badges appearing**
|
|
88
|
+
- The hook only marks stale if session content matches architect keyword triggers
|
|
89
|
+
- Check that the brainstorm session notes file exists in `.viepilot/ui-direction/` or `docs/brainstorm/`
|
|
90
|
+
- The architect HTML files must exist at `templates/architect/` (repo) or `~/.claude/viepilot/templates/architect/` (installed)
|
|
91
|
+
|
|
92
|
+
**Hook error messages**
|
|
93
|
+
Hook errors appear on stderr (not in Claude's response). Check terminal output or Claude Code logs.
|
|
@@ -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
|
|
89
|
-
2.
|
|
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 là 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`
|
|
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)_
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
id: 'claude-code',
|
|
8
|
+
name: 'Claude Code',
|
|
9
|
+
// Paths (home-relative; resolved at install time)
|
|
10
|
+
skillsDir: (home) => path.join(home, '.claude', 'skills'),
|
|
11
|
+
viepilotDir: (home) => path.join(home, '.claude', 'viepilot'),
|
|
12
|
+
// execution_context base for skill .md files
|
|
13
|
+
executionContextBase: '.claude/viepilot',
|
|
14
|
+
// Path rewrite rule: when mirroring skills, rewrite from → to in *.md files
|
|
15
|
+
pathRewrite: { from: '.cursor/viepilot', to: '.claude/viepilot' },
|
|
16
|
+
// Hooks configuration (Claude Code settings.json)
|
|
17
|
+
hooks: {
|
|
18
|
+
configFile: (home) => path.join(home, '.claude', 'settings.json'),
|
|
19
|
+
schema: 'claude-code',
|
|
20
|
+
supportedEvents: [
|
|
21
|
+
'SessionStart', 'SessionEnd', 'Stop', 'StopFailure',
|
|
22
|
+
'UserPromptSubmit', 'PreToolUse', 'PostToolUse', 'PostToolUseFailure',
|
|
23
|
+
'FileChanged', 'SubagentStart', 'SubagentStop',
|
|
24
|
+
'TaskCreated', 'TaskCompleted', 'PreCompact', 'PostCompact'
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
// Files/dirs to install into viepilotDir
|
|
28
|
+
installSubdirs: [
|
|
29
|
+
'workflows',
|
|
30
|
+
path.join('templates', 'project'),
|
|
31
|
+
path.join('templates', 'phase'),
|
|
32
|
+
path.join('templates', 'architect'),
|
|
33
|
+
'bin',
|
|
34
|
+
'lib',
|
|
35
|
+
'ui-components'
|
|
36
|
+
],
|
|
37
|
+
// Detection: is this platform available on the current machine?
|
|
38
|
+
isAvailable: (home) => {
|
|
39
|
+
const h = home || os.homedir();
|
|
40
|
+
return fs.existsSync(path.join(h, '.claude'));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
id: 'cursor', // maps to cursor-agent and cursor-ide (same paths)
|
|
8
|
+
name: 'Cursor',
|
|
9
|
+
skillsDir: (home) => path.join(home, '.cursor', 'skills'),
|
|
10
|
+
viepilotDir: (home) => path.join(home, '.cursor', 'viepilot'),
|
|
11
|
+
executionContextBase: '.cursor/viepilot',
|
|
12
|
+
pathRewrite: null, // no rewrite needed (source is cursor-first)
|
|
13
|
+
hooks: {
|
|
14
|
+
configFile: null, // Cursor uses .cursorrules/MDC, not settings.json hooks
|
|
15
|
+
schema: 'cursor',
|
|
16
|
+
supportedEvents: [] // no programmatic hook events
|
|
17
|
+
},
|
|
18
|
+
installSubdirs: [
|
|
19
|
+
'workflows',
|
|
20
|
+
path.join('templates', 'project'),
|
|
21
|
+
path.join('templates', 'phase'),
|
|
22
|
+
path.join('templates', 'architect'),
|
|
23
|
+
'bin',
|
|
24
|
+
'lib',
|
|
25
|
+
'ui-components'
|
|
26
|
+
],
|
|
27
|
+
isAvailable: (home) => {
|
|
28
|
+
const h = home || os.homedir();
|
|
29
|
+
return fs.existsSync(path.join(h, '.cursor'));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const adapters = {
|
|
3
|
+
'claude-code': require('./claude-code.cjs'),
|
|
4
|
+
'cursor': require('./cursor.cjs'),
|
|
5
|
+
'cursor-agent': require('./cursor.cjs'), // alias
|
|
6
|
+
'cursor-ide': require('./cursor.cjs'), // alias
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get adapter by id. Throws if unknown.
|
|
11
|
+
* @param {string} id
|
|
12
|
+
*/
|
|
13
|
+
function getAdapter(id) {
|
|
14
|
+
const a = adapters[id];
|
|
15
|
+
if (!a) throw new Error(`Unknown adapter: "${id}". Known: ${Object.keys(adapters).join(', ')}`);
|
|
16
|
+
return a;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List unique adapters (deduplicated — aliases share the same object).
|
|
21
|
+
*/
|
|
22
|
+
function listAdapters() {
|
|
23
|
+
return [...new Set(Object.values(adapters))];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { getAdapter, listAdapters, adapters };
|