viepilot 1.8.1 → 1.9.1

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 CHANGED
@@ -9,11 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Planned
11
11
 
12
- - None.
12
+ - None.
13
13
 
14
14
  ### Added
15
15
 
16
- - None yet.
16
+ - None yet.
17
+
18
+ ## [1.9.1] - 2026-04-02
19
+
20
+ ### Added
21
+
22
+ - **M1.28 / Phase 32 (FEAT-010)** — UI Direction **UX walkthrough**: slash **`/research-ui`** and **`/research ui`** in `workflows/brainstorm.md` (3 phases: end-user simulation → designer + web research → update `notes.md` **`## UX walkthrough log`** and HTML/CSS); `skills/vp-brainstorm` **0.6.0**; `docs/user/features/ui-direction.md`, `docs/skills-reference.md`; `tests/unit/vp-fe010-ui-walkthrough-contracts.test.js`.
23
+
24
+ ## [1.9.0] - 2026-04-01
25
+
26
+ ### Added
27
+
28
+ - **M1.27 / Phase 31 (FEAT-009) completed** — reusable global org context: `~/.viepilot/profiles/<slug>.md` + `~/.viepilot/profile-map.md`; project binding `.viepilot/META.md`; brainstorm **Project meta intake** after scope lock; Node installer seeds dirs/map; **crystallize** + **vp-docs** consume active profile for pre-fill and attribution.
29
+ - `docs/dev/global-profiles.md` — normative contract (paths, schema, resolution).
30
+ - `templates/project/VIEPILOT-META.md` — template for `.viepilot/META.md`.
31
+ - `workflows/brainstorm.md` + `skills/vp-brainstorm/SKILL.md` (0.5.0) — meta intake step 5 + session sections.
32
+ - `lib/viepilot-install.cjs` — `mkdir` `~/.viepilot/profiles` + `write_file_if_missing` for `profile-map.md`; plan paths `viepilotProfilesDir` / `viepilotProfileMapPath`.
33
+ - `workflows/crystallize.md` + `skills/vp-crystallize/SKILL.md` (0.5.0) — Step 0 profile load; ARCHITECTURE / PROJECT-CONTEXT / AI-GUIDE merge rules.
34
+ - `workflows/documentation.md` + `skills/vp-docs/SKILL.md` (0.2.0) — §0A profile resolution for generated docs.
35
+ - `docs/user/quick-start.md`, `docs/user/features/brainstorm.md`, `docs/skills-reference.md` — user-facing FEAT-009 notes.
36
+ - `tests/unit/vp-fe009-global-profiles-contracts.test.js` — regression tests for workflow/skill/installer/template contracts.
17
37
 
18
38
  ## [1.8.1] - 2026-04-01
19
39
 
@@ -290,7 +310,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
290
310
 
291
311
  ---
292
312
 
293
- [Unreleased]: https://github.com/0-CODE/viepilot/compare/v1.8.1...HEAD
313
+ [Unreleased]: https://github.com/0-CODE/viepilot/compare/v1.9.1...HEAD
314
+ [1.9.1]: https://github.com/0-CODE/viepilot/compare/v1.9.0...v1.9.1
315
+ [1.9.0]: https://github.com/0-CODE/viepilot/compare/v1.8.1...v1.9.0
294
316
  [1.8.1]: https://github.com/0-CODE/viepilot/compare/v1.8.0...v1.8.1
295
317
  [1.8.0]: https://github.com/0-CODE/viepilot/compare/v1.7.0...v1.8.0
296
318
  [0.10.0]: https://github.com/0-CODE/viepilot/compare/v0.9.0...v0.10.0
package/README.md CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  **Autonomous Vibe Coding Framework / Bộ khung phát triển tự động có kiểm soát**
4
4
 
