@piagent/platform 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +34 -27
  3. package/catalog/capabilities.json +8 -8
  4. package/docs/auto-delegation-policy.md +4 -4
  5. package/docs/command-reference-vietnamese.md +123 -86
  6. package/docs/context-window-policy.md +7 -7
  7. package/docs/distribution-standard.md +49 -11
  8. package/docs/herdr-workflow.md +3 -2
  9. package/docs/memory-policy.md +6 -3
  10. package/docs/operator-manual-vietnamese.md +81 -72
  11. package/docs/package-architecture-notes.md +6 -6
  12. package/docs/project-adapters.md +4 -4
  13. package/docs/project-onboarding.md +12 -11
  14. package/docs/publishing-for-teams.md +2 -2
  15. package/docs/quickstart-vietnamese.md +25 -23
  16. package/docs/release-install-policy.md +23 -7
  17. package/docs/runtime-harness-standard.md +7 -7
  18. package/docs/runtime-policy-design.md +1 -1
  19. package/docs/runtime-quality-baseline.md +1 -1
  20. package/docs/security-threat-model.md +1 -1
  21. package/docs/subagent-orchestration-capabilities.md +3 -3
  22. package/docs/subagents-and-multiagent.md +4 -4
  23. package/docs/task-implementation-contract.md +4 -4
  24. package/docs/task-lifecycle-vietnamese.md +2 -2
  25. package/docs/team-onboarding.md +39 -19
  26. package/docs/usage-observability.md +13 -12
  27. package/docs/workflow-recipes.md +12 -9
  28. package/docs-site/architecture.html +1 -1
  29. package/docs-site/commands.html +19 -15
  30. package/docs-site/content/commands.html +18 -14
  31. package/docs-site/content/permissions.html +11 -11
  32. package/docs-site/content/quickstart.html +12 -11
  33. package/docs-site/content/team.html +1 -1
  34. package/docs-site/content/workflows.html +17 -17
  35. package/docs-site/index.html +1 -1
  36. package/docs-site/mcp-approval.html +1 -1
  37. package/docs-site/mcp-auth.html +1 -1
  38. package/docs-site/mcp-servers.html +1 -1
  39. package/docs-site/mcp.html +1 -1
  40. package/docs-site/permissions.html +12 -12
  41. package/docs-site/profiles.html +1 -1
  42. package/docs-site/quickstart.html +13 -12
  43. package/docs-site/runtime.html +1 -1
  44. package/docs-site/scope.html +1 -1
  45. package/docs-site/security.html +1 -1
  46. package/docs-site/team.html +2 -2
  47. package/docs-site/workflows.html +18 -18
  48. package/package.json +1 -1
  49. package/packages/piagent-core/README.md +27 -27
  50. package/packages/piagent-core/extensions/piagent-guard.ts +1055 -190
  51. package/packages/piagent-core/package.json +1 -1
  52. package/packages/piagent-core/prompts/be-to-fe.md +3 -3
  53. package/packages/piagent-core/prompts/discuss.md +2 -2
  54. package/packages/piagent-core/prompts/plan.md +1 -1
  55. package/packages/piagent-core/prompts/platform-improve.md +1 -1
  56. package/packages/piagent-core/prompts/pr.md +1 -1
  57. package/packages/piagent-core/prompts/review.md +1 -1
  58. package/packages/piagent-core/prompts/scout.md +2 -2
  59. package/packages/piagent-core/prompts/task.md +2 -2
  60. package/scripts/init-project.sh +4 -3
  61. package/scripts/install-global.sh +47 -1
  62. package/scripts/profile-doctor.sh +1 -1
  63. package/scripts/setup.sh +4 -3
  64. package/scripts/team-doctor.sh +6 -8
  65. package/scripts/update-global.mjs +207 -11
  66. package/scripts/verify-local.sh +18 -17
  67. package/templates/project/.pi/context-index.json +2 -2
  68. package/templates/project/.pi/project-context.md +3 -3
  69. package/templates/project/AGENTS.md +4 -4
  70. package/packages/piagent-core/prompts/memory-policy.md +0 -52
  71. package/packages/piagent-core/prompts/model-options.md +0 -68
  72. package/packages/piagent-core/prompts/onboard-project.md +0 -147
  73. package/packages/piagent-core/prompts/piagent-commands.md +0 -69
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Mục tiêu
4
4
 
5
- Lần đầu gắn một project vào Pi Agent Platform, không nên nhảy thẳng vào `/task`.
5
+ Lần đầu gắn một project vào Pi Agent Platform, không nên nhảy thẳng vào `/workflow task`.
6
6
 
7
7
  Luồng chuẩn là:
8
8
 
@@ -11,10 +11,11 @@ cd /path/to/project
11
11
  pi
12
12
  /login
13
13
  <select provider/model>
14
- /onboard-project
14
+ /onboard
15
+ /onboard run
15
16
  ```
16
17
 
17
- Sau khi `/onboard-project` chạy xong, project có file:
18
+ `/onboard` mở menu/status runtime. Sau khi `/onboard run` chạy xong, project có file:
18
19
 
19
20
  ```text
20
21
  .pi/piagent-profile.json
@@ -27,7 +28,7 @@ Sau khi `/onboard-project` chạy xong, project có file:
27
28
  .pi/memory/MEMORY.md
28
29
  ```
29
30
 
30
- `/onboard-project` là nơi profile và tech stack được chọn. Ưu tiên select-style flow:
31
+ `/onboard run` là nơi profile và tech stack được chọn trong onboarding workflow. Ưu tiên select-style flow:
31
32
 
32
33
  ```text
33
34
  /profile setup
@@ -40,7 +41,7 @@ Nếu Pi host chưa có native select, command trả card compact và lệnh det
40
41
 
