viepilot 1.8.0 → 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,10 +9,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Planned
11
11
 
12
- - **M1.25 / Phase 29 (ENH-018)** — **Crystallize + ARCHITECTURE**: Mermaid diagrams **complexity-gated** from brainstorm; six diagram kinds with required/optional/N/A; vp-audit / vp-auto / vp-debug alignment; target **1.8.0** on complete.
12
+ - None.
13
13
 
14
14
  ### Added
15
15
 
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.
37
+
38
+ ## [1.8.1] - 2026-04-01
39
+
40
+ ### Fixed
41
+
42
+ - **M1.26 / Phase 30 (BUG-004) completed** — enforced vp-only namespace behavior across the framework: all `vp-*` skills include scope guard rules, core workflows default to `vp-*` routing only, and external skills are allowed only via explicit user opt-in.
43
+
44
+ ### Added
45
+
46
+ - `tests/unit/vp-scope-policy-contracts.test.js` — regression tests to ensure all bundled skills/workflows retain the BUG-004 scope policy contract.
47
+
48
+ ### Documentation
49
+
50
+ - `docs/skills-reference.md`, `docs/user/features/autonomous-mode.md`, `docs/user/features/debug-mode.md`, `docs/user/quick-start.md` — clarified default `vp-*` scope and added explicit opt-in examples for external skills.
51
+
16
52
  ## [1.8.0] - 2026-04-01
17
53
 
18
54
  ### Added
@@ -274,7 +310,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
274
310
 
275
311
  ---
276
312
 
277
- [Unreleased]: https://github.com/0-CODE/viepilot/compare/v1.8.0...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
316
+ [1.8.1]: https://github.com/0-CODE/viepilot/compare/v1.8.0...v1.8.1
278
317
  [1.8.0]: https://github.com/0-CODE/viepilot/compare/v1.7.0...v1.8.0
279
318
  [0.10.0]: https://github.com/0-CODE/viepilot/compare/v0.9.0...v0.10.0
280
319
  [0.9.0]: https://github.com/0-CODE/viepilot/compare/v0.8.2...v0.9.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)
@@ -2,6 +2,14 @@
2
2
 
3
3
  Complete reference for all ViePilot skills.
4
4
 
5
+ ## ViePilot Scope Policy
6
+
7
+ - **Default behavior**: ViePilot workflows and responses only use skills under `vp-*`.
8
+ - **Out-of-scope by default**: skills outside the ViePilot namespace are ignored, even if present in the runtime environment.
9
+ - **Explicit opt-in**: external skills are considered only when the user explicitly asks to expand beyond ViePilot scope.
10
+ - **Routing fallback**: if an external skill is mentioned accidentally, prefer the closest built-in `vp-*` command instead.
11
+ - **Opt-in example**: "Trong bước này, cho phép dùng thêm external skills ngoài ViePilot để tham khảo."
12
+
5
13
  ---
6
14
 
7
15
  ## /vp-brainstorm
@@ -21,11 +29,15 @@ Complete reference for all ViePilot skills.
21
29
  | `/topic {name}` | Chuyển sang topic mới |
22
30
  | `/summary` | Xem tóm tắt hiện tại |
23
31
  | `/save` | Lưu tiến độ |
24
- | `/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) |
25
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` |
26
37
 
27
38
  ### Output
28
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`.
29
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`.
30
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).
31
43
 
@@ -43,6 +55,9 @@ Complete reference for all ViePilot skills.
43
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`.
44
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`).
45
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
+
46
61
  ### Metadata Collection
47
62
  - Project name, description
48
63
  - Organization name, website
@@ -221,6 +236,9 @@ AI pauses for user input when:
221
236
 
222
237
  **Purpose**: Generate documentation
223
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
+
224
242
  ### Flags
225
243
  | Flag | Description |
226
244
  |------|-------------|
@@ -30,6 +30,12 @@ Mỗi task:
30
30
  /vp-auto --dry-run # Preview, không execute