5
- [![Version](https://img.shields.io/badge/version-1.6.1-blue.svg)](CHANGELOG.md)
5
+ [![Version](https://img.shields.io/badge/version-1.9.1-blue.svg)](CHANGELOG.md)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
7
7
  [![Skills](https://img.shields.io/badge/skills-16-purple.svg)](#skills-reference)
8
8
  [![Workflows](https://img.shields.io/badge/workflows-12-orange.svg)](#workflows)
9
- [![Templates](https://img.shields.io/badge/templates-16-cyan.svg)](#templates)
10
- [![Tests](https://img.shields.io/badge/tests-267%20passing-brightgreen.svg)](tests/)
9
+ [![Templates](https://img.shields.io/badge/templates-17-cyan.svg)](#templates)
10
+ [![Tests](https://img.shields.io/badge/tests-294%20passing-brightgreen.svg)](tests/)
11
11
  [![GitHub](https://img.shields.io/github/stars/0-CODE/viepilot?style=social)](https://github.com/0-CODE/viepilot)
12
12
 
13
- **Versioning:** Shield **1.6.1** is the **ViePilot framework SemVer** tracked in `.viepilot/TRACKER.md` and `CHANGELOG.md`. The npm `package.json` field `version` (**1.6.1**) is the Node package identifier for this repo and may differ; use the framework version for milestone releases and docs.
13
+ **Versioning:** Shield **1.9.1** is the **ViePilot framework SemVer** tracked in `.viepilot/TRACKER.md` and `CHANGELOG.md`. The npm `package.json` field `version` (**1.9.1**) is the Node package identifier for this repo; use the framework version for milestone releases and docs.
14
14
 
15
15
  ViePilot là bộ skill framework cho phép AI assistant (Claude, GPT, etc.) phát triển dự án một cách **tự động**, **có kiểm soát**, và **có thể khôi phục**. Thiết kế theo các tiêu chuẩn chuyên nghiệp: Semantic Versioning, Conventional Commits, Keep a Changelog.
16
16
 
@@ -28,13 +28,13 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
28
28
 
29
29
  | Chỉ số / Metric | Giá trị / Value |
30
30
  |-----------------|-----------------|
31
- | Total LOC | **~25,050+** (`.md`, `.js`, `.cjs`, `.yml`, `.json`, `.sh`; không gồm `node_modules`) |
31
+ | Total LOC | **~27,113+** (`.md`, `.js`, `.cjs`, `.yml`, `.json`, `.sh`; không gồm `node_modules`) |
32
32
  | Skills | **16** |
33
33
  | Workflows | **12** |
34
- | Templates | **16** (Project: 11, Phase: 5) |
34
+ | Templates | **17** (Project: 12, Phase: 5) |
35
35
  | CLI Commands | **18** (`vp-tools` 17 subcommands + `viepilot` installer) |
36
- | Tests | **267** (9 suites: unit + integration + AI compat + README metrics + UI direction verify + ENH workflow contracts + viepilot-info + viepilot-update) |
37
- | ViePilot phases (repo) | **15** hoàn thành (xem `.viepilot/TRACKER.md`) |
36
+ | Tests | **294** (13 suites: unit + integration + AI compat + README metrics + UI direction + ENH contracts + scope policy + FEAT-009 + FEAT-010 + viepilot-info/update/install) |
37
+ | ViePilot phases (local `.viepilot`) | **32** phase cycles — **M1.28** (**v1.9.1** FEAT-010); **M1.27** (**v1.9.0** FEAT-009); xem `CHANGELOG.md` |
38
38
  | Standards | 5 (SemVer, Commits, Changelog, Comments, Contributors) |
39
39
 
40
40
  > Metric `Total LOC` có thể được refresh tự động bằng `npm run readme:sync` (dùng `cloc`; nếu thiếu `cloc` script sẽ fallback an toàn).
@@ -45,27 +45,27 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
45
45
  |------------------------|------------------|---------------------|
46
46
  | Skill Definitions | **16** | SKILL.md files với trigger, process, success criteria |
47
47
  | Workflow Files | **12** | Step-by-step execution guides |
48
- | Project Templates | 11 | AI-GUIDE, ARCHITECTURE, README, SYSTEM-RULES, etc. |
48
+ | Project Templates | 12 | AI-GUIDE, ARCHITECTURE, VIEPILOT-META, README, SYSTEM-RULES, etc. |
49
49
  | Phase Templates | 5 | SPEC, PHASE-STATE, TASK, VERIFICATION, SUMMARY |
50
50
  | CLI Tools | 2 | vp-tools.cjs (**17** subcommands) + viepilot.cjs (guided installer) |
51
- | Test Files | 6 | Jest unit + integration + AI compatibility + README metrics + ENH backlog + viepilot-info/update |
51
+ | Test Files | 13 | Jest: 12 unit + 1 integration (contracts, installer, info/update, FEAT-009, FEAT-010, scope policy, …) |
52
52
 
53
53
  ---
54
54
 
55
55
  ## Độ hoàn thiện / Completion Status
56
56
 
57
57
  ```
58
- Tổng thể / Overall: ████████████████████ ~98% ✅ Latest **v1.6.1** (ENH-015 symlink skills opt-in); M1.23 FEAT-008 (v1.6.0); M1.22 (v1.5.1)
58
+ Tổng thể / Overall: ████████████████████ ~98% ✅ Latest **v1.9.1** (M1.28 FEAT-010 `/research-ui`); prior **v1.9.0** FEAT-009; **v1.8.1** BUG-004
59
59
  ```
60
60
 
61
61
  | Lĩnh vực / Area | Trạng thái | Chi tiết |
62
62
  |-----------------|------------|----------|
63
63
  | Core Skills (16) | ✅ Hoàn thiện | brainstorm, crystallize, auto, pause, resume, status, info, request, evolve, docs, update, task, debug, rollback, audit, ui-components |
64
64
  | Workflows (12) | ✅ Hoàn thiện | Full step-by-step guides với success criteria |
65
- | Project Templates (11) | ✅ Hoàn thiện | Placeholders cho customization |
65
+ | Project Templates (12) | ✅ Hoàn thiện | Placeholders cho customization (+ `VIEPILOT-META` FEAT-009) |
66
66
  | Phase Templates (5) | ✅ Hoàn thiện | Task tracking, verification, summary |
67
67
  | CLI Tools (18) | ✅ Hoàn thiện | vp-tools 17 subcommands + viepilot installer; bundle `info` / `update` |
68
- | Tests (267) | ✅ Hoàn thiện | Unit, integration, AI provider compatibility, workflow contracts, viepilot-info, viepilot-update |
68
+ | Tests (294) | ✅ Hoàn thiện | Unit, integration, AI compat, workflow contracts, installer, scope policy, FEAT-009/010, info/update |
69
69
  | CI/CD | ✅ Hoàn thiện | GitHub Actions, Node 18/20/22 matrix, coverage >80% |
70
70
  | Documentation | ✅ Hoàn thiện | dev/, user/, api/, videos/, examples/, troubleshooting |
71
71
  | Standards | ✅ Hoàn thiện | SemVer, Conventional Commits, Keep a Changelog |
@@ -150,11 +150,12 @@ Tổng thể / Overall: ██████████████████
150
150
 
151
151
  ## Templates
152
152
 
153
- ### Project Templates (11)
153
+ ### Project Templates (12)
154
154
 
155
155
  | Template | Mô tả / Description |
156
156
  |----------|---------------------|
157
157
  | `AI-GUIDE.md` | Navigation cho AI - quick lookup, context loading strategy |
158
+ | `VIEPILOT-META.md` | Binding profile active: `viepilot_profile_id` / path (FEAT-009) |
158
159
  | `PROJECT-META.md` | Metadata: org, package, developer, headers |
159
160
  | `ARCHITECTURE.md` | System design, services, data flow, tech decisions |
160
161
  | `PROJECT-CONTEXT.md` | Domain knowledge, business rules, constraints |
@@ -365,8 +366,8 @@ viepilot/
365
366
  │ ├── rollback.md # Rollback workflow
366
367
  │ └── audit.md # Audit workflow
367
368
 
368
- ├── templates/ # 16 Templates
369
- │ ├── project/ # 11 Project-level templates
369
+ ├── templates/ # 17 Templates
370
+ │ ├── project/ # 12 Project-level templates
370
371
  │ │ ├── AI-GUIDE.md
371
372
  │ │ ├── PROJECT-META.md
372
373
  │ │ ├── ARCHITECTURE.md
package/docs/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
  | Feature | Document |
30
30
  |---------|----------|
31
31
  | Autonomous Mode | [autonomous-mode.md](user/features/autonomous-mode.md) (flags, `--fast`, lượt chat) |
32
- | Brainstorm & product horizon | [brainstorm.md](user/features/brainstorm.md) (MVP / Post-MVP tags, crystallize handoff) |
32
+ | Brainstorm & product horizon | [brainstorm.md](user/features/brainstorm.md) (MVP / Post-MVP, **meta intake** + global profiles) |
33
33
  | Product horizon end-to-end | [product-horizon.md](user/features/product-horizon.md) (brainstorm → ROADMAP / PROJECT-CONTEXT, AI load order) |
34
34
  | UI Direction Mode | [ui-direction.md](user/features/ui-direction.md) |
35
35
  | Checkpoint Recovery | [checkpoint-recovery.md](user/features/checkpoint-recovery.md) |
@@ -57,6 +57,7 @@
57
57
  | [Getting Started (dev entry)](dev/getting-started.md) | Short link into dev guide |
58
58
  | [CLI Reference](dev/cli-reference.md) | All `vp-tools` subcommands (incl. `info`, `update`) with examples |
59
59
  | [Architecture](dev/architecture.md) | System layers, data flow, design decisions |
60
+ | [Global profiles (FEAT-009)](dev/global-profiles.md) | `~/.viepilot/profiles`, `profile-map.md`, `.viepilot/META.md` binding |
60
61
  | [UI Components Library](dev/ui-components-library.md) | Curation taxonomy, storage contract, reuse flow |
61
62
  | [Contributing](dev/contributing.md) | How to add skills, workflows, CLI commands |
62
63
  | [Testing](dev/testing.md) | Test structure, running tests, writing new tests |
@@ -113,6 +114,8 @@
113
114
  | `/vp-pause` | "pause", "dừng" | Save state and pause |
114
115
  | `/vp-resume` | "resume", "tiếp tục" | Restore and continue |
115
116
  | `/vp-status` | "status", "tiến độ" | Progress dashboard |
117
+ | `/vp-info` | "version", "phiên bản" | Bundle version, npm latest, inventory |
118
+ | `/vp-update` | "upgrade viepilot", "npm" | Upgrade ViePilot via npm |
116
119
  | `/vp-request` | "request", "feature", "bug" | Add feature/bug |
117
120
  | `/vp-ui-components` | "ui components", "21st.dev" | Curate and reuse UI component library |
118
121
  | `/vp-evolve` | "evolve", "milestone mới" | New milestone |
@@ -124,4 +127,4 @@
124
127
 
125
128
  ---
126
129
 
127
- *Last updated: 2026-03-31 — ViePilot framework v1.2.0 (see `.viepilot/TRACKER.md`); project-scoped checkpoint tags delivered.*
130
+ *Last updated: 2026-04-01 — ViePilot framework **v1.9.0** (M1.27 FEAT-009: global profiles + docs workflow §0A); see `CHANGELOG.md` and `docs/dev/global-profiles.md`.*
@@ -0,0 +1,115 @@
1
+ # Global profiles & project meta binding (FEAT-009)
2
+
3
+ Normative contract for machine-level **reusable org/context** (`~/.viepilot/`) and **per-repo binding** (`.viepilot/META.md`). Implementations (installer, brainstorm intake, crystallize, vp-docs) MUST follow this doc unless a phase explicitly supersedes it.
4
+
5
+ ## Layout (machine-level)
6
+
7
+ Same home as stack cache and UI components:
8
+
9
+ | Path | Purpose |
10
+ |------|---------|
11
+ | `~/.viepilot/profiles/` | One markdown file per reusable profile |
12
+ | `~/.viepilot/profiles/<slug>.md` | Profile body + YAML frontmatter |
13
+ | `~/.viepilot/profile-map.md` | Registry for lookup / disambiguation (human-editable) |
14
+
15
+ `npx viepilot install` (Node installer) creates `profiles/` and seeds `profile-map.md` when missing — see `lib/viepilot-install.cjs`. Manual equivalent:
16
+
17
+ ```bash
18
+ mkdir -p "$HOME/.viepilot/profiles"
19
+ ```
20
+
21
+ ## Profile slug & filename
22
+
23
+ - **Slug**: `kebab-case`, characters `[a-z0-9-]` only, length 1–64.
24
+ - **File**: `~/.viepilot/profiles/<slug>.md` where `<slug>` matches basename without `.md`.
25
+ - **profile_id**: MUST equal `<slug>` (stable id for maps and binding). Future UUID optional in later revisions; v1 uses slug only.
26
+
27
+ ## Profile file schema (`*.md`)
28
+
29
+ YAML frontmatter (required keys):
30
+
31
+ | Key | Type | Description |
32
+ |-----|------|-------------|
33
+ | `profile_id` | string | Same as slug |
34
+ | `display_name` | string | Human label |
35
+ | `org_tag` | string | Short org / client tag (e.g. `acme`, `personal`) |
36
+ | `tags` | string[] | Freeform tags for filtering |
37
+ | `last_updated` | string | ISO 8601 date `YYYY-MM-DD` |
38
+
39
+ Optional frontmatter:
40
+
41
+ | Key | Type | Description |
42
+ |-----|------|-------------|
43
+ | `locale` | string | BCP 47 or free text (e.g. `vi-VN`) |
44
+ | `website` | string | Public URL only |
45
+
46
+ Recommended markdown body sections (headings):
47
+
48
+ - `## Organization`
49
+ - `## Branding & voice`
50
+ - `## Audience`
51
+ - `## Legal & attribution` (public-facing lines only)
52
+ - `## Contact (public)`
53
+ - `## Notes`
54
+
55
+ ### Forbidden content
56
+
57
+ Do **not** store secrets in profiles: API keys, passwords, tokens, private PEMs, session cookies, or any credential used for auth. Use a secrets manager; profiles are **non-sensitive** context only.
58
+
59
+ ## Registry: `~/.viepilot/profile-map.md`
60
+
61
+ Purpose: **quick lookup** without opening every `profiles/*.md`.
62
+
63
+ ### File shape
64
+
65
+ 1. Title + short intro (1–3 lines).
66
+ 2. One markdown **table** with fixed columns (header row literal):
67
+
68
+ | profile_id | display_name | org_tag | profile_path | tags | last_used |
69
+
70
+ - **profile_path**: Prefer absolute path `~/.viepilot/profiles/<slug>.md` or `$HOME/.viepilot/profiles/<slug>.md` for clarity.
71
+ - **tags**: Comma-separated in cell.
72
+ - **last_used**: ISO `YYYY-MM-DD` or empty; tooling SHOULD update when user selects profile for a project.
73
+
74
+ ### Rules
75
+
76
+ - **Add** a row when a new profile is created.
77
+ - **Do not** delete rows silently; deprecate with a tag or note if needed.
78
+ - Implementations SHOULD sort or filter by `org_tag` / `tags` when offering disambiguation (multiple companies).
79
+
80
+ ## Project binding (repo-local)
81
+
82
+ ### Source of truth: `.viepilot/META.md`
83
+
84
+ Small file (see template `templates/project/VIEPILOT-META.md`). Minimum YAML frontmatter:
85
+
86
+ | Key | Type | Description |
87
+ |-----|------|-------------|
88
+ | `viepilot_profile_id` | string | Active profile slug / `profile_id` |
89
+
90
+ Optional:
91
+
92
+ | Key | Type | Description |
93
+ |-----|------|-------------|
94
+ | `viepilot_profile_path` | string | Override path to profile file (advanced; default derived from id) |
95
+
96
+ Crystallize / vp-docs / automation **MUST** resolve active profile by:
97
+
98
+ 1. Read `.viepilot/META.md` frontmatter `viepilot_profile_id`.
99
+ 2. If missing → intake or explicit user choice (Phase 31.2+).
100
+ 3. Load `~/.viepilot/profiles/<viepilot_profile_id>.md` unless `viepilot_profile_path` set.
101
+ 4. If file missing → error or re-prompt (implementation-defined in later tasks).
102
+
103
+ ### Optional mirror
104
+
105
+ `HANDOFF.json` MAY duplicate `viepilot_profile_id` for session continuity. If both exist, **META.md wins**; tooling SHOULD keep them in sync when updating binding.
106
+
107
+ ## Relation to `PROJECT-META.md`
108
+
109
+ `templates/project/PROJECT-META.md` is a **large product metadata** template (attribution, headers, etc.). **Do not merge** with ViePilot binding. Keep **VIEPILOT-META.md** (or `.viepilot/META.md`) separate and small.
110
+
111
+ ## References
112
+
113
+ - UI component store pattern: `workflows/ui-components.md` (`~/.viepilot/ui-components/`)
114
+ - Stack cache: `~/.viepilot/stacks/{stack}/`
115
+ - Request: `.viepilot/requests/FEAT-009.md` (local)
@@ -29,11 +29,15 @@ Complete reference for all ViePilot skills.
29
29
  | `/topic {name}` | Chuyển sang topic mới |
30
30
  | `/summary` | Xem tóm tắt hiện tại |
31
31
  | `/save` | Lưu tiến độ |
32
- | `/end` | Kết thúc và lưu |
32
+ | `/end` | Kết thúc và lưu (sau **Project meta intake** nếu thiếu `.viepilot/META.md` / `viepilot_profile_id` — FEAT-009) |
33
33
  | `/questions` | Xem open questions |
34
+ | `/research {topic}` | Research nhanh trong phiên, quay lại topic hiện tại |
35
+ | `/research-ui` | **UI Direction (FEAT-010)**: mô phỏng user → designer + web research → cập nhật HTML/CSS + **`## UX walkthrough log`** trong `notes.md` |
36
+ | `/research ui` | Alias của `/research-ui` |
34
37
 
35
38
  ### Output
36
39
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
40
+ - **Project meta intake (FEAT-009):** khi scope đã chốt và chưa bind profile — Q&A tuần tự; ghi `~/.viepilot/profiles/<slug>.md`, cập nhật `~/.viepilot/profile-map.md`, tạo `.viepilot/META.md` — normative: `docs/dev/global-profiles.md`.
37
41
  - **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`.
38
42
  - 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).
39
43
 
@@ -51,6 +55,9 @@ Complete reference for all ViePilot skills.
51
55
  - `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`.
52
56
  - 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`).
53
57
 
58
+ ### ViePilot global profile (FEAT-009)
59
+ - Step 0: đọc `.viepilot/META.md` → `~/.viepilot/profiles/<slug>.md` (contract: `docs/dev/global-profiles.md`); pre-fill metadata; merge vào **ARCHITECTURE** (`## ViePilot organization context`) và **PROJECT-CONTEXT** (`## ViePilot active profile`).
60
+
54
61
  ### Metadata Collection
55
62
  - Project name, description
56
63
  - Organization name, website
@@ -229,6 +236,9 @@ AI pauses for user input when:
229
236
 
230
237
  **Purpose**: Generate documentation
231
238
 
239
+ ### ViePilot global profile (FEAT-009)
240
+ - Sau resolve git/repo context: nếu có binding `.viepilot/META.md`, dùng profile global cho attribution/tone trong prose (không fail khi thiếu) — `workflows/documentation.md` §0A.
241
+
232
242
  ### Flags
233
243
  | Flag | Description |
234
244
  |------|-------------|
@@ -23,6 +23,15 @@ Ghi một dòng explicit trong `## Product horizon`, ví dụ: **Single-release
23
23
 
24
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
25
 
26
+ ## Project meta intake & global profile (FEAT-009)
27
+
28
+ Sau khi **chốt scope** (`## Product horizon` có nội dung thật hoặc bạn xác nhận đã lock) và **trước** khi kết thúc phiên (`/end` / `Completed`), nếu repo **chưa** có `.viepilot/META.md` với `viepilot_profile_id`, workflow bắt buộc chạy **Project meta intake**: hỏi **tuần tự** (có proposal), ghi `~/.viepilot/profiles/<slug>.md`, cập nhật `~/.viepilot/profile-map.md`, tạo binding **`.viepilot/META.md`**.
29
+
30
+ - Đã có profile bound → có thể bỏ qua intake mặc định (chỉ hỏi đổi profile nếu cần).
31
+ - Waiver hiếm: ghi `## Meta intake waiver` + lý do trong session.
32
+ - Hợp đồng đầy đủ: [Global profiles (dev)](../../dev/global-profiles.md).
33
+ - `npx viepilot install` tạo sẵn thư mục `~/.viepilot/profiles/` và file mẫu `profile-map.md` nếu thiếu.
34
+
26
35
  ## Bước tiếp
27
36
 
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).
37
+ Sau brainstorm: `/vp-crystallize` — horizon trong session được dùng để bổ sung roadmap và project context; **crystallize** đọc `.viepilot/META.md` để pre-fill org/branding từ profile global khi có. Tổng quan end-to-end: [Product horizon](product-horizon.md).
@@ -65,11 +65,31 @@ Mẫu bảng (copy-paste và điền):
65
65
 
66
66
  Nếu **không** có thư mục `pages/`, không cần section `## Pages inventory` (layout legacy).
67
67
 
68
+ ## UX walkthrough — `/research-ui` (FEAT-010)
69
+
70
+ Sau khi có prototype trong `.viepilot/ui-direction/{session-id}/`, bạn có thể **đánh giá và nâng cấp** bằng lệnh trong phiên brainstorm UI:
71
+
72
+ | Lệnh | Ý nghĩa |
73
+ |------|---------|
74
+ | `/research-ui` | Pipeline đầy đủ (xem dưới) |
75
+ | `/research ui` | Cùng nội dung (alias; có khoảng trắng sau `research`) |
76
+
77
+ **Pipeline (3 phase)** — normative: `workflows/brainstorm.md` (mục *UI Direction — UX walkthrough & upgrade*):
78
+
79
+ 1. **End-user simulation** — AI đóng vai người dùng cuối: đi qua 3–8 scenario trên UI hiện tại, ghi pain (mơ hồ, thiếu feedback, quá nhiều bước, …) và mức độ.
80
+ 2. **Designer + research** — Đổi vai UX/UI designer: ưu tiên P0/P1/P2, **web search** khi cần benchmark/pattern, đề xuất cải tiến theo từng page/slug.
81
+ 3. **Cập nhật artifact** — Sửa HTML/CSS, và trong **`notes.md`** thêm section **`## UX walkthrough log`** (entry: ngày, scenario, pain, link research, tóm tắt thay đổi). Multi-page: vẫn giữ **hub** + **`## Pages inventory`** khớp `pages/*`.
82
+
83
+ Gợi ý: kèm tên sản phẩm hoặc ngữ cảnh trong cùng tin nhắn (vd. “Trips — ưu tiên luồng đặt chuyến”).
84
+
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
+
68
87
  ## Flow khuyến nghị
69
88
  1. `/vp-brainstorm --ui`
70
89
  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`, **từng** `pages/*.html` (nếu có) để lên kiến trúc UI đủ page.
90
+ 3. (Optional) `/research-ui` để chạy walkthrough nâng cấp prototype + `notes.md`.
91
+ 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` đọ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
93
 
74
94
  ## Kiểm tra nhanh (optional)
75
95
 
@@ -48,6 +48,8 @@ vp-tools help
48
48
  # Hiển thị targets + ViePilot CLI Tools
49
49
  ```
50
50
 
51
+ Sau khi cài, ViePilot tạo (nếu chưa có) **`~/.viepilot/profiles/`** và file mẫu **`~/.viepilot/profile-map.md`** để đăng ký profile tái sử dụng (brainstorm meta intake — xem `docs/dev/global-profiles.md`).
52
+
51
53
  Optional (maintainers):
52
54
  ```bash
53
55
  npm run readme:sync
@@ -8,6 +8,15 @@ const path = require('path');
8
8
  const os = require('os');
9
9
  const { resolveViepilotPackageRoot } = require('./viepilot-info.cjs');
10
10
 
11
+ /** @see docs/dev/global-profiles.md (FEAT-009) */
12
+ const VIEPILOT_PROFILE_MAP_SEED = `# ViePilot profile map
13
+
14
+ Machine-level registry for reusable org/client profiles. Add rows when you create files under \`profiles/\`. Normative contract: bundled \`docs/dev/global-profiles.md\`.
15
+
16
+ | profile_id | display_name | org_tag | profile_path | tags | last_used |
17
+ |------------|--------------|---------|--------------|------|-----------|
18
+ `;
19
+
11
20
  /**
12
21
  * @param {Record<string, string | undefined>} [envSource]
13
22
  * @returns {{ autoYes: boolean, profile: string, addPath: boolean, symlinkSkills: boolean }}
@@ -78,6 +87,9 @@ function buildInstallPlan(packageRoot, envSource = process.env, opts = {}) {
78
87
  opts.overrideHomedir != null ? path.resolve(opts.overrideHomedir) : os.homedir();
79
88
  const cursorSkillsDir = path.join(home, '.cursor', 'skills');
80
89
  const viepilotDir = path.join(home, '.cursor', 'viepilot');
90
+ const viepilotUserDataDir = path.join(home, '.viepilot');
91
+ const viepilotProfilesDir = path.join(viepilotUserDataDir, 'profiles');
92
+ const viepilotProfileMapPath = path.join(viepilotUserDataDir, 'profile-map.md');
81
93
 
82
94
  let wantPathShim = opts.wantPathShim;
83
95
  if (wantPathShim === undefined) {
@@ -100,6 +112,13 @@ function buildInstallPlan(packageRoot, envSource = process.env, opts = {}) {
100
112
  steps.push({ kind: 'mkdir', path: dir });
101
113
  }
102
114
 
115
+ steps.push({ kind: 'mkdir', path: viepilotProfilesDir });
116
+ steps.push({
117
+ kind: 'write_file_if_missing',
118
+ path: viepilotProfileMapPath,
119
+ content: VIEPILOT_PROFILE_MAP_SEED,
120
+ });
121
+
103
122
  for (const name of listSkillDirNames(root)) {
104
123
  const src = path.join(root, 'skills', name);
105
124
  const dest = path.join(cursorSkillsDir, name);
@@ -205,6 +224,9 @@ function buildInstallPlan(packageRoot, envSource = process.env, opts = {}) {
205
224
  paths: {
206
225
  cursorSkillsDir,
207
226
  viepilotDir,
227
+ viepilotUserDataDir,
228
+ viepilotProfilesDir,
229
+ viepilotProfileMapPath,
208
230
  },
209
231
  steps,
210
232
  };
@@ -222,6 +244,9 @@ function formatPlanLines(plan) {
222
244
  lines.push(` profile: ${plan.env.profile} (informational; same file set as install.sh)`);
223
245
  lines.push(` skills: ${plan.paths.cursorSkillsDir}`);
224
246
  lines.push(` viepilot: ${plan.paths.viepilotDir}`);
247
+ if (plan.paths.viepilotUserDataDir) {
248
+ lines.push(` userData (~/.viepilot): ${plan.paths.viepilotUserDataDir}`);
249
+ }
225
250
  lines.push('');
226
251
  for (let i = 0; i < plan.steps.length; i++) {
227
252
  const s = plan.steps[i];
@@ -230,6 +255,9 @@ function formatPlanLines(plan) {
230
255
  case 'mkdir':
231
256
  lines.push(`${n}. mkdir -p ${s.path}`);
232
257
  break;
258
+ case 'write_file_if_missing':
259
+ lines.push(`${n}. writeFileIfMissing ${s.path}`);
260
+ break;
233
261
  case 'copy_file':
234
262
  lines.push(`${n}. copy ${s.from} -> ${s.to}`);
235
263
  break;
@@ -340,6 +368,15 @@ function applyInstallPlan(plan, options = {}) {
340
368
  if (dryRun) logs.push(`[dry-run] mkdir -p ${step.path}`);
341
369
  else fs.mkdirSync(step.path, { recursive: true });
342
370
  break;
371
+ case 'write_file_if_missing':
372
+ if (dryRun) logs.push(`[dry-run] writeFileIfMissing ${step.path}`);
373
+ else {
374
+ fs.mkdirSync(path.dirname(step.path), { recursive: true });
375
+ if (!fs.existsSync(step.path)) {
376
+ fs.writeFileSync(step.path, step.content, 'utf8');
377
+ }
378
+ }
379
+ break;
343
380
  case 'copy_file':
344
381
  if (dryRun) logs.push(`[dry-run] copy ${step.from} -> ${step.to}`);
345
382
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viepilot",
3
- "version": "1.8.1",
3
+ "version": "1.9.1",
4
4
  "description": "**Autonomous Vibe Coding Framework / Bộ khung phát triển tự động có kiểm soát**",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: vp-brainstorm
3
3
  description: "Brainstorm session để thu thập ý tưởng, quyết định cho dự án"
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  ---
6
6
 
7
7
  <cursor_skill_adapter>
@@ -34,6 +34,8 @@ Hỗ trợ:
34
34
  - In-session research (research ngay trong phiên brainstorm theo yêu cầu)
35
35
  - UI Direction mode: tạo/cập nhật HTML prototype + notes trong `.viepilot/ui-direction/{session-id}/` — hỗ trợ **multi-page** (`pages/{slug}.html` + hub `index.html`) và hook **`## Pages inventory`** trong `notes.md` khi có `pages/` (FEAT-007)
36
36
  - **Product horizon (ENH-014):** mọi session phải duy trì **`## Product horizon`** khi thảo luận capability/milestone — tier tags `(MVP)` / `(Post-MVP)` / `(Future)`, non-goals, deferred capabilities; hoặc ghi rõ **single-release / no deferred epics** (contract: `workflows/brainstorm.md`)
37
+ - **Project meta intake (FEAT-009):** sau khi **scope locked**, **trước** `Completed` / `/end`, nếu thiếu `.viepilot/META.md` (`viepilot_profile_id`) — chạy Q&A **tuần tự** có proposal; đọc/ghi `~/.viepilot/profile-map.md`; tạo `~/.viepilot/profiles/<slug>.md` + binding theo **`docs/dev/global-profiles.md`**. Nếu đã có profile bound — skip intake mặc định (hỏi đổi nếu cần).
38
+ - **UX walkthrough (FEAT-010):** trong **`--ui`**, lệnh **`/research-ui`** hoặc **`/research ui`** chạy 3 phase — mô phỏng **end-user** → **UX designer + web research** → chỉnh `index.html` / `pages/*.html` / `style.css` và ghi **`## UX walkthrough log`** trong `notes.md` (đồng bộ hub + **Pages inventory** khi multi-page).
37
39
 
38
40
  **Creates/Updates:**
39
41
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
@@ -65,10 +67,12 @@ Key steps:
65
67
  4. Run interactive Q&A với topic-based structure
66
68
  5. Nếu topic là landing page: hỏi thêm bố cục + tham khảo `21st.dev` để đề xuất section/components
67
69
  6. Nếu topic cần UI/UX: tạo/cập nhật UI Direction artifacts trong `.viepilot/ui-direction/{session-id}/` — legacy: `index.html` + `style.css` + `notes.md`; multi-page: thêm `pages/*.html`, `index.html` làm hub, và sau mỗi thay đổi page cập nhật **`## Pages inventory`** trong `notes.md` (xem `docs/user/features/ui-direction.md`)
70
+ 6b. Khi user gõ **`/research-ui`** hoặc **`/research ui`** trong phiên UI: làm đúng **`workflows/brainstorm.md`** (FEAT-010) — không gộp vào bước research ngắn thường lệ
68
71
  7. Nếu user yêu cầu research hoặc cần làm rõ quyết định: research ngay trong session và quay lại topic
69
72
  8. Khi topic thêm/sửa capability hoặc release scope: cập nhật **`## Product horizon`** trong session (merge, không xóa tier tags im lặng) theo `workflows/brainstorm.md`
70
- 9. Save session with structured format (bao gồm research notes + UI direction references + **Product horizon** khi có)
71
- 10. Suggest next action: `/vp-crystallize`
73
+ 9. Trước khi hoàn tất phiên: **bước 5 — Project meta intake (FEAT-009)** trong `workflows/brainstorm.md` khi binding thiếu; sequential Q&A + profile-map disambiguation + ghi global profile + `.viepilot/META.md`
74
+ 10. Save session with structured format (bao gồm **`## Project meta intake (FEAT-009)`**, research notes + UI direction references + **Product horizon** khi có)
75
+ 11. Suggest next action: `/vp-crystallize`
72
76
  </process>
73
77
 
74
78
  <success_criteria>
@@ -81,6 +85,8 @@ Key steps:
81
85
  - [ ] Research can be executed inside the same brainstorm session
82
86
  - [ ] UI Direction artifacts created/updated when UI mode is active
83
87
  - [ ] Multi-page sessions: hub links + `## Pages inventory` stay in sync with `pages/*.html`
88
+ - [ ] **FEAT-010**: `/research-ui` (khi `--ui`) chạy đủ 3 phase + **`## UX walkthrough log`** khi có chỉnh prototype
84
89
  - [ ] `## Product horizon` present với MVP / Post-MVP / Future (hoặc explicit single-release statement) khi scope được thảo luận
90
+ - [ ] **FEAT-009**: intake hoàn tất hoặc binding đã có **hoặc** waiver có lý do trước Completed; session ghi **`## Project meta intake (FEAT-009)`**
85
91
  - [ ] Next steps suggested
86
92
  </success_criteria>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: vp-crystallize
3
3
  description: "Chuyển đổi brainstorm thành executable artifacts"
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  ---
6
6
 
7
7
  <cursor_skill_adapter>
@@ -47,6 +47,9 @@ Chuyển đổi brainstorm sessions thành structured artifacts để AI có th
47
47
  - `LICENSE`
48
48
  - Updated `README.md`
49
49
 
50
+ **ViePilot profile (FEAT-009):**
51
+ - Đọc `.viepilot/META.md` → file `~/.viepilot/profiles/<slug>.md` (contract: `docs/dev/global-profiles.md`); pre-fill Step 0; merge vào **ARCHITECTURE** (`## ViePilot organization context`), **PROJECT-CONTEXT** (`## ViePilot active profile`), **AI-GUIDE** quick context.
52
+
50
53
  **Stack intelligence (global cache):**
51
54
  - `~/.viepilot/stacks/{stack}/SUMMARY.md`
52
55
  - `~/.viepilot/stacks/{stack}/BEST-PRACTICES.md`
@@ -68,7 +71,8 @@ Execute workflow from `@$HOME/.cursor/viepilot/workflows/crystallize.md`
68
71
  Key steps:
69
72
 
70
73
  ### Step 0: Collect Project Metadata
71
- Ask user for:
74
+ - **FEAT-009:** Load `.viepilot/META.md` + global profile file first (`workflows/crystallize.md`); set `profile_resolved` or `none`; pre-fill org/website khi có profile.
75
+ Ask user for (confirm proposals từ profile nếu có):
72
76
  - Project name, description
73
77
  - Organization name, website
74
78
  - Package Base ID (e.g., com.company.project)
@@ -110,6 +114,7 @@ Ask user for:
110
114
  - Quick lookup table
111
115
  - Context loading strategy
112
116
  - File relationships
117
+ - **FEAT-009:** Quick context cho `profile_id` + path profile khi đã resolve
113
118
 
114
119
  ### Step 3: Generate PROJECT-META.md
115
120
  - Project info
@@ -117,9 +122,11 @@ Ask user for:
117
122
  - Package structure
118
123
  - Developer info
119
124
  - File headers template
125
+ - **FEAT-009:** Align Organization với profile đã confirm (public only)
120
126
 
121
127
  ### Step 4: Generate ARCHITECTURE.md
122
128
  - System overview
129
+ - **FEAT-009:** Section `## ViePilot organization context` khi có profile (hoặc dòng none)
123
130
  - Services definitions
124
131
  - Data flow
125
132
  - Technology decisions
@@ -132,6 +139,7 @@ Ask user for:
132
139
  - `N/A` => keep section heading + one-line rationale
133
140
 
134
141
  ### Step 5: Generate PROJECT-CONTEXT.md
142
+ - **FEAT-009:** Block `## ViePilot active profile (FEAT-009)` khi có binding
135
143
  - Domain knowledge
136
144
  - Business rules
137
145
  - Conventions
@@ -192,4 +200,5 @@ Ask user for:
192
200
  - [ ] Project files created
193
201
  - [ ] Git committed
194
202
  - [ ] ARCHITECTURE diagram matrix is present and consistent (`required|optional|N/A`)
203
+ - [ ] **FEAT-009:** Nếu có profile bound — ARCHITECTURE + PROJECT-CONTEXT ghi nguồn profile; nếu không — ghi rõ none / not configured
195
204
  </success_criteria>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: vp-docs
3
3
  description: "Generate comprehensive documentation cho dự án"
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  ---
6
6
 
7
7
  <cursor_skill_adapter>
@@ -54,6 +54,7 @@ CHANGELOG.md (updated)
54
54
  - GitHub owner/repo from `git remote get-url origin`
55
55
  - Skills count from `ls skills/*/SKILL.md | wc -l`
56
56
  - Workflows count from `ls workflows/*.md | wc -l`
57
+ - **FEAT-009:** Optional ViePilot global profile từ `.viepilot/META.md` + `~/.viepilot/profiles/` cho attribution/tone (`workflows/documentation.md` §0A)
57
58
  </objective>
58
59
 
59
60
  <execution_context>
@@ -89,6 +90,10 @@ ACTUAL_WORKFLOWS=$(ls workflows/*.md 2>/dev/null | wc -l | tr -d ' ')
89
90
  > Use `$ACTUAL_SKILLS` and `$ACTUAL_WORKFLOWS` for counts.
90
91
  > **Never write** `your-org`, `YOUR_USERNAME`, `YOUR_ORG` into generated files.
91
92
 
93
+ ### Step 0A: ViePilot active profile (FEAT-009)
94
+
95
+ Sau Step 0: resolve `.viepilot/META.md` → file profile global (cùng quy tắc `workflows/crystallize.md`). Giữ working notes (org, website, audience, branding) cho prose docs; **không** fail nếu thiếu. Chi tiết: `workflows/documentation.md` §0A.
96
+
92
97
  ### Step 1: Ask Documentation Scope
93
98
  ```
94
99
  Which documentation would you like to generate?
@@ -262,4 +267,5 @@ View at: docs/README.md
262
267
  - [ ] skills-reference.md has sections for all skills in skills/ directory
263
268
  - [ ] Root README.md Documentation table updated
264
269
  - [ ] Git committed
270
+ - [ ] **FEAT-009:** Nếu có profile — dùng cho attribution khi phù hợp; nếu không — bỏ qua im lặng (không placeholder sai)
265
271
  </success_criteria>
@@ -0,0 +1,30 @@
1
+ ---
2
+ # ViePilot: links this repo to a global reusable profile (~/.viepilot/profiles/).
3
+ # Created/updated by brainstorm meta intake or manual edit.
4
+ viepilot_profile_id: "{{PROFILE_SLUG}}"
5
+ # Optional absolute override (rare):
6
+ # viepilot_profile_path: "/custom/path/profile.md"
7
+ ---
8
+
9
+ # ViePilot project binding
10
+
11
+ Operational metadata for ViePilot workflows (**not** full product metadata — see `PROJECT-META.md` if used).
12
+
13
+ ## Active profile
14
+
15
+ | Field | Value |
16
+ |-------|-------|
17
+ | **profile_id** | `{{PROFILE_SLUG}}` |
18
+ | **Global file** | `~/.viepilot/profiles/{{PROFILE_SLUG}}.md` |
19
+
20
+ ## Project-specific overrides
21
+
22
+ _Add only non-secret lines that apply to this repo only (e.g. codename, release target). Full org context should live in the global profile file._
23
+
24
+ -
25
+
26
+ ## Intake notes
27
+
28
+ _Short trail from meta intake (optional):_
29
+
30
+ -
@@ -163,6 +163,39 @@ Khi thư mục `pages/` tồn tại hoặc bất kỳ `pages/*.html` nào đư
163
163
  - điều chỉnh theo mục tiêu sản phẩm
164
164
  4. Giữ prototype ở mức mô tả định hướng (directional), không ép build production-ready code ở bước brainstorm.
165
165
 
166
+ ### UI Direction — UX walkthrough & upgrade (FEAT-010)
167
+
168
+ Khi đang trong **`/vp-brainstorm --ui`** hoặc đã có `.viepilot/ui-direction/{session-id}/` cho phiên hiện tại, user có thể gọi:
169
+
170
+ - **`/research-ui`** — chạy đủ pipeline dưới đây
171
+ - **`/research ui`** — **alias** của `/research-ui` (khoảng trắng sau `research`; không trùng `/research {chủ đề tự do}`)
172
+
173
+ User có thể kèm ngữ cảnh một dòng (vd. tên sản phẩm **Trips**, persona, flow ưu tiên) — nhập vào cùng tin nhắn lệnh.
174
+
175
+ Áp dụng **các phase tuần tự** (assistant không bỏ qua phase trừ khi user explicit “chỉ phase 1”):
176
+
177
+ #### Phase 1 — Mô phỏng người dùng cuối
178
+
179
+ 1. Đóng vai **người dùng cuối** đang dùng prototype (lấy tên app / màn chính từ `notes.md`, HTML, hoặc prompt user).
180
+ 2. Liệt kê **3–8 scenario** cụ thể (vd. lần đầu mở app, hoàn tất task chính, lỗi edge case) — ưu tiên đúng page nếu multi-page (`pages/*.html`).
181
+ 3. Với từng scenario: mô tả **hành vi** (đọc/click tưởng tượng trên UI hiện tại) → ghi **pain**: mơ hồ, thiếu phản hồi, quá nhiều bước, không khớp mental model, khả năng mobile/a11y, v.v.
182
+ 4. Tổng hợp **Voice of pseudo-user** (bullet + mức độ **low / medium / high**).
183
+
184
+ #### Phase 2 — UX designer + research
185
+
186
+ 1. Đổi vai: **UX/UI designer** nhận feedback từ Phase 1.
187
+ 2. Map pain → **nguyên nhân thiết kế** (heuristic ngắn, pattern thiếu/sai); **ưu tiên hóa** P0 / P1 / P2.
188
+ 3. **Web research**: khi cần benchmark hoặc pattern chuẩn ngành, chạy **1–3 truy vấn** (search) → tóm tắt nguồn, takeaway, trade-off.
189
+ 4. **Đề xuất cải tiến** cụ thể (thành phần UI, copy, layout, luồng) gắn với file/page (`slug` nếu multi-page).
190
+
191
+ #### Phase 3 — Cập nhật artifact
192
+
193
+ 1. Sửa **`index.html`**, **`pages/*.html`**, **`style.css`** theo P0 → P1 trong phạm vi phiên (prototype direction, không ép production).
194
+ 2. Trong **`notes.md`**, thêm hoặc append section **`## UX walkthrough log`** (một entry mỗi lần chạy lệnh): ngày/scenario đã mô phỏng, pain chính, link research (nếu có), **diff ý định** (bullet), file đã đổi.
195
+ 3. **Multi-page**: sau chỉnh sửa page, giữ **`## Pages inventory`** và **hub** khớp 100% file trong `pages/*` (hook FEAT-007).
196
+
197
+ **Quan hệ với `/research {topic}`**: lệnh **tự do** chỉ cần research ngắn và quay lại topic; **`/research-ui`** bắt buộc **3 phase** + **ghi log** + **chỉnh HTML/CSS khi có đề xuất hợp lý**.
198
+
166
199
  Tham chiếu user: `docs/user/features/ui-direction.md`.
167
200
 
168
201
  ### Kết thúc mỗi topic
@@ -172,8 +205,76 @@ Tham chiếu user: `docs/user/features/ui-direction.md`.
172
205
  - Nếu topic thêm/sửa capability: cập nhật **`## Product horizon`** trong bản nháp session (hoặc nhắc user lưu `/save`) với tag tier phù hợp
173
206
  </step>
174
207
 
208
+ <step name="project_meta_intake">
209
+ ## 5. Project meta intake (FEAT-009)
210
+
211
+ Normative contract: **`docs/dev/global-profiles.md`** (`~/.viepilot/profiles/`, `~/.viepilot/profile-map.md`, `.viepilot/META.md`).
212
+
213
+ ### 5.1 When this step runs
214
+
215
+ Chạy **trước** khi ghi session ở trạng thái **`Completed`** hoặc khi user gõ **`/end`**, **nếu**:
216
+
217
+ 1. **Scope locked**: `## Product horizon` trong bản nháp session đã có nội dung thật (không chỉ placeholder) **hoặc** user vừa xác nhận bằng lời đã chốt scope MVP / horizon.
218
+ 2. **Binding thiếu**: không tồn tại `.viepilot/META.md` **hoặc** frontmatter thiếu `viepilot_profile_id` hợp lệ (slug `kebab-case` theo contract).
219
+
220
+ **Bỏ qua mặc định** (skip intake) khi `.viepilot/META.md` đã có `viepilot_profile_id` hợp lệ — chỉ hỏi nhanh: *“Giữ profile `{id}`? Đổi profile?”*; nếu giữ → sang bước Save.
221
+
222
+ ### 5.2 Chuẩn bị registry
223
+
224
+ 1. `mkdir -p "$HOME/.viepilot/profiles"` nếu cần.
225
+ 2. Đọc `~/.viepilot/profile-map.md` nếu có để liệt kê profile hiện có (profile_id, display_name, org_tag).
226
+
227
+ ### 5.3 Disambiguation (nhiều profile / nhiều org)
228
+
229
+ - Nếu brainstorm cho thấy **nhiều org/client** hoặc **≥2 dòng trong profile-map** khớp gợi ý (cùng `org_tag` hoặc tag): **bắt buộc** user chọn **một** `profile_id` **hoặc** chọn **Tạo profile mới** (slug mới, chưa tồn tại).
230
+
231
+ ### 5.4 Q&A tuần tự (một câu mỗi lượt)
232
+
233
+ Với mỗi câu hỏi:
234
+
235
+ 1. Đưa **Proposal** ngắn (1–2 câu) suy ra từ session + Product horizon.
236
+ 2. User trả lời **Accept proposal** / **Edit** (ghi nhận bản user).
237
+ 3. Sang câu tiếp.
238
+
239
+ **Tối thiểu** phải làm rõ trước khi ghi file (khớp body sections trong global contract):
240
+
241
+ | Thứ tự | Câu hỏi (gợi ý) | Map tới |
242
+ |--------|------------------|---------|
243
+ | 1 | Tên hiển thị org/client hoặc “cá nhân”? | `display_name` |
244
+ | 2 | `org_tag` ngắn (vd. `acme`, `personal`)? | `org_tag` |
245
+ | 3 | Branding / giọng văn (audience, tone)? | body `## Branding & voice` |
246
+ | 4 | Legal / attribution công khai (nếu có)? | body `## Legal & attribution` |
247
+ | 5 | Website công khai (optional)? | frontmatter `website` |
248
+
249
+ Sau đó: chốt **`profile_id`** = slug filename (`kebab-case`).
250
+
251
+ ### 5.5 Ghi artifact (machine + project)
252
+
253
+ 1. **`~/.viepilot/profiles/<slug>.md`**: YAML frontmatter đủ key bắt buộc (`profile_id`, `display_name`, `org_tag`, `tags`, `last_updated`) + body sections đã thu thập. **Không** ghi secrets.
254
+ 2. **`~/.viepilot/profile-map.md`**: thêm hoặc cập nhật dòng bảng (cột theo contract); cập nhật `last_used` = ngày hiện tại.
255
+ 3. **`.viepilot/META.md`**: tạo/cập nhật từ `templates/project/VIEPILOT-META.md` với `viepilot_profile_id: <slug>`.
256
+
257
+ ### 5.6 Ghi nhận trong session file
258
+
259
+ Trong bản nháp / file session, thêm section:
260
+
261
+ ```markdown
262
+ ## Project meta intake (FEAT-009)
263
+ - **status**: completed | skipped
264
+ - **profile_id**: {slug}
265
+ - **profile_path**: ~/.viepilot/profiles/{slug}.md
266
+ - **binding**: .viepilot/META.md
267
+ ```
268
+
269
+ Nếu skipped (hiếm): phải có **`## Meta intake waiver`** trong cùng file session kèm **lý do** do user cung cấp.
270
+
271
+ ### 5.7 Tiếp tục
272
+
273
+ Sau khi intake **completed** hoặc **hợp lệ skip** (META đã có profile) → chuyển sang **bước 6 — Save Session**.
274
+ </step>
275
+
175
276
  <step name="save_session">
176
- ## 5. Save Session
277
+ ## 6. Save Session
177
278
 
178
279
  Tạo/cập nhật file: `docs/brainstorm/session-{YYYY-MM-DD}.md`
179
280
 
@@ -209,6 +310,17 @@ Tạo/cập nhật file: `docs/brainstorm/session-{YYYY-MM-DD}.md`
209
310
 
210
311
  **Scope note (optional):** Nếu không có post-MVP: `Single-release product — no separate horizon epics.`
211
312
 
313
+ ## Project meta intake (FEAT-009)
314
+
315
+ - **status**: not_started | completed | skipped
316
+ - **profile_id**:
317
+ - **profile_path**:
318
+ - **binding** (.viepilot/META.md):
319
+
320
+ _(Điền sau bước 5 — Project meta intake; xem `docs/dev/global-profiles.md`.)_
321
+
322
+ <!-- Nếu skipped: ## Meta intake waiver + lý do -->
323
+
212
324
  ## Architecture diagram applicability inputs
213
325
 
214
326
  > Input contract for `/vp-crystallize` Step 4. Keep concise and explicit.
@@ -261,6 +373,9 @@ Tạo/cập nhật file: `docs/brainstorm/session-{YYYY-MM-DD}.md`
261
373
  - Preview focus:
262
374
  - {layout/flow summary; list each page slug if multi-page}
263
375
 
376
+ **UX walkthrough log** (optional; FEAT-010 — khi đã chạy `/research-ui`):
377
+ - {YYYY-MM-DD}: scenarios exercised → top pains → research links → HTML/CSS edits summary
378
+
264
379
  ---
265
380
 
266
381
  ## Summary
@@ -289,7 +404,7 @@ git push
289
404
  </step>
290
405
 
291
406
  <step name="suggest_next">
292
- ## 6. Suggest Next Action
407
+ ## 7. Suggest Next Action
293
408
 
294
409
  ```
295
410
  ✓ Brainstorm session saved
@@ -315,9 +430,11 @@ User có thể dùng các lệnh trong phiên brainstorm:
315
430
  - `/topic {name}` - Chuyển sang topic mới
316
431
  - `/summary` - Xem tóm tắt phiên hiện tại
317
432
  - `/save` - Lưu tiến độ ngay
318
- - `/end` - Kết thúc và lưu phiên
433
+ - `/end` - Kết thúc và lưu phiên (sau **bước 5 — Project meta intake** khi binding thiếu; xem workflow)
319
434
  - `/questions` - Xem danh sách open questions
320
435
  - `/research {topic}` - Research nhanh ngay trong phiên và quay lại topic hiện tại
436
+ - `/research-ui` — UX walkthrough: mô phỏng user → designer + research → cập nhật UI direction + log (`notes.md`) — chỉ khi có UI session (FEAT-010)
437
+ - `/research ui` — alias của `/research-ui`
321
438
  </commands>
322
439
 
323
440
  <success_criteria>
@@ -329,5 +446,8 @@ User có thể dùng các lệnh trong phiên brainstorm:
329
446
  - [ ] Landing page topics trigger layout follow-up questions
330
447
  - [ ] 21st.dev references được dùng khi thảo luận landing page
331
448
  - [ ] Research có thể chạy ngay trong brainstorm session khi user yêu cầu
449
+ - [ ] **FEAT-010**: Trong UI Direction, `/research-ui` (hoặc `/research ui`) chạy đủ 3 phase và ghi **`## UX walkthrough log`** khi chỉnh prototype
332
450
  - [ ] Git committed
451
+ - [ ] **FEAT-009**: Nếu binding thiếu và scope đã locked — đã chạy **Project meta intake** (bước 5) hoặc có **`## Meta intake waiver`** có lý do trước Completed
452
+ - [ ] **`## Project meta intake (FEAT-009)`** trong session: `status` + `profile_id` khi completed (hoặc waiver nếu skipped)
333
453
  </success_criteria>
@@ -14,6 +14,23 @@ Chuyển đổi brainstorm sessions thành structured artifacts để AI có th
14
14
  <step name="collect_metadata">
15
15
  ## Step 0: Collect Project Metadata
16
16
 
17
+ ### ViePilot active profile (FEAT-009)
18
+
19
+ Normative: **`docs/dev/global-profiles.md`**. Binding: **`.viepilot/META.md`** (`viepilot_profile_id`, optional `viepilot_profile_path`).
20
+
21
+ **Trước** block câu hỏi Basic Info:
22
+
23
+ 1. Nếu có `.viepilot/META.md`, parse YAML frontmatter lấy `viepilot_profile_id` và tùy chọn `viepilot_profile_path`.
24
+ 2. **Resolve** file profile markdown:
25
+ - Nếu `viepilot_profile_path` có và file tồn tại (expand `~` / `$HOME`) → dùng path đó.
26
+ - Else nếu có `viepilot_profile_id` hợp lệ → `$HOME/.viepilot/profiles/<viepilot_profile_id>.md`.
27
+ 3. **Khi đọc được file profile:**
28
+ - Đọc frontmatter (`display_name`, `org_tag`, `website`, `tags`, …) và body (`## Organization`, `## Branding & voice`, `## Audience`, `## Legal & attribution`, `## Contact (public)`).
29
+ - **Pre-fill** các câu hỏi Step 0 (org, website, mô tả ngắn nếu khớp) dưới dạng **proposal**; user **confirm** hoặc **sửa**.
30
+ - Ghi working note **`profile_resolved`**: `{ profile_id, absolute_path }` cho các bước sau.
31
+ 4. **Khi không có META, thiếu id, hoặc file không tồn tại:**
32
+ - Ghi **`profile_resolved: none`** và tiếp tục Step 0 như cũ — **không** fail crystallize.
33
+
17
34
  Hỏi user các thông tin dự án:
18
35
 
19
36
  ### Basic Info
@@ -202,6 +219,7 @@ Create `.viepilot/AI-GUIDE.md` using template:
202
219
 
203
220
  Customize with:
204
221
  - Project-specific file references
222
+ - **ViePilot profile (FEAT-009):** Nếu Step 0 đặt `profile_resolved` thành đường dẫn hợp lệ, thêm mục **Quick context** ghi `profile_id`, đường dẫn file profile, và nhắc đọc file đó cho **tone/branding** khi viết user-facing text. Nếu `profile_resolved: none`, ghi một dòng: chưa bind profile global.
205
223
  - Context loading strategy based on project size — **preserve template ordering** where `PROJECT-CONTEXT.md` **`<product_vision>`** and **`ROADMAP.md` horizon** (Post-MVP / Future) are read **before** deep implementation / architecture lock; state this explicitly in the generated `AI-GUIDE.md` if you trim sections
206
224
  - Quick lookup for project-specific terms
207
225
  - Fast stack lookup section:
@@ -222,6 +240,7 @@ Fill with collected metadata:
222
240
  - Package structure (generate from base ID)
223
241
  - Developer info
224
242
  - File headers (generate from metadata)
243
+ - **FEAT-009:** Nếu profile đã resolve ở Step 0 và user đã confirm pre-fill, **ưu tiên** khớp bảng Organization / attribution trong template với nội dung profile (chỉ dữ liệu công khai; không secrets).
225
244
  </step>
226
245
 
227
246
  <step name="generate_architecture">
@@ -237,6 +256,21 @@ Extract from brainstorm:
237
256
  - Technology decisions with rationale
238
257
  - Integration points
239
258
 
259
+ ### ViePilot organization context (FEAT-009)
260
+
261
+ - Nếu Step 0 ghi **`profile_resolved`** với đường dẫn hợp lệ: ngay sau phần **overview** đầu tiên của `.viepilot/ARCHITECTURE.md`, thêm section:
262
+
263
+ ```markdown
264
+ ## ViePilot organization context
265
+
266
+ > **Active profile**: `{profile_id}` — `{absolute path to profile file}` — binding `.viepilot/META.md`.
267
+
268
+ ```
269
+
270
+ Sau đó **2–8 bullet** tóm tắt (không secrets) từ **Organization**, **Branding & voice**, **Audience** trong file profile.
271
+
272
+ - Nếu **`profile_resolved: none`**: một dòng dưới overview: *No ViePilot global profile bound — organization context comes from Step 0 only.*
273
+
240
274
  Before writing diagrams, create a **diagram applicability matrix** from brainstorm signals (complexity, service boundaries, event usage, deployment shape, user-flow complexity, integration surface):
241
275
 
242
276
  | Diagram type | Status | Rule |
@@ -267,6 +301,23 @@ Extract:
267
301
  - Business rules
268
302
  - Naming conventions
269
303
  - Constraints
304
+
305
+ **FEAT-009 — ViePilot active profile block:** Nếu profile đã resolve ở Step 0, chèn **trước** `<domain_knowledge>` (hoặc ngay sau title file) section:
306
+
307
+ ```markdown
308
+ ## ViePilot active profile (FEAT-009)
309
+
310
+ | Field | Value |
311
+ |-------|-------|
312
+ | profile_id | … |
313
+ | profile file | … |
314
+ | org_tag | … |
315
+
316
+ **Summary (non-secret):** …
317
+
318
+ ```
319
+
320
+ Nếu không có profile: một dòng *Profile binding not configured (`META.md` or global profile file missing).*
270
321
  </step>
271
322
 
272
323
  <step name="generate_rules">
@@ -58,6 +58,14 @@ Use `$GITHUB_OWNER`, `$GITHUB_REPO` throughout all generated files.
58
58
  For viepilot framework repos, also use `$ACTUAL_SKILLS`, `$ACTUAL_WORKFLOWS`.
59
59
  **Never hardcode** `your-org`, `YOUR_USERNAME`, `YOUR_ORG`, or static skill/workflow counts.
60
60
 
61
+ ### 0A. ViePilot active profile (FEAT-009)
62
+
63
+ Normative: **`docs/dev/global-profiles.md`**. Cùng **resolution** như `workflows/crystallize.md` Step 0 (đọc `.viepilot/META.md` → `viepilot_profile_path` hoặc `$HOME/.viepilot/profiles/<viepilot_profile_id>.md`).
64
+
65
+ 1. Nếu đọc được file profile, giữ **working notes** (display_name, org_tag, website, audience, branding) để dùng khi sinh README / contributing / bất kỳ prose **attribution** — chỉ nội dung **công khai**, không secrets.
66
+ 2. Nếu không có binding hoặc file thiếu → tiếp tục; **không** fail `/vp-docs`.
67
+ 3. Khi có profile, nhắc trong output (vd. footer README hoặc `docs/dev/architecture.md`) một dòng trích **profile_id** nếu phù hợp policy dự án.
68
+
61
69
  Post-generation validation (run after all files generated):
62
70
  ```bash
63
71
  PLACEHOLDERS=$(grep -r "your-org\|YOUR_USERNAME\|YOUR_ORG\|your-username" docs/ --include="*.md" -l 2>/dev/null)