41
42
  `.pi/context-index.json` là compact advisory index dạng node/edge/citation cho profile, tech stack, verify command, docs, risk, memory pointer và task handoff đã được duyệt. Nó giúp agent tìm đúng điểm vào repo nhanh hơn, nhưng không phải source of truth hoặc security boundary.
42
43
 
43
- Context index là Pi runtime state. Không đọc/ghi raw file này trong workflow thường ngày; dùng `/context-index`, `piagent_context_index_status`, `piagent_context_index_search`, `/onboard-project` hoặc `piagent_context_index_record` để runtime có thể kiểm soát path và sanitize dữ liệu advisory trước khi đưa vào model.
44
+ Context index là Pi runtime state. Không đọc/ghi raw file này trong workflow thường ngày; dùng `/context`, `piagent_context_index_status`, `piagent_context_index_search`, `/onboard run` hoặc `piagent_context_index_record` để runtime có thể kiểm soát path và sanitize dữ liệu advisory trước khi đưa vào model.
44
45
 
45
46
  Memory markdown là local/private mặc định và bị ignore bởi `.pi/.gitignore`. Chỉ commit memory nếu team quyết định opt-in sau khi review/redact.
46
47
 
@@ -50,7 +51,7 @@ Memory markdown là local/private mặc định và bị ignore bởi `.pi/.giti
50
51
 
51
52
  Bash setup chỉ biết tạo template và detect marker. Nó không có model reasoning, không biết project purpose, module ownership, domain rule, hay risk boundary.
52
53
 
53
- `/onboard-project` phải chạy sau login/model selection để chính model sẽ dùng cho task đọc qua project, chọn/gợi ý profile, và tạo snapshot.
54
+ `/onboard run` phải chạy sau login/model selection để chính model sẽ dùng cho task đọc qua project, chọn/gợi ý profile, và tạo snapshot.
54
55
 
55
56
  ## Profile selection
56
57
 
@@ -108,8 +109,8 @@ Mục tiêu là hiểu cấu trúc và policy, không nhồi full repo vào cont
108
109
  `piagent_project_onboarding_record` sẽ tự ghi thêm `.pi/context-index.json` khi tool có sẵn. Nếu cần kiểm tra nhanh, dùng:
109
110
 
110
111
  ```text
111
- /context-index
112
- /context-index search <keyword>
112
+ /context index
113
+ /context search <keyword>
113
114
  ```
114
115
 
115
116
  ## Khi nào regenerate
@@ -117,7 +118,7 @@ Mục tiêu là hiểu cấu trúc và policy, không nhồi full repo vào cont
117
118
  Chạy lại:
118
119
 
119
120
  ```text
120
- /onboard-project
121
+ /onboard run
121
122
  ```
122
123
 
123
124
  khi có thay đổi lớn:
@@ -128,8 +129,8 @@ khi có thay đổi lớn:
128
129
  - API/schema/migration/auth/provider policy đổi;
129
130
  - project ownership hoặc domain rule đổi.
130
131
 
131
- ## Relationship với `/task`
132
+ ## Relationship với `/workflow task`
132
133
 
133
- `/task` sẽ yêu cầu đọc `.pi/project-context.md`. Nếu file còn trạng thái `Generated: not yet`, agent phải dừng và yêu cầu chạy `/onboard-project` trước.
134
+ `/workflow task` sẽ yêu cầu đọc `.pi/project-context.md`. Nếu file còn trạng thái `Generated: not yet`, agent phải dừng và yêu cầu chạy `/onboard run` trước.
134
135
 
135
136
  Đây là điểm khác với CLI thuần: context bootstrap trở thành một bước có artifact có thể review và tái dùng. `.pi/project-context.md` và `.pi/context-index.json` có thể commit cho team sau khi review; memory markdown thì private-by-default.
@@ -54,7 +54,7 @@ pi install /path/to/piagent
54
54
  - `1.1.9`: notice update hiện đúng trên bản cài bằng `pi install git:` — bản cài nhận diện theo vị trí thư mục, không theo `.git`.
55
55
  - `1.2.0`: `piagent-mcp` quản lý server đầy đủ, server do repo mang theo phải được duyệt mới dùng được, và `/piagent-mcp` là command trong session chứ không phải nhờ model chạy bash.
56
56
  - `1.2.1`: approval gate thật sự phủ direct tool và server đến qua `imports` — hai đường vòng mà bản `1.2.0` để hở; kèm một loạt fix về containment khi vendor, độ sâu shell guard, và credential trong URL.
57
- - `1.2.2`: tool output dài được compact vào preview trong Pi và capture local cho Agent Watch/report; thêm `/setname` và `/piagent-logs` cho session naming và log audit gọn.
57
+ - `1.2.2`: tool output dài được compact vào preview trong Pi và capture local cho Agent Watch/report; thêm `/setname` và `/logs` cho session naming và log audit gọn.
58
58
 
59
59
  ## Không publish
60
60
 
@@ -70,7 +70,7 @@ pi install /path/to/piagent
70
70
  2. Install the pinned terminal helper and matching Pi package.
71
71
  3. Login OAuth provider.
72
72
  4. Run `pi` in the target project.
73
- 5. Run `/onboard-project`.
73
+ 5. Run `/onboard`.
74
74
  6. Choose/apply a profile inside Pi.
75
75
 
76
76
  Chi tiết: `docs/team-onboarding.md` và `docs/distribution-standard.md`.
@@ -66,17 +66,18 @@ Sau khi login và chọn model intended cho project understanding:
66
66
  ```text
67
67
  /model # hoặc Ctrl+L để chọn model bằng selector của Pi
68
68
  /scoped-models # optional, chỉnh danh sách Ctrl+P cycle