31
31
  ```
32
32
 
33
+ ## ViePilot Scope Policy (BUG-004)
34
+
35
+ - Mặc định, `/vp-auto` chỉ route/gợi ý các skill thuộc namespace `vp-*`.
36
+ - Nếu môi trường runtime có skills ngoài framework, workflow sẽ bỏ qua và ưu tiên skill ViePilot tương đương.
37
+ - Chỉ khi bạn ghi rõ yêu cầu mở rộng (explicit opt-in), agent mới được phép dùng external skills.
38
+
33
39
  ### Doc-first gate (v0.8.2 / BUG-001)
34
40
 
35
41
  Workflow `autonomous.md` yêu cầu **ghi nhận kế hoạch trong file task** và **`PHASE-STATE` → `in_progress`** trước khi chỉnh sửa deliverable. Xem `workflows/autonomous.md` — *Pre-execution documentation gate*.
@@ -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).
@@ -75,3 +75,4 @@ Active debug sessions:
75
75
  - Mô tả problem cụ thể: "X happens when Y" thay vì "something is broken"
76
76
  - Một session per issue — không mix nhiều bugs
77
77
  - Dùng `/vp-debug continue` sau context reset để không mất progress
78
+ - Theo policy BUG-004, `/vp-debug` mặc định chỉ dùng hệ skill `vp-*`; external skills chỉ dùng khi bạn explicit opt-in.
@@ -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
@@ -182,6 +184,14 @@ Hiển thị:
182
184
 
183
185
  ---
184
186
 
187
+ ## Skill Scope (BUG-004)
188
+
189
+ - Theo mặc định, ViePilot chỉ dùng hệ lệnh/skill `vp-*` trong toàn bộ workflow.
190
+ - Nếu bạn thấy đề cập skill ngoài framework, hãy coi đó là out-of-scope trừ khi bạn đã explicit opt-in.
191
+ - Ví dụ opt-in hợp lệ: "Cho phép dùng thêm external skills ngoài ViePilot trong bước research này."
192
+
193
+ ---
194
+
185
195
  ## Next Steps
186
196
 
187
197
  - [Skills Reference](../skills-reference.md) — Chi tiết tất cả commands
@@ -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.0",
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": {
@@ -15,6 +15,13 @@ Display audit results clearly with actionable suggestions grouped by tier.
15
15
  ## C. Tool Usage
16
16
  Use Cursor tools: `Shell`, `ReadFile`, `Glob`, `rg`, `ApplyPatch`, `WebSearch`, `WebFetch`, `Subagent`
17
17
  </cursor_skill_adapter>
18
+ <scope_policy>
19
+ ## ViePilot Namespace Guard (BUG-004)
20
+ - Default mode: only use and reference `vp-*` skills in ViePilot workflows.
21
+ - External skills (`non vp-*`) are out of framework scope unless user explicitly opts in.
22
+ - If external skills appear in runtime context, ignore them and route with the closest built-in `vp-*` skill.
23
+ </scope_policy>
24
+
18
25
 
19
26
  <objective>
20
27
  Audit ViePilot project state và documentation để phát hiện drift.
@@ -18,6 +18,13 @@ Use Cursor tools: `Shell`, `ReadFile`, `Glob`, `rg`, `ApplyPatch`, `WebSearch`,
18
18
  ## D. Subagent Spawning
19
19
  Use `Task(subagent_type="generalPurpose", ...)` for parallel execution.
20
20
  </cursor_skill_adapter>
21
+ <scope_policy>
22
+ ## ViePilot Namespace Guard (BUG-004)
23
+ - Default mode: only use and reference `vp-*` skills in ViePilot workflows.
24
+ - External skills (`non vp-*`) are out of framework scope unless user explicitly opts in.
25
+ - If external skills appear in runtime context, ignore them and route with the closest built-in `vp-*` skill.
26
+ </scope_policy>
27
+
21
28
 
22
29
  <objective>
23
30
  Autonomous execution của project phases. Cho mỗi phase: analyze → plan → execute → verify → iterate.
@@ -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>
@@ -15,6 +15,13 @@ Prompt user conversationally với numbered list options.
15
15
  ## C. Tool Usage
16
16
  Use Cursor tools: `Shell`, `ReadFile`, `Glob`, `rg`, `ApplyPatch`, `WebSearch`, `WebFetch`, `Subagent`
17
17
  </cursor_skill_adapter>
18
+ <scope_policy>
19
+ ## ViePilot Namespace Guard (BUG-004)
20
+ - Default mode: only use and reference `vp-*` skills in ViePilot workflows.
21
+ - External skills (`non vp-*`) are out of framework scope unless user explicitly opts in.
22
+ - If external skills appear in runtime context, ignore them and route with the closest built-in `vp-*` skill.
23
+ </scope_policy>
24
+
18
25
 
19
26
  <objective>
20
27
  Thu thập ý tưởng, requirements, quyết định kiến trúc cho dự án thông qua interactive Q&A.
@@ -27,6 +34,8 @@ Hỗ trợ:
27
34
  - In-session research (research ngay trong phiên brainstorm theo yêu cầu)
28
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)
29
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).
30
39
 
31
40
  **Creates/Updates:**
32
41
  - `docs/brainstorm/session-{YYYY-MM-DD}.md`
@@ -58,10 +67,12 @@ Key steps:
58
67
  4. Run interactive Q&A với topic-based structure
59
68
  5. Nếu topic là landing page: hỏi thêm bố cục + tham khảo `21st.dev` để đề xuất section/components
60
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ệ
61
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
62
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`
63
- 9. Save session with structured format (bao gồm research notes + UI direction references + **Product horizon** khi có)
64
- 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`
65
76
  </process>
66
77
 
67
78
  <success_criteria>
@@ -74,6 +85,8 @@ Key steps:
74
85
  - [ ] Research can be executed inside the same brainstorm session
75
86
  - [ ] UI Direction artifacts created/updated when UI mode is active
76
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
77
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)`**
78
91
  - [ ] Next steps suggested
79
92
  </success_criteria>