69
- /piagent-commands
69
+ /commands
70
70
  /mcp # kiểm tra MCP adapter/server
71
71
  /subagents-doctor # health check subagent setup
72
- /onboard-project
73
- /context-index
74
- /memory-policy
72
+ /onboard
73
+ /onboard run
74
+ /context index
75
+ /memory
75
76
  ```
76
77
 
77
78
  `Ctrl+L` mở model selector, `Ctrl+P` đổi model trong scope, `Shift+Tab` đổi mức thinking. `piagent-setup` đã config sẵn `enabledModels`, MCP baseline preset `core`, và subagents preset `safe` — muốn xem hoặc đổi thì có [model-options.md](model-options.md), [mcp-and-tools.md](mcp-and-tools.md), [subagents-and-multiagent.md](subagents-and-multiagent.md).
78
79
 
79
- `/onboard-project` yêu cầu model đọc qua project theo phạm vi có kiểm soát, rồi ghi:
80
+ `/onboard` yêu cầu model đọc qua project theo phạm vi có kiểm soát, rồi ghi:
80
81
 
81
82
  ```text
82
83
  .pi/piagent-profile.json
@@ -98,9 +99,9 @@ Nếu chưa có profile/tech stack, dùng select-style flow để tránh agent t
98
99
 
99
100
  `web-frontend` chọn FE + database optional; `backend-api` chọn BE + database optional; `fullstack` chọn frontend, backend và database. Nếu Pi host chưa có native select, command sẽ trả card ngắn và lệnh deterministic `/profile tech apply ...`.
100
101
 
101
- `.pi/project-context.md` là snapshot context cho task sau. `.pi/context-index.json` là bản đồ node/edge/citation compact để tìm đúng điểm vào repo; vẫn phải đọc source hiện tại trước khi sửa. Không đọc/ghi raw file index trong task thường ngày; dùng `/context-index`, `/onboard-project` hoặc `piagent_context_index_record` để runtime sanitize dữ liệu advisory. Nếu snapshot còn `Generated: not yet` hoặc `/context-index` báo pending/stale, agent phải dừng trước task lớn và yêu cầu chạy `/onboard-project`.
102
+ `.pi/project-context.md` là snapshot context cho task sau. `.pi/context-index.json` là bản đồ node/edge/citation compact để tìm đúng điểm vào repo; vẫn phải đọc source hiện tại trước khi sửa. Không đọc/ghi raw file index trong task thường ngày; dùng `/context`, `/onboard run` hoặc `piagent_context_index_record` để runtime sanitize dữ liệu advisory. Nếu snapshot còn `Generated: not yet` hoặc `/context index` báo pending/stale, agent phải dừng trước task lớn và yêu cầu chạy `/onboard run`.
102
103
 
103
- `/memory-policy` kiểm tra chính sách memory của project. Mặc định memory là explicit-only: chỉ ghi khi user yêu cầu rõ “remember this”, không tự học transcript nền.
104
+ `/memory` kiểm tra chính sách memory của project. `/memory-policy` vẫn là alias. Mặc định memory là explicit-only: chỉ ghi khi user yêu cầu rõ “remember this”, không tự học transcript nền.
104
105
 
105
106
  ## Bước 4 — init thêm project khác
106
107
 
@@ -122,32 +123,33 @@ cd <project>
122
123
  pi --name "ABC-123 Short task name"
123
124
  ```
124
125
 
125
- Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Nếu quên đặt tên lúc mở Pi, gõ `/setname ABC-123 Short task name` trước khi làm tiếp; Agent Watch sẽ dùng tên session này trong report. Không cần paste checklist — input guard tự collapse boilerplate, và `/task` tự cân nhắc gọi scout/planner/reviewer khi task đủ lớn.
126
+ Rồi mô tả việc cần làm bằng tiếng Việt hoặc tiếng Anh. Nếu quên đặt tên lúc mở Pi, gõ `/name ABC-123 Short task name` hoặc alias ngắn `/setname ABC-123 Short task name` trước khi làm tiếp; Agent Watch sẽ dùng tên session này trong report. Không cần paste checklist — input guard tự collapse boilerplate, và `/workflow task` tự cân nhắc gọi scout/planner/reviewer khi task đủ lớn.
126
127
 
127
128
  Muốn chạy nhiều agent song song thì gõ `herdr` thay vì `pi`, rồi mở mỗi pane một vai: implement, review read-only, verify, notes. Herdr chỉ điều phối terminal/session, không phải security boundary — gate vẫn nằm ở Pi extension và OAuth vẫn `/login` trong Pi. Chi tiết: [herdr-workflow.md](herdr-workflow.md).
128
129
 
129
130
  | Gõ | Khi nào |
130
131
  |---|---|
131
- | `/discuss <ý tưởng>` | Requirement chưa rõ, muốn hỏi lại trước. |
132
- | `/task <việc>` | Đã rõ, làm luôn. |
133
- | `/scout <việc>` | Chỉ đọc, không sửa — map payment/auth/BE contract. |
134
- | `/plan <mục tiêu>` | Muốn có plan trước khi đụng code. |
135
- | `/review current diff` | Review việc vừa làm. |
136
- | `/setname <task/session name>` | Đặt/đổi tên session để resume và report dễ đối chiếu. |
137
- | `/piagent-logs` | Xem các capture khi test/build output quá dài và Pi chỉ hiện preview. |
138
- | `/be-to-fe <việc>` | Backend read-only, làm FE. |
139
- | `/commit <message>` | Commit local có kiểm soát, không push. |
140
- | `/pr <title>` | Tạo PR, hỏi xác nhận trước khi push. |
141
- | `/fresh-task`, `/fresh-scout`, `/fresh-be-to-fe` | Session đang nặng hoặc tràn context. |
142
-
143
- `/piagent-commands` liệt kê hết. Giải thích từng lệnh: [command-reference-vietnamese.md](command-reference-vietnamese.md). Các workflow ép shape rõ (`/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`): [subagents-and-multiagent.md](subagents-and-multiagent.md). Runtime gate tools và cách agent tự dùng chúng: [operator-manual-vietnamese.md](operator-manual-vietnamese.md).
132
+ | `/workflow` | Mở menu chọn task/scout/review/git/onboard. |
133
+ | `/workflow discuss <ý tưởng>` | Requirement chưa rõ, muốn hỏi lại trước. |
134
+ | `/workflow task <việc>` | Đã rõ, làm luôn. |
135
+ | `/workflow scout <việc>` | Chỉ đọc, không sửa — map payment/auth/BE contract. |
136
+ | `/workflow plan <mục tiêu>` | Muốn có plan trước khi đụng code. |
137
+ | `/workflow review current diff` | Review việc vừa làm. |
138
+ | `/name <task/session name>` | Đặt/đổi tên session để resume và report dễ đối chiếu. |
139
+ | `/usage logs` | Xem các capture khi test/build output quá dài và Pi chỉ hiện preview. |
140
+ | `/workflow be-to-fe <việc>` | Backend read-only, làm FE. |
141
+ | `/workflow commit <message>` | Commit local có kiểm soát, không push. |
142
+ | `/workflow pr <title>` | Tạo PR, hỏi xác nhận trước khi push. |
143
+ | `/fresh task|scout|be-to-fe <việc>` | Session đang nặng hoặc tràn context. |
144
+
145
+ `/commands` liệt kê hết. Các alias cũ như `/task`, `/scout`, `/be-to-fe`, `/fresh-task`, `/context-index`, `/logs` vẫn chạy nhưng không còn là đường onboard chính. Giải thích từng lệnh: [command-reference-vietnamese.md](command-reference-vietnamese.md). Các workflow ép shape rõ (`/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`): [subagents-and-multiagent.md](subagents-and-multiagent.md). Runtime gate tools và cách agent tự dùng chúng: [operator-manual-vietnamese.md](operator-manual-vietnamese.md).
144
146
 
145
147
  ## Việc user vẫn phải làm thủ công
146
148
 
147
149
  - Login OAuth lần đầu trong browser.
148
150
  - Chọn provider/model intended cho project.
149
- - Chạy `/onboard-project` lần đầu để tạo `.pi/project-context.md` và `.pi/context-index.json`.
150
- - Chạy `/memory-policy` nếu muốn kiểm tra hoặc dùng project memory.
151
+ - Chạy `/onboard run` lần đầu để tạo `.pi/project-context.md` và `.pi/context-index.json`.
152
+ - Chạy `/memory` nếu muốn kiểm tra hoặc dùng project memory.
151
153
  - Approve project trust nếu Pi hỏi. Sau khi hiểu rõ repo, có thể dùng `piagent-auto` hoặc Pi native `--approve` cho từng lần chạy.
152
154
  - Approve khi extension guard hỏi destructive/high-risk action.
153
155
 
@@ -10,7 +10,7 @@ This file is the canonical install, update, rollback, and release checklist. Oth
10
10
 
11
11
  All supported environments require Node.js `>=22.19.0` and Pi Coding Agent `0.82.0`. The Pi host is installed as a Node CLI; Pi Agent Platform still defines its own release matrix because the terminal helpers and shell policy rely on Bash/POSIX behavior.
12
12
 
13
- | Surface | Status for v1.2.2 | Rollout guidance |
13
+ | Surface | Status for v1.2.4 | Rollout guidance |
14
14
  |---|---|---|
15
15
  | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. | Safe default for team rollout after normal project smoke tests. |
16
16
  | Linux x64 + Bash | Verified in GitHub Actions. | Safe default for CI/server usage after normal project smoke tests. |
@@ -33,7 +33,7 @@ These three components are versioned independently. A full install, update, or r
33
33
 
34
34
  | Channel | Source shape | Mutability | Use when |
35
35
  |---|---|---:|---|
36
- | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.2` | Fixed after resolution | Default for team rollout. |
36
+ | `stable` | `git:github.com/Vt-mmm/piagent@<resolved-commit-sha>` from `v1.2.4` | Fixed after resolution | Default for team rollout. |
37
37
  | `exact` | Tag, reviewed commit, or a tag resolved with `--resolve-tag` | Fixed when using a commit SHA | Pi-package-only roll forward, rollback, or reproduction. |
38
38
  | `dev` | `git:github.com/Vt-mmm/piagent` | Moving | Personal machine or sandbox only. |
39
39
  | `local` | `/path/to/piagent` | Local workspace | Platform development and dry-run validation. |
@@ -53,7 +53,7 @@ Use this flow when the team needs both terminal commands and the Pi package:
53
53
  ```bash
54
54
  node --version # >= 22.19.0
55
55
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
56
- npm install -g --ignore-scripts @piagent/platform@1.2.2
56
+ npm install -g --ignore-scripts @piagent/platform@1.2.4
57
57
  piagent-install --stable --dry-run
58
58
  piagent-install --stable
59
59
  ```
@@ -61,8 +61,8 @@ piagent-install --stable
61
61
  The stable preview and apply output includes:
62
62
 
63
63
  ```text
64
- currentRelease: v1.2.2 (helper package version)
65
- tag: v1.2.2
64
+ currentRelease: v1.2.4 (helper package version)
65
+ tag: v1.2.4
66
66
  resolvedCommit: <40-char-sha>
67
67
  source: git:github.com/Vt-mmm/piagent@<40-char-sha>
68
68
  ```
@@ -79,7 +79,7 @@ bash scripts/install-global.sh --stable
79
79
  Use this only when terminal commands are not needed:
80
80
 
81
81
  ```bash
82
- pi install git:github.com/Vt-mmm/piagent@v1.2.2
82
+ pi install git:github.com/Vt-mmm/piagent@v1.2.4
83
83
  ```
84
84
 
85
85
  Direct `pi install` does not create `piagent-*` commands on `PATH`.
@@ -91,11 +91,27 @@ Direct `pi install` does not create `piagent-*` commands on `PATH`.
91
91
  ```bash
92
92
  piagent-update --check
93
93
  piagent-update --dry-run
94
- piagent-update --project /path/to/project
94
+ piagent-update --version X.Y.Z
95
95
  ```
96
96
 
97
97
  It resolves the target helper version and, from that version's published metadata, the exact Pi host that version pins — both before installing anything, so `--check` and `--dry-run` describe a real run. It then installs the host, replaces the helper, verifies that the version now on disk is the one it asked for, and only then runs the new helper's installer for the Pi package. `--version X.Y.Z` targets an exact release instead of latest, `--no-host` and `--no-package` narrow the run, and anything after `--` is passed to `piagent-install`.
98
98
 
99
+ Project migration and doctor are post-update checks, not the update scope. Run them only for the project being verified:
100
+
101
+ ```bash
102
+ piagent-update --version X.Y.Z --project /path/to/project
103
+ ```
104
+
105
+ With `--project`, the updater migrates legacy project state if needed and runs `piagent-doctor --strict-share`; use `--no-migrate` only when debugging a migration.
106
+
107
+ If the machine's default npm global prefix is locked by the OS, for example `/usr/local/lib/node_modules`, the updater uses `~/.pi/npm-global` for this rollout and prints the `PATH` line to add later. Do not run project update/doctor as root, because that can leave project files owned by root. Maintainers can force a specific prefix with `--npm-prefix <path>`.
108
+
109
+ For a fresh machine that does not have `piagent-update` yet, bootstrap the same all-in-one flow without opening Pi:
110
+
111
+ ```bash
112
+ npm exec -y --package @piagent/platform@X.Y.Z -- piagent-update --version X.Y.Z --force
113
+ ```
114
+
99
115
  Running it from a git checkout is refused rather than replacing that checkout's commands with a published build; update a checkout with `git pull` and `install-global.sh --local`.
100
116
 
101
117
  The same sequence by hand, which must keep this order because `piagent-install` fails against a host that does not match the version it pins and does not install one itself:
@@ -24,7 +24,7 @@ Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecy
24
24
  |---|---|---|
25
25
  | Risk lane | `riskLane` + profile `hardGates` | Chặn auth, release, provider config, destructive action, database migration. |
26
26
  | Intake | `piagent_task_start` | Mỗi task có scope, output, acceptance criteria trước khi edit. |
27
- | Context rules | `/onboard-project`, `.pi/project-context.md`, `requiredContext`, context manifest | Giảm token và tránh đọc toàn repo. |
27
+ | Context rules | `/onboard run`, `.pi/project-context.md`, `requiredContext`, context manifest | Giảm token và tránh đọc toàn repo. |
28
28
  | Test matrix | `verifyCommands` + observed verify evidence | DONE phải có exact verify command thực chạy qua Pi bash hoặc `N/A` rõ lý do. |
29
29
  | Trace | `piagent_trace_record`, `.pi/piagent-state/traces.jsonl`, session entry | Có audit trail cho task. |
30
30
  | Protected paths | `protectedPaths` trong profile + extension guard | Mỗi project có vùng cấm riêng. |
@@ -43,12 +43,12 @@ Project cụ thể chỉ cần adapter/profile riêng. Core package giữ lifecy
43
43
 
44
44
  ## Workflow prompts
45
45
 
46
- - `/platform-improve`: update package/platform behavior.
47
- - `/be-to-fe`: scout backend/spec read-only, create contract snapshot, implement frontend only.
48
- - `/task`: governed implementation lifecycle.
49
- - `/plan`: create implementation plan.
50
- - `/discuss`: clarify before work.
51
- - `/review`: review diff/source with evidence.
46
+ - `/workflow platform-improve`: update package/platform behavior.
47
+ - `/workflow be-to-fe`: scout backend/spec read-only, create contract snapshot, implement frontend only.
48
+ - `/workflow task`: governed implementation lifecycle.
49
+ - `/workflow plan`: create implementation plan.
50
+ - `/workflow discuss`: clarify before work.
51
+ - `/workflow review`: review diff/source with evidence.
52
52
 
53
53
  ## Task lifecycle chuẩn
54
54
 
@@ -73,7 +73,7 @@ The runtime separates the active autonomy profile from the project profile:
73
73
  | `workspace-write` | Default governed implementation mode. Existing protected-path, shell, capability, context, verify, and final gates remain active. |
74
74
  | `trusted-full-access` | Trusted automation mode for known repos. It can relax tool-registry blocks and capability filesystem scopes inside the guard, but protected paths, secret redaction, capability-lock integrity, and destructive/external confirmation still apply. |
75
75
 
76
- `PIAGENT_PERMISSION_PROFILE` can override the profile for a single run. Invalid values fail closed to `read-only`. Inside Pi, `/read-only`, `/workspace-write`, and `/full-access` set a session-local override without writing the project profile. Precedence is launch env, then session command, then project profile, then policy default. `permissionProfiles.allowedModes` in base policy acts like a managed allowlist; removing `trusted-full-access` from that list disables it for the installation.
76
+ `PIAGENT_PERMISSION_PROFILE` can override the profile for a single run. Invalid values fail closed to `read-only`. Inside Pi, `/permission read-only`, `/permission workspace-write`, and `/permission full-access` set a session-local override without writing the project profile. Legacy aliases `/read-only`, `/workspace-write`, and `/full-access` still work. Precedence is launch env, then session command, then project profile, then policy default. `permissionProfiles.allowedModes` in base policy acts like a managed allowlist; removing `trusted-full-access` from that list disables it for the installation.
77
77
 
78
78
  ## Task lifecycle
79
79
 
@@ -29,7 +29,7 @@ Runtime behavior:
29
29
  - `read-only` chặn shell, write/edit, và unknown non-piagent tools;
30
30
  - `workspace-write` là default cho implementation có guard;
31
31
  - `trusted-full-access` nới tool/scope autonomy trong môi trường trusted nhưng không tắt protected paths, redaction, capability lock, hoặc human gate cho destructive/external action.
32
- - `/full-access <task>` bật `trusted-full-access` cho session hiện tại rồi gửi phần task còn lại cho agent; `/permission-status` hiển thị mode và boundary đang active.
32
+ - `/permission full-access <task>` bật `trusted-full-access` cho session hiện tại rồi gửi phần task còn lại cho agent; `/permission status` hiển thị mode và boundary đang active. Alias `/full-access <task>` và `/permission-status` vẫn chạy.
33
33
 
34
34
  ## 1. Exec policy
35
35
 
@@ -21,7 +21,7 @@ This document covers the packaged guard, project profiles, capability locks, ins
21
21
  - The operator, operating-system account, Pi host, and explicitly trusted project repository are trusted to execute code.
22
22
  - Project-local Pi resources are loaded only after Pi project trust or an explicit operator override.
23
23
  - A human remains available to approve destructive and external-provider actions.
24
- - Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.2, and WSL2 is experimental/unverified.
24
+ - Supported release verification covers macOS Apple Silicon + Bash, Linux x64 + Bash, Node.js `>=22.19.0`, and the exact Pi host version declared by the release. macOS Intel + Bash and Linux ARM64 + Bash are supported targets that need local smoke verification before broad rollout. Native Windows is not a team-rollout target for v1.2.4, and WSL2 is experimental/unverified.
25
25
  - Registry, GitHub, model-provider, MCP-provider, and Vercel controls are external dependencies. Their account security and platform guarantees are not replaced by this repository.
26
26
 
27
27
  ## Threat actors and failure modes
@@ -9,7 +9,7 @@ Package used:
9
9
 
10
10
  ## Kết luận
11
11
 
12
- Pi Agent Platform uses `pi-subagents` for child sessions, parallel read-only work, review loops, and structured handoffs. The platform keeps a safe default configuration and documents advanced commands separately so daily users can still start with `/task`.
12
+ Pi Agent Platform uses `pi-subagents` for child sessions, parallel read-only work, review loops, and structured handoffs. The platform keeps a safe default configuration and documents advanced commands separately so daily users can still start with `/workflow task`.
13
13
 
14
14
  Core decisions:
15
15
 
@@ -44,7 +44,7 @@ Core decisions:
44
44
  - `scripts/setup.sh` / `scripts/install-global.sh`
45
45
  - optional `--with-web-access` installs `npm:pi-web-access@0.13.0` for web/docs research
46
46
  - Workflow prompts
47
- - `/task`, `/plan`, `/review`, `/be-to-fe`, `/platform-improve` instruct the parent to auto-delegate when work is independent and bounded
47
+ - `/workflow task`, `/workflow plan`, `/workflow review`, `/workflow be-to-fe`, `/workflow platform-improve` instruct the parent to auto-delegate when work is independent and bounded
48
48
  - Docs
49
49
  - command reference lists prompt shortcuts, watchdog/profile commands, supervisor control, output/fork/worktree options
50
50
 
@@ -63,7 +63,7 @@ Core decisions:
63
63
  Daily implementation:
64
64
 
65
65
  ```text
66
- /task Implement <task>.
66
+ /workflow task Implement <task>.
67
67
  ```
68
68
 
69
69
  Review until clean:
@@ -18,7 +18,7 @@ Pi core không có subagents built-in. Theo design của Pi, subagents là exten
18
18
 
19
19
  Từ `v0.3.7`, `scripts/setup.sh` mặc định cài `pi-subagents` và chạy config preset `safe`.
20
20
 
21
- Workflow prompts của platform dùng **solo-first orchestration policy**: khi anh chạy `/task`, `/be-to-fe`, `/platform-improve`, `/plan`, hoặc `/review`, parent agent đọc `piagent_orchestration_policy`, lập task tree/review lenses, rồi mới cân nhắc subagent cho phần việc độc lập. Anh không bắt buộc phải gọi `/run` nếu chỉ muốn task hoàn chỉnh, và platform cũng không spawn swarm khi task nhỏ.
21
+ Workflow prompts của platform dùng **solo-first orchestration policy**: khi anh chạy `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, hoặc `/workflow review`, parent agent đọc `piagent_orchestration_policy`, lập task tree/review lenses, rồi mới cân nhắc subagent cho phần việc độc lập. Anh không bắt buộc phải gọi `/run` nếu chỉ muốn task hoàn chỉnh, và platform cũng không spawn swarm khi task nhỏ. Alias cũ như `/task` vẫn giữ cùng policy.
22
22
 
23
23
  Kiểm tra nhanh policy trong Pi:
24
24
 
@@ -129,7 +129,7 @@ Giải nghĩa nhanh:
129
129
  Nếu cần bản tổng hợp cho team mới:
130
130
 
131
131
  ```text
132
- /piagent-commands subagents
132
+ /commands subagents
133
133
  ```
134
134
 
135
135
  ## Gọi subagent tự nhiên
@@ -149,7 +149,7 @@ Run parallel research: external docs, local code context, and practical tradeoff
149
149
  Với workflow platform, còn có thể chỉ gọi:
150
150
 
151
151
  ```text
152
- /task Implement <task lớn>.
152
+ /workflow task Implement <task lớn>.
153
153
  ```
154
154
 
155
155
  Parent agent sẽ tự quyết định:
@@ -324,7 +324,7 @@ Use:
324
324
 
325
325
  ```text
326
326
  /subagent-cost
327
- /piagent-usage
327
+ /usage
328
328
  /session
329
329
  ```
330
330
 
@@ -131,7 +131,7 @@ Use piagent_context first.
131
131
  Use piagent_orchestration_policy; default to solo-first, create a compact task tree, and choose review lenses before spawning subagents.
132
132
  Use piagent_context_index_status/search as advisory navigation when available; verify cited files before editing.
133
133
  Use piagent_memory_status and search memory when relevant; memory is advisory only.
134
- Read .pi/project-context.md; if it is pending, stop and request /onboard-project.
134
+ Read .pi/project-context.md; if it is pending, stop and request /onboard run.
135
135
  Create a Task Implementation Contract with piagent_task_start.
136
136
  Check large context with piagent_context_budget.
137
137
  Check complex/high-impact shell with piagent_exec_policy_check.
@@ -193,8 +193,8 @@ Exact command identity matters. If the task profile says `npm test`, record `npm
193
193
 
194
194
  ## Named implementation recipes
195
195
 
196
- - `/platform-improve`: dùng cho task cải tiến setup, docs, prompt, MCP, model, memory, runtime policy, hoặc subagent workflow của platform.
197
- - `/be-to-fe`: dùng cho task scout BE contract read-only rồi implement FE.
198
- - `/memory-policy`: dùng cho task kiểm tra/ghi nhớ explicit project memory.
196
+ - `/workflow platform-improve`: dùng cho task cải tiến setup, docs, prompt, MCP, model, memory, runtime policy, hoặc subagent workflow của platform.
197
+ - `/workflow be-to-fe`: dùng cho task scout BE contract read-only rồi implement FE.
198
+ - `/memory`: dùng cho task kiểm tra/ghi nhớ explicit project memory.
199
199
 
200
200
  Hai recipe này vẫn phải tạo/giữ Task Implementation Contract khi có source writes.
@@ -14,7 +14,7 @@ Contract fields và enforcement level nằm ở [task-implementation-contract.md
14
14
 
15
15
  Harness cung cấp:
16
16
 
17
- - `/scout` — pha read-only, không được sửa source. Dùng để map payment/auth/BE contract trước khi quyết có làm hay không.
17
+ - `/workflow scout` — pha read-only, không được sửa source. Dùng để map payment/auth/BE contract trước khi quyết có làm hay không. Alias `/scout` vẫn chạy.
18
18
  - `piagent_context_index_search` — bản đồ node/edge/citation compact để tìm điểm vào repo. Kết quả là **advisory**: phải mở file thật và verify trước khi sửa.
19
19
  - `piagent_memory_search` + `piagent_memory_citation_record` — Field Guide và memory của project, cũng advisory, cũng phải verify lại.
20
20
  - `piagent_source_checkout` — cache repo ngoài để đọc có mục tiêu.
@@ -82,7 +82,7 @@ Nghĩa là `true`, `echo ok`, `npm test || true` không mua được chữ "done
82
82
 
83
83
  | Pha | Trạng thái | Căn cứ |
84
84
  |---|---|---|
85
- | Research | **Đủ** | `/scout`, context index, memory, Context7, source checkout |
85
+ | Research | **Đủ** | `/workflow scout`, context index, memory, Context7, source checkout |
86
86
  | Plan | **Đủ** | `piagent_task_start` + 19 field contract + `workPlan` |
87
87
  | Execute | **Đủ** | Chặn trước thực thi ở mọi đường: tool, MCP, shell |
88
88
  | Verify | **Mạnh** | Bằng chứng phải quan sát được và khớp lệnh, không tự khai được |
@@ -9,7 +9,7 @@ Một thành viên mới không cần biết local path của maintainer. Luồn
9
9
  ```bash
10
10
  node --version # >= 22.19.0
11
11
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
12
- npm install -g --ignore-scripts @piagent/platform@1.2.2
12
+ npm install -g --ignore-scripts @piagent/platform@1.2.4
13
13
  piagent-install --stable
14
14
  cd /path/to/project
15
15
  pi
@@ -17,8 +17,9 @@ pi
17
17
  <select provider/model>
18
18
  /mcp
19
19
  /subagents-doctor
20
- /onboard-project
21
- /memory-policy
20
+ /onboard
21
+ /onboard run
22
+ /memory
22
23
  ```
23
24
 
24
25
  ## Prerequisites
@@ -42,7 +43,7 @@ Mặc định team dùng stable helper:
42
43
  ```bash
43
44
  node --version # >= 22.19.0
44
45
  npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0
45
- npm install -g --ignore-scripts @piagent/platform@1.2.2
46
+ npm install -g --ignore-scripts @piagent/platform@1.2.4
46
47
  piagent-install --stable --dry-run
47
48
  piagent-install --stable
48
49
  ```
@@ -67,10 +68,26 @@ Một lệnh, đúng thứ tự, cho cả ba thành phần:
67
68
 
68
69
  ```bash
69
70
  piagent-update --check
70
- piagent-update --project /path/to/project
71
+ piagent-update --version X.Y.Z
71
72
  ```
72
73
 
73
- `--check` chỉ báo version, không đụng gì. Lên đúng một bản cụ thể thì `piagent-update --version 1.2.2`.
74
+ Chạy từ Terminal, không cần mở Pi và không cần đứng trong project. Đây là update global cho cả máy: Pi host, npm-global helper, và Pi package.
75
+
76
+ Khi cần kiểm tra một project sau rollout, chạy riêng:
77
+
78
+ ```bash
79
+ piagent-update --version X.Y.Z --project /path/to/project
80
+ ```
81
+
82
+ `--project` là bước phụ: tự migrate layout cũ nếu có rồi chạy doctor strict-share. `--check` chỉ báo version, không đụng gì.
83
+
84
+ Nếu npm global mặc định của máy bị khóa quyền ở `/usr/local`, updater tự chuyển sang `~/.pi/npm-global` cho user hiện tại và in dòng `PATH` cần thêm. Không chạy doctor bằng `sudo`.
85
+
86
+ Máy mới chưa có `piagent-update` dùng một dòng bootstrap này:
87
+
88
+ ```bash
89
+ npm exec -y --package @piagent/platform@X.Y.Z -- piagent-update --version X.Y.Z --force
90
+ ```
74
91
 
75
92
  Không cần ai nhớ đi kiểm tra: khi có release mới, Pi tự báo ngay ở dòng notice lúc mở session, kèm luôn lệnh chạy.
76
93
 
@@ -148,7 +165,8 @@ Rồi chạy:
148
165
  ```text
149
166
  /mcp
150
167
  /subagents-doctor
151
- /onboard-project
168
+ /onboard
169
+ /onboard run
152
170
  ```
153
171
 
154
172
  Output chính:
@@ -177,9 +195,9 @@ Nếu project chưa có profile/tech stack, dùng select-style flow để tránh
177
195
 
178
196
  `fullstack` bắt chọn frontend, backend và database. Nếu native select chưa có trong Pi host, command trả card compact kèm lệnh deterministic `/profile tech apply ...`.
179
197
 
180
- Nếu `.pi/project-context.md` còn `Generated: not yet`, không nên chạy `/task` implementation.
198
+ Nếu `.pi/project-context.md` còn `Generated: not yet`, không nên chạy `/workflow task` implementation.
181
199
 
182
- Memory mặc định là project-scoped và explicit-only. Chạy `/memory-policy` để xem files/rules. Agent chỉ ghi durable memory khi user yêu cầu rõ ràng.
200
+ Memory mặc định là project-scoped và explicit-only. Chạy `/memory` để xem files/rules. `/memory-policy` vẫn là alias. Agent chỉ ghi durable memory khi user yêu cầu rõ ràng.
183
201
 
184
202
  Đổi profile sau này:
185
203
 
@@ -268,31 +286,33 @@ Lệnh này wrap `pi --approve`; nó không bypass piagent guard.
268
286
  Requirement chưa rõ:
269
287
 
270
288
  ```text
271
- /discuss Tạo plan cho feature X. Chưa implement.
289
+ /workflow discuss Tạo plan cho feature X. Chưa implement.
272
290
  ```
273
291
 
274
292
  Task rõ:
275
293
 
276
294
  ```text
277
- /task Implement feature X. Follow project profile, protected paths, required context, exec policy, context budget, tool policy, verify, trace, and task gate.
295
+ /workflow task Implement feature X. Follow project profile, protected paths, required context, exec policy, context budget, tool policy, verify, trace, and task gate.
278
296
  ```
279
297
 
280
298
  Scout/audit read-only:
281
299
 
282
300
  ```text
283
- /scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
301
+ /workflow scout Scout payment FE mapping vs BE contract. Backend read-only. Do not edit source.
284
302
  ```
285
303
 
286
304
  Session nặng hoặc context overflow:
287
305
 
288
306
  ```text
289
- /fresh-scout <read-only scout>
290
- /fresh-task <bounded task>
291
- /fresh-be-to-fe <BE-readonly/FE request>
307
+ /fresh scout <read-only scout>
308
+ /fresh task <bounded task>
309
+ /fresh be-to-fe <BE-readonly/FE request>
292
310
  ```
293
311
 
294
312
  Không paste full mandatory flow hằng ngày. Platform prompts/tools đã chứa checklist; input guard sẽ tự collapse boilerplate nếu paste nhầm.
295
313
 
314
+ Alias cũ `/discuss`, `/task`, `/scout`, `/fresh-*` vẫn chạy cho power user, nhưng tài liệu onboard team dùng `/workflow`, `/name`, `/fresh`, và `/usage` để dễ nhớ hơn.
315
+
296
316
  Runtime gate tools:
297
317
 
298
318
  ```text
@@ -305,19 +325,19 @@ piagent_task_gate_check
305
325
  Task cải tiến platform:
306
326
 
307
327
  ```text
308
- /platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage.
328
+ /workflow platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage.
309
329
  ```
310
330
 
311
331
  Task BE spec lên FE:
312
332
 
313
333
  ```text
314
- /be-to-fe Implement FE from BE contract <endpoint/spec>. Backend is read-only.
334
+ /workflow be-to-fe Implement FE from BE contract <endpoint/spec>. Backend is read-only.
315
335
  ```
316
336
 
317
337
  Project memory:
318
338
 
319
339
  ```text
320
- /memory-policy
340
+ /memory
321
341
  Remember: this repo uses pnpm, never npm.
322
342
  ```
323
343
 
@@ -343,7 +363,7 @@ bash /path/to/piagent/scripts/team-doctor.sh /path/to/project --strict-share
343
363
  bash /path/to/piagent/scripts/quality-benchmark.sh /path/to/project --init
344
364
  ```
345
365
 
346
- Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và chạy `/onboard-project`.
366
+ Nếu doctor cảnh báo `project onboarding snapshot is still pending`, mở Pi trong project và chạy `/onboard run`.
347
367
 
348
368
  ## Không commit
349
369