@piagent/platform 1.2.1 → 1.2.3

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 (72) hide show
  1. package/CHANGELOG.md +34 -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 +121 -81
  6. package/docs/context-window-policy.md +7 -6
  7. package/docs/distribution-standard.md +27 -10
  8. package/docs/herdr-workflow.md +3 -2
  9. package/docs/memory-policy.md +6 -3
  10. package/docs/operator-manual-vietnamese.md +107 -69
  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 -1
  15. package/docs/quickstart-vietnamese.md +26 -22
  16. package/docs/release-install-policy.md +6 -6
  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 +22 -18
  26. package/docs/usage-observability.md +29 -8
  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 +28 -26
  50. package/packages/piagent-core/extensions/piagent-guard.ts +1416 -196
  51. package/packages/piagent-core/package.json +1 -1
  52. package/packages/piagent-core/prompts/be-to-fe.md +4 -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 +2 -1
  56. package/packages/piagent-core/prompts/pr.md +1 -1
  57. package/packages/piagent-core/prompts/review.md +2 -1
  58. package/packages/piagent-core/prompts/scout.md +3 -2
  59. package/packages/piagent-core/prompts/task.md +3 -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/verify-local.sh +18 -17
  66. package/templates/project/.pi/context-index.json +2 -2
  67. package/templates/project/.pi/project-context.md +3 -3
  68. package/templates/project/AGENTS.md +4 -4
  69. package/packages/piagent-core/prompts/memory-policy.md +0 -52
  70. package/packages/piagent-core/prompts/model-options.md +0 -68
  71. package/packages/piagent-core/prompts/onboard-project.md +0 -147
  72. package/packages/piagent-core/prompts/piagent-commands.md +0 -68
package/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  This file records release-facing changes for Pi Agent Platform. Copy the relevant version block into GitHub Releases when publishing a tag.
4
4
 
5
+ ## v1.2.3 - 2026-07-30
6
+
7
+ ### Added
8
+
9
+ - Added short runtime command namespaces for team use: `/commands`, `/usage`, `/context`, `/permission`, `/memory`, `/onboard`, `/name`, and `/fresh`.
10
+
11
+ - Added a compatibility rewrite for `/piagent-workflow` so older muscle memory routes to `/workflow` instead of becoming a normal agent prompt.
12
+
13
+ ### Changed
14
+
15
+ - Consolidated workflow launchers under `/workflow ...` and fresh-session launches under `/fresh task|scout|be-to-fe ...`, reducing accidental scout/log chatter before a user reaches the menu.
16
+
17
+ - Updated onboarding, quickstart, operator, deployment, and docs-site command references to separate Pi native commands from PiAgent runtime commands. Pi native `/model`, `/session`, `/resume`, `/compact`, and `/mcp` remain unclaimed by PiAgent.
18
+
19
+ ### Removed
20
+
21
+ - Removed prompt-file versions of runtime help commands that should execute locally rather than asking the agent to inspect docs.
22
+
23
+ ## v1.2.2 - 2026-07-29
24
+
25
+ ### Added
26
+
27
+ - Added compact tool-result rendering for oversized Pi outputs. Small results still pass through unchanged; large redacted outputs now show a bounded preview in Pi and are captured under `.pi/piagent-state/tool-results/` with an `index.jsonl` for offline Agent Watch/reporting.
28
+
29
+ - Added `/piagent-logs`, a local slash command that shows the compact-log policy and recent oversized output captures without calling the model or tailing logs in realtime.
30
+
31
+ - Added `/setname <task/session name>` so an already-open Pi session can be renamed for resume lists, Agent Watch mapping, and weekly reports without restarting Pi.
32
+
33
+ ### Changed
34
+
35
+ - `/piagent-usage` and `/task-preflight` now render concise status lines instead of long markdown reports while keeping structured details available to the runtime.
36
+
37
+ - Workflow prompts and Vietnamese operator docs now tell agents and team members to summarize verify/build failures, quote only relevant lines, and use `/piagent-logs` or narrower commands instead of pasting full terminal dumps into the session.
38
+
5
39
  ## v1.2.1 - 2026-07-28
6
40
 
7
41
  ### Fixed
package/README.md CHANGED
@@ -48,9 +48,9 @@ That is the daily flow. Pi onboards the project, selects an operating profile, u
48
48
 
49
49
  Running several agents side by side — one implementing, one reviewing read-only, one verifying — start `herdr` from the project instead of `pi` and open a Pi pane per role. Herdr orchestrates terminals and sessions; it is not a security boundary, so every gate still lives in the Pi extension and OAuth is still a `/login` inside Pi. See [Herdr workflow](docs/herdr-workflow.md).
50
50
 
51
- First run in a new project, type `/onboard-project`. It inspects the repository with bounded context, recommends a profile, explains the tradeoffs, asks before applying, then writes `.pi/piagent-profile.json`, its lock, `.pi/tech-stack.json`, `.pi/tech-context/*`, `.pi/project-context.md`, and `.pi/memory/*`.
51
+ First run in a new project, type `/onboard` and choose the run action, or type `/onboard run`. It launches the bounded onboarding workflow, recommends a profile, explains the tradeoffs, asks before applying, then writes `.pi/piagent-profile.json`, its lock, `.pi/tech-stack.json`, `.pi/tech-context/*`, `.pi/project-context.md`, and `.pi/memory/*`.
52
52
 
53
- `/piagent-commands` lists everything else. For trusted local runs, `piagent-auto` wraps `pi --approve` and sets a permission profile for that run — it does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence. See the [command reference](docs/command-reference-vietnamese.md).
53
+ `/commands` lists everything else. For trusted local runs, `piagent-auto` wraps `pi --approve` and sets a permission profile for that run — it does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence. See the [command reference](docs/command-reference-vietnamese.md).
54
54
 
55
55
  ## Uninstall
56
56
 
@@ -67,11 +67,14 @@ Removal targets what is registered in Pi's settings rather than what the current
67
67
 
68
68
  ## What it provides
69
69
 
70
- - Global Pi package with prompts, skills, guard extensions, and piagent subagents.
71
- - Runtime onboarding via `/onboard-project`.
70
+ - Global Pi package with workflow prompts, runtime commands, skills, guard extensions, and piagent subagents.
71
+ - Runtime command menu via `/commands`.
72
+ - Workflow launcher via `/workflow` for task, scout, BE-to-FE, review, git, and onboarding work.
73
+ - Runtime onboarding via `/onboard`; `/onboard run` launches the first-read onboarding workflow.
72
74
  - Runtime profile selection via `/profile`, plus select-style tech stack setup via `/profile setup` and `/profile tech`.
73
- - Explicit project memory via `/memory-policy` and `piagent_memory_*` tools.
74
- - Compact project context index via `/context-index` and `piagent_context_index_*` tools. This is an advisory navigation graph, not a security boundary or source of truth.
75
+ - Runtime usage/session controls via `/usage`, `/name`, `/fresh`, plus Pi native `/session`.
76
+ - Explicit project memory via `/memory` or `/memory-policy` and `piagent_memory_*` tools.
77
+ - Compact project context controls via `/context` or `/context index` and `piagent_context_index_*` tools. This is an advisory navigation graph, not a security boundary or source of truth.
75
78
  - MCP setup helpers for Context7, Chrome DevTools, GitHub, Playwright, and Figma.
76
79
  - Subagent setup helpers for read-only scouting, planning, implementation, review, and risk challenge.
77
80
  - Chat image-path intake: paste a local screenshot path into the Pi chat box and the guard attaches it as `[image1]` before the model sees the prompt.
@@ -103,17 +106,18 @@ Project profiles can declare a runtime `permissionProfile`:
103
106
 
104
107
  For one run, set `PIAGENT_PERMISSION_PROFILE=read-only|workspace-write|trusted-full-access`, or use `piagent-auto --read-only`, `--workspace-write`, or `--full-access`.
105
108
 
106
- Inside an active Pi session, use slash commands for a session-local switch:
109
+ Inside an active Pi session, use `/permission` for the menu or a session-local switch:
107
110
 
108
111
  ```text
109
- /permission-status
110
- /read-only
111
- /workspace-write
112
- /full-access
113
- /full-access Implement the requested trusted repo task.
112
+ /permission
113
+ /permission status
114
+ /permission read-only
115
+ /permission workspace-write
116
+ /permission full-access
117
+ /permission full-access Implement the requested trusted repo task.
114
118
  ```
115
119
 
116
- `/full-access` also accepts a task after the command. The guard switches the current session to `trusted-full-access`, then forwards the remaining text as the next user request.
120
+ Legacy aliases still work: `/permission-status`, `/read-only`, `/workspace-write`, and `/full-access`. Full-access also accepts a task after the command. The guard switches the current session to `trusted-full-access`, then forwards the remaining text as the next user request.
117
121
 
118
122
  ## Solo-first orchestration
119
123
 
@@ -163,20 +167,23 @@ Commands and lock format: [Capability packs](docs/capability-packs.md).
163
167
 
164
168
  ## Main workflows
165
169
 
166
- Everything below is typed inside a Pi session. `/piagent-commands` lists the full set; [command reference](docs/command-reference-vietnamese.md) explains each one.
170
+ Everything below is typed inside a Pi session. `/commands` lists the full set; [command reference](docs/command-reference-vietnamese.md) explains each one. The recommended team surface is grouped by namespace so people do not need to remember many one-off commands.
167
171
 
168
172
  | Command | Use when |
169
173
  |---|---|
170
- | `/task <request>` | The requirement is clear enough to implement. |
171
- | `/scout <request>` | Read-only investigation — payment, auth, data, or backend-contract mapping — before deciding whether to implement. |
172
- | `/discuss <rough request>` | The requirement is not clear yet. |
173
- | `/plan <goal>` | You want a plan before any edit. |
174
- | `/review current diff` | Reviewing work already done. |
175
- | `/commit <message>` | Governed local commit: inspect status and diff, stage only the intended files, run verification, commit. Never pushes. |
176
- | `/pr <title>` | Governed pull request: confirms before any `git push` or GitHub write. Draft by default. |
177
- | `/be-to-fe <request>` | Backend or spec is read-only and the implementation target is frontend. Pair with `/profile be-readonly-fe`. |
178
- | `/platform-improve <request>` | Package-level work: setup, MCP, model scope, memory, runtime policy, prompts, skills, subagents. |
179
- | `/fresh-task`, `/fresh-scout`, `/fresh-be-to-fe` | The current session is already heavy. Opens a new governed session and replays the compact workflow prompt. |
174
+ | `/workflow` | Open the workflow picker. |
175
+ | `/workflow task <request>` | The requirement is clear enough to implement. |
176
+ | `/workflow scout <request>` | Read-only investigation — payment, auth, data, or backend-contract mapping — before deciding whether to implement. |
177
+ | `/workflow discuss <rough request>` | The requirement is not clear yet. |
178
+ | `/workflow plan <goal>` | You want a plan before any edit. |
179
+ | `/workflow review current diff` | Reviewing work already done. |
180
+ | `/workflow commit <message>` | Governed local commit: inspect status and diff, stage only the intended files, run verification, commit. Never pushes. |
181
+ | `/workflow pr <title>` | Governed pull request: confirms before any `git push` or GitHub write. Draft by default. |
182
+ | `/workflow be-to-fe <request>` | Backend or spec is read-only and the implementation target is frontend. Pair with `/profile be-readonly-fe`. |
183
+ | `/workflow platform-improve <request>` | Package-level work: setup, MCP, model scope, memory, runtime policy, prompts, skills, subagents. |
184
+ | `/fresh task|scout|be-to-fe <request>` | The current session is already heavy. Opens a new governed session and replays the compact workflow prompt. |
185
+
186
+ Short workflow aliases such as `/task`, `/scout`, `/be-to-fe`, `/commit`, and `/pr` still work for power users, but docs and onboarding teach `/workflow` as the default.
180
187
 
181
188
  Git stays a capability rather than a `/git-*` namespace, so natural language works too. Broad staging — `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` — requires confirmation, so unrelated or private files are not swept into a commit silently.
182
189
 
@@ -186,7 +193,7 @@ A spec that lives outside the project — the one just downloaded to `~/Download
186
193
 
187
194
  ## Model selection
188
195
 
189
- Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the scoped set, `Shift+Tab` to cycle thinking level where the model supports it. Global setup seeds `enabledModels`; see [Model options](docs/model-options.md) to inspect or re-apply it.
196
+ Handled by Pi's native UI: `/model` or `Ctrl+L` to pick, `Ctrl+P` to cycle the scoped set, `Shift+Tab` to cycle thinking level where the model supports it. Type `/model-options` for the current Piagent model/thinking guidance. Global setup seeds `enabledModels`; see [Model options](docs/model-options.md) to inspect or re-apply it.
190
197
 
191
198
  ## MCP setup
192
199
 
@@ -232,7 +239,7 @@ One command runs the full local gate — typecheck, tests, capability catalog, d
232
239
  npm run verify
233
240
  ```
234
241
 
235
- Individual checks and the contributor flow are in [CONTRIBUTING.md](CONTRIBUTING.md). Token and session follow-up is `/piagent-usage` inside Pi; see [Usage observability](docs/usage-observability.md). Comparing agent surfaces and models on the same scenarios: [Quality benchmark guide](docs/quality-benchmark.md).
242
+ Individual checks and the contributor flow are in [CONTRIBUTING.md](CONTRIBUTING.md). Token and session follow-up is `/usage` inside Pi; see [Usage observability](docs/usage-observability.md). Comparing agent surfaces and models on the same scenarios: [Quality benchmark guide](docs/quality-benchmark.md).
236
243
 
237
244
  ## Public safety
238
245
 
@@ -283,7 +290,7 @@ This repository intentionally excludes:
283
290
 
284
291
  ## Maturity
285
292
 
286
- The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.2.1` or a reviewed commit.
293
+ The current package version is read from package metadata and release tags. Personal machines may follow the unpinned package source when accepting ongoing updates; production/team quickstarts and committed project settings should pin an explicit tag such as `v1.2.3` or a reviewed commit.
287
294
 
288
295
  Ready for:
289
296
 
@@ -40,29 +40,29 @@
40
40
  "path": "packages/piagent-core/prompts/commit.md"
41
41
  },
42
42
  {
43
- "byteSize": 1601,
44
- "digest": "sha256:bd00d48ba9272a721f58b406944917e5f4a44162c621d722bb5e9c8528f87eb5",
43
+ "byteSize": 1605,
44
+ "digest": "sha256:1c2ae0893f131ca0c519f0954845f2b4a8e61182360aac245134102dc3324643",
45
45
  "id": "plan",
46
46
  "kind": "prompts",
47
47
  "path": "packages/piagent-core/prompts/plan.md"
48
48
  },
49
49
  {
50
- "byteSize": 1532,
51
- "digest": "sha256:bd66fccbdf9f1f9a518aab4b9bc9bb001f0ec3b0f35d52a64229dbd31d8dd8a0",
50
+ "byteSize": 1541,
51
+ "digest": "sha256:f80abb21bd621e941f2ff5b1e66f602e4f50692d5615c4507dc120e7daa232fd",
52
52
  "id": "pr",
53
53
  "kind": "prompts",
54
54
  "path": "packages/piagent-core/prompts/pr.md"
55
55
  },
56
56
  {
57
- "byteSize": 1528,
58
- "digest": "sha256:046b91dd920eed4da920132e4f563fedd0a73603a206896a078536a75906335c",
57
+ "byteSize": 1749,
58
+ "digest": "sha256:160bf204e632293068bba0d457f0abb0c5a76af3ed452b0647746e9e7071d773",
59
59
  "id": "review",
60
60
  "kind": "prompts",
61
61
  "path": "packages/piagent-core/prompts/review.md"
62
62
  },
63
63
  {
64
- "byteSize": 4834,
65
- "digest": "sha256:1e20fdfbf55ec71ec6f7a780aaf567556329571dcb1774831570e143e9d2b114",
64
+ "byteSize": 5073,
65
+ "digest": "sha256:1dd1339b1e0d8e5882595a38da1781e5b8f59d96afdf4dcdc45c6a77ad7ccfe5",
66
66
  "id": "task",
67
67
  "kind": "prompts",
68
68
  "path": "packages/piagent-core/prompts/task.md"
@@ -1,6 +1,6 @@
1
1
  # Solo-first orchestration policy
2
2
 
3
- Mục tiêu: user không phải nhớ `/run`, `/parallel`, `/chain` cho workflow hằng ngày, nhưng platform cũng không tự biến mọi task thành swarm tốn token. Khi anh gõ `/task`, `/be-to-fe`, `/platform-improve`, `/plan`, hoặc `/review`, parent agent đọc `piagent_orchestration_policy`, giữ mặc định **solo-first**, rồi chỉ dùng subagents nếu việc đó giúp giảm nhiễu context, tăng tốc read-heavy work, hoặc tăng chất lượng review.
3
+ Mục tiêu: user không phải nhớ `/run`, `/parallel`, `/chain` cho workflow hằng ngày, nhưng platform cũng không tự biến mọi task thành swarm tốn token. Khi anh gõ `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, hoặc `/workflow review`, parent agent đọc `piagent_orchestration_policy`, giữ mặc định **solo-first**, rồi chỉ dùng subagents nếu việc đó giúp giảm nhiễu context, tăng tốc read-heavy work, hoặc tăng chất lượng review. Alias cũ như `/task` vẫn giữ cùng policy.
4
4
 
5
5
  Kiểm tra policy hiện tại trong Pi:
6
6
 
@@ -81,7 +81,7 @@ Default rule: parallel read-only is OK; parallel writers are not default.
81
81
 
82
82
  ## Workflow policy
83
83
 
84
- ### `/task`
84
+ ### `/workflow task`
85
85
 
86
86
  Parent should:
87
87
 
@@ -93,7 +93,7 @@ Parent should:
93
93
  6. keep implementation single-writer unless user explicitly approves otherwise;
94
94
  7. summarize subagent outputs into task contract/context manifest/final response.
95
95
 
96
- ### `/be-to-fe`
96
+ ### `/workflow be-to-fe`
97
97
 
98
98
  Recommended auto-delegation:
99
99
 
@@ -103,7 +103,7 @@ Recommended auto-delegation:
103
103
  - parent or `piagent-worker`: implement FE only;
104
104
  - `piagent-reviewer`: review diff and verify coverage.
105
105
 
106
- ### `/platform-improve`
106
+ ### `/workflow platform-improve`
107
107
 
108
108
  Recommended auto-delegation:
109
109
 
@@ -6,17 +6,48 @@ File này là bảng tra cứu command chính cho Pi Agent Platform. Mục tiêu
6
6
 
7
7
  ## Cách đọc command
8
8
 
9
- Có 4 loại command khác nhau:
9
+ Có 5 loại cần phân biệt:
10
10
 
11
11
  | Loại | Gõ ở đâu | Ví dụ | Ý nghĩa |
12
12
  |---|---|---|---|
13
- | Terminal command | Terminal đã có Bash | `piagent-mcp --preset core` | Cài, kiểm tra, hoặc cấu hình máy/project từ bên ngoài Pi. macOS Apple Silicon và Linux x64 đã verify; macOS Intel/Linux ARM64 cần smoke trước rollout; native Windows chưa là target team; WSL2 experimental. |
14
- | Pi slash command | Bên trong Pi TUI | `/onboard-project` | Gọi workflow/prompt/package command trong Pi session hiện tại. |
15
- | Pi hotkey | Bên trong Pi TUI | `Ctrl+L` | Mở UI nhanh, thường dùng cho model/session. |
16
- | Tool syntax | Bên trong Pi, khi cần chính xác | `subagent({ action: "status" })` | Gọi đúng tool/action, dùng khi slash command hoặc natural prompt chưa đủ rõ. |
13
+ | Runtime slash command | Bên trong Pi TUI | `/usage` | Extension chạy ngay, hiện kết quả/menu, **không gọi model follow-up**. |
14
+ | Workflow launcher | Bên trong Pi TUI | `/workflow task <request>` | Runtime command mở menu hoặc gửi workflow prompt rõ ràng cho agent. |
15
+ | Workflow alias | Bên trong Pi TUI | `/task <request>` | Alias cũ cho power user; vẫn cần agent turn. Team mới nên dùng `/workflow`. |
16
+ | Terminal command | Terminal đã có Bash | `piagent-mcp --preset core` | Cài, kiểm tra, hoặc cấu hình máy/project từ bên ngoài Pi. |
17
+ | Pi native/hotkey | Bên trong Pi TUI | `/model`, `Ctrl+L` | Điều khiển native Pi như model/session/MCP. |
17
18
 
18
19
  Nếu không chắc một slash command có sẵn chưa, mở Pi và gõ `/` để xem danh sách command của session hiện tại. Command có thể khác nhau theo package đã install, provider đã login, và project trust.
19
20
 
21
+ ## Native Pi vs PiAgent
22
+
23
+ PiAgent không chiếm các command native đang dùng của Pi. Những command này để Pi xử lý trực tiếp:
24
+
25
+ | Pi native | Vai trò |
26
+ |---|---|
27
+ | `/login` | Đăng nhập provider/OAuth. |
28
+ | `/model`, `Ctrl+L` | Chọn model/provider. |
29
+ | `/session` | Xem session id/name/token/cost/context hiện tại. |
30
+ | `/resume` | Resume session cũ bằng UI/native flow. |
31
+ | `/compact` | Nén context bằng Pi native compaction. |
32
+ | `/mcp`, `/mcp-auth` | Kiểm tra/kết nối MCP live và OAuth. |
33
+
34
+ Command ngắn của PiAgent dùng cho workflow và guard local:
35
+
36
+ | PiAgent runtime | Vai trò |
37
+ |---|---|
38
+ | `/commands` | Menu/help command, không gọi model. |
39
+ | `/workflow` | Launcher task/scout/plan/review/git/onboard. |
40
+ | `/usage` | Usage live/history/preflight/compact/logs. |
41
+ | `/context` | Context index/search/preflight/compact. |
42
+ | `/permission` | Permission mode của session. |
43
+ | `/profile` | Profile và tech stack. |
44
+ | `/memory` | Project memory policy. |
45
+ | `/onboard` | Project onboarding/status/setup. |
46
+ | `/name` | Đặt tên session cho Agent Watch/report. |
47
+ | `/fresh` | Tạo session mới cho workflow. |
48
+
49
+ Riêng MCP governance vẫn giữ `/piagent-mcp` vì `/mcp` đã là command native của Pi.
50
+
20
51
  ## Flow hằng ngày ngắn nhất
21
52
 
22
53
  Lần đầu trên một project:
@@ -31,10 +62,10 @@ Trong Pi:
31
62
  ```text
32
63
  /login
33
64
  /model
34
- /piagent-commands
35
- /onboard-project
36
- /context-index
37
- /memory-policy
65
+ /commands
66
+ /onboard
67
+ /context index
68
+ /memory
38
69
  ```
39
70
 
40
71
  Các lần sau:
@@ -47,100 +78,105 @@ pi
47
78
  Trong Pi:
48
79
 
49
80
  ```text
50
- /task Implement <task cụ thể>.
81
+ /workflow task Implement <task cụ thể>.
51
82
  ```
52
83
 
53
84
  Nếu chỉ scout/audit read-only:
54
85
 
55
86
  ```text
56
- /scout Scout payment FE mapping vs BE. Do not edit source.
87
+ /workflow scout Scout payment FE mapping vs BE. Do not edit source.
57
88
  ```
58
89
 
59
90
  Nếu session đang nặng hoặc Pi báo context overflow, dùng fresh workflow:
60
91
 
61
92
  ```text
62
- /fresh-scout <read-only request>
63
- /fresh-task <implementation request>
64
- /fresh-be-to-fe <BE-readonly/FE request>
93
+ /fresh scout <read-only request>
94
+ /fresh task <implementation request>
95
+ /fresh be-to-fe <BE-readonly/FE request>
65
96
  ```
66
97
 
67
98
  Nếu task còn mơ hồ:
68
99
 
69
100
  ```text
70
- /discuss <ý tưởng hoặc yêu cầu thô>
71
- /plan <goal cần bóc tách>
101
+ /workflow discuss <ý tưởng hoặc yêu cầu thô>
102
+ /workflow plan <goal cần bóc tách>
72
103
  ```
73
104
 
74
105
  ## Nguyên tắc command/UX
75
106
 
76
- Pi Agent dùng ít namespace nhưng mỗi namespace có subcommand rõ:
77
-
78
- - `/profile` là namespace duy nhất cho profile và tech stack; không dùng `/profiles` hoặc `/profile-tech` riêng.
79
- - Status command như `/profile`, `/permission-status`, `/context-index`, `/piagent-orchestration` phải ngắn và không gọi model follow-up.
80
- - Khi user cần chọn, ưu tiên select option. Khi UI select không khả dụng, trả về exact apply command để chạy ngay.
81
- - Long list chỉ hiện khi gõ `list`, `options`, hoặc `/piagent-commands <topic>`.
107
+ Pi Agent dùng ít namespace nhưng mỗi namespace có subcommand/menu rõ:
108
+
109
+ - `/workflow` là cửa chính cho task/scout/review/git/onboard workflow. Workflow cần agent turn là cố ý và được nói rõ.
110
+ - `/usage` gom live usage, history/report hint, preflight, compact, logs.
111
+ - `/name` đặt tên session theo task để Agent Watch/report map đúng việc.
112
+ - `/fresh` mở session mới cho `task`, `scout`, hoặc `be-to-fe` khi phiên hiện tại đã nặng.
113
+ - `/context` gom context index, search, preflight, compact.
114
+ - `/permission` gom permission status/read-only/workspace-write/full-access.
115
+ - `/profile` là namespace duy nhất cho profile và tech stack.
116
+ - `/commands` là runtime help/menu, không còn bắt agent đọc docs để giải thích.
117
+ - Khi user cần chọn, ưu tiên select option. Khi UI select không khả dụng, trả exact command.
82
118
  - Hành động rủi ro như stage rộng, push, PR write, deploy, publish, thay đổi database hoặc external-provider write vẫn cần xác nhận người vận hành.
83
119
 
84
- ## Command của platform mình
120
+ ## Command chính cho team
85
121
 
86
122
  Các command này đến từ package `piagent-core`.
87
123
 
88
- | Command | Dịch nghĩa | Dùng khi nào | Kết quả mong đợi |
89
- |---|---|---|---|
90
- | `/piagent-commands` | Bảng hướng dẫn command | Khi không nhớ command hoặc muốn giải thích cho team mới. | Agent tóm tắt command theo đúng ngữ cảnh project. |
91
- | `/permission-status` | Xem quyền runtime | Khi muốn biết session đang là read-only, workspace-write, hay full-access. | Hiện active permission profile và guard boundary còn giữ. |
92
- | `/read-only` | Chuyển session sang read-only | Khi chỉ muốn scout/audit/review, không sửa source. | Shell/write/unknown tool bị chặn trước execution. |
93
- | `/workspace-write` | Chuyển session sang write chuẩn | Khi quay về mode implement bình thường. | Guard trở về profile implementation mặc định. |
94
- | `/full-access` | Bật trusted full-access | Khi repo đã trusted và muốn agent có quyền workspace rộng hơn. | Tool/scope autonomy được nới trong session; protected paths/redaction/human gates vẫn bật. |
95
- | `/full-access <task>` | Bật full-access rồi chạy task | Khi muốn một lệnh vừa cấp quyền vừa giao việc. | Session chuyển sang `trusted-full-access`, phần `<task>` được gửi tiếp cho agent. |
96
- | `/onboard-project` | Đọc project lần đầu | Lần đầu gắn repo vào Pi, sau `/login` và `/model`. | Tạo/cập nhật `.pi/piagent-profile.json`, `.pi/project-context.md`, `.pi/context-index.json`, `.pi/memory/*`. |
97
- | `/context-index` | Xem bản đồ context | Khi muốn biết context index đã generate chưa mà không burn token. | Hiện node/edge/citation/warning ngắn, không gọi model follow-up. |
98
- | `/context-index search <keyword>` | Tìm trong bản đồ context | Khi cần điểm vào module/tech/risk trước khi scout rộng. | Trả các node khớp keyword; vẫn phải đọc file được cite trước khi sửa. |
99
- | `/profile` | Xem profile ngắn | Khi muốn biết mode hiện tại mà không burn token. | Hiện status ngắn, không gọi model follow-up. |
100
- | `/profile list` | Xem profile có sẵn | Khi chưa nhớ tên profile. | Hiện list compact. |
101
- | `/profile <profile>` | Áp profile ngay | Khi đã biết profile muốn dùng. | Ghi `.pi/piagent-profile.json` và lock ngay, không hỏi vòng. |
102
- | `/profile auto` | Áp profile recommend | Khi muốn auto-detect và apply luôn. | Detect profile rồi ghi profile/lock ngay. |
103
- | `/profile setup` | Chọn profile + tech bằng option | Khi onboarding hoặc muốn đổi profile/stack mà không chat dài. | Mở select profile, rồi select tech theo role; fallback là card ngắn + lệnh apply chính xác nếu UI select chưa có. |
104
- | `/profile setup fullstack` | Chọn tech cho fullstack | Khi đã biết profile là fullstack. | Chọn frontend, backend, database rồi ghi `.pi/tech-stack.json` và `.pi/tech-context/*` placeholder. |
105
- | `/profile fe`, `/profile be`, `/profile full`, `/profile be-fe` | Alias ngắn | Khi muốn gõ nhanh. | Map sang `web-frontend`, `backend-api`, `fullstack`, `be-readonly-fe`. |
106
- | `/profile tech` | Xem tech stack hiện tại | Khi muốn biết profile đã gắn tech nào và Context7 đã record chưa. | Hiện manifest + pending Context7 ngắn, không gọi model follow-up. |
107
- | `/profile tech setup [profile]` | Wizard chọn tech | Khi muốn chọn tech theo role bằng UI select. | FE profile chọn FE + DB; BE profile chọn BE + DB; fullstack chọn FE + BE + DB. |
108
- | `/profile tech options [profile]` | Xem option tech | Khi UI select không có hoặc muốn lấy lệnh apply. | Hiện option theo role và lệnh mẫu `/profile tech apply ...`. |
109
- | `/profile tech apply fullstack frontend=nextjs backend=nestjs database=prisma` | Apply trực tiếp | Khi team muốn một lệnh deterministic, không chat dài. | Ghi profile, lock, tech manifest, Context7 placeholders. |
110
- | `/profile tech refresh` | Xem Context7 cần record | Sau khi chọn tech stack. | Hiện các query Context7 cần đọc và record bằng tool runtime. |
111
- | `/memory-policy` | Kiểm tra memory | Khi muốn biết Pi đang nhớ gì, hoặc muốn lưu memory explicit. | Hiện chính sách memory và file `.pi/memory/*`. |
112
- | `/piagent-orchestration` | Xem policy solo/subagent | Khi muốn biết task sẽ chạy solo-first, lens nào, Field Guide nào. | Hiện status compact, không gọi model follow-up. |
113
- | `/model-options` | Giải thích model | Khi chưa rõ chọn provider model nào, thinking nào. | Giải thích selector, scope, thinking, benchmark rule. |
114
- | `/task-preflight` | Kiểm context trước task | Trước task lớn/risk cao hoặc khi session đã dài. | Báo nên chạy trực tiếp, compact, hay fresh session. |
115
- | `/task-preflight compact` | Compact có hướng dẫn | Khi context 70%+ hoặc trước task dài tiếp theo. | Pi compact session, giữ quyết định/open blockers/verify cần thiết. |
116
- | `/piagent-usage` | Snapshot token/context | Khi muốn biết session đang ăn context/token như nào. | Hiện session file, model, live context, lệnh lấy exact stats. |
117
- | `/platform-improve` | Cải tiến platform/workflow | Khi cần cập nhật setup, prompt, MCP, model scope, memory, runtime policy, docs, hoặc subagent workflow. | Có implementation matrix, source changes, docs, và verify. |
118
- | `/be-to-fe` | Map BE spec sang FE | Khi BE là source-of-truth/read-only, chỉ implement FE. | Scout BE read-only, map contract, implement FE, verify FE. |
119
- | `/scout` | Scout/audit read-only | Khi cần evidence matrix trước khi chốt task, đặc biệt payment/auth/data/BE contract. | Không sửa source; trả context manifest, verify, gaps, risks. |
120
- | `/fresh-scout` | Scout trong session mới | Khi task scout lớn hoặc session hiện tại nặng. | Tự mở session mới và chạy `/scout` với request ngắn. |
121
- | `/fresh-task` | Task trong session mới | Khi implementation mới không nên kéo context cũ. | Tự mở session mới và chạy `/task`. |
122
- | `/fresh-be-to-fe` | BE→FE trong session mới | Khi mapping BE/FE lớn hoặc session hiện tại đã phình. | Tự mở session mới và chạy `/be-to-fe`. |
123
- | `/task` | Implement task chuẩn | Khi requirement đã rõ. | Có task contract, context manifest, verify, trace, gate. |
124
- | `/commit [message/scope]` | Commit local có guard | Khi diff đã review và muốn tạo commit gọn. | Stage file rõ ràng, chạy verify phù hợp, commit local; không push. |
125
- | `/pr [title/request]` | Chuẩn bị pull request | Khi branch đã commit xong và muốn mở PR. | Check status/branch/remote, verify, hỏi xác nhận trước push hoặc tạo/cập nhật PR. |
126
- | `/plan` | Lập kế hoạch | Khi cần bóc task trước khi sửa. | Plan có scope, file target, verify, risk. |
127
- | `/discuss` | Trao đổi/làm rõ | Khi chưa nên sửa code. | Giải thích option/tradeoff, không tự implement. |
128
- | `/review` | Review current diff/source | Khi cần audit read-only trước final/merge. | Findings theo severity, file/area, required fix. |
129
-
130
- Git flow của Pi cố ý không dùng namespace `/git-*`. Daily flow là nói tự nhiên hoặc dùng lệnh ngắn:
124
+ | Command | Dùng khi nào | Kết quả mong đợi |
125
+ |---|---|---|
126
+ | `/commands` | Không nhớ command. | Mở menu/help theo topic, không gọi model. |
127
+ | `/workflow` | Muốn chọn task/scout/review/git/onboard bằng menu. | Mở workflow picker. |
128
+ | `/workflow task <request>` | Requirement đã rõ và cần implement. | Launch task workflow cho agent. |
129
+ | `/workflow scout <request>` | Cần scout/audit read-only. | Launch scout workflow cho agent. |
130
+ | `/workflow be-to-fe <request>` | BE read-only, FE implementation. | Launch BE→FE workflow. |
131
+ | `/workflow discuss <idea>` | Task còn mơ hồ. | Launch clarify workflow, không sửa code. |
132
+ | `/workflow plan <goal>` | Cần plan trước khi sửa. | Launch plan workflow. |
133
+ | `/workflow review <target>` | Review diff/source. | Launch review workflow. |
134
+ | `/workflow commit [message]` | Diff đã review và muốn commit local. | Launch guarded commit workflow. |
135
+ | `/workflow pr [title]` | Branch đã commit và muốn chuẩn bị PR. | Launch guarded PR workflow. |
136
+ | `/workflow onboard [focus]` | First-read onboarding cần agent đọc project. | Launch onboarding workflow để ghi `.pi/project-context.md` và context index. |
137
+ | `/onboard` | First-run setup/status. | Mở menu onboarding: status, run, profile, setup. |
138
+ | `/profile` | Xem/áp profile và chọn tech. | Chạy ngay, không gọi model. |
139
+ | `/profile setup` | Chọn profile + tech bằng option. | Ghi profile/lock/tech manifest. |
140
+ | `/usage` | Xem live usage hoặc report hint. | Menu live/history/preflight/compact/logs. |
141
+ | `/name <name>` | Đặt tên session theo task. | Agent Watch/report map đúng task. |
142
+ | `/fresh task|scout|be-to-fe <request>` | Phiên hiện tại đã nặng hoặc muốn tách việc. | Mở session mới có tên và replay workflow prompt gọn. |
143
+ | `/context` | Xem context index/search/preflight/compact. | Menu context, không gọi model. |
144
+ | `/permission` | Xem/đổi quyền runtime. | Menu status/read-only/workspace-write/full-access. |
145
+ | `/memory` hoặc `/memory-policy` | Xem memory policy. | Chạy ngay, không gọi model. |
146
+ | `/model-options` | Xem hướng dẫn model/thinking. | Chạy ngay; chọn model vẫn dùng `/model` hoặc `Ctrl+L`. |
147
+ | `/piagent-mcp` | Xem/quản trị MCP trong Pi. | Menu MCP, không gọi model. |
148
+
149
+ Alias cũ vẫn giữ để không phá thói quen:
150
+
151
+ | Alias | Command chính |
152
+ |---|---|
153
+ | `/task <request>` | `/workflow task <request>` |
154
+ | `/scout <request>` | `/workflow scout <request>` |
155
+ | `/be-to-fe <request>` | `/workflow be-to-fe <request>` |
156
+ | `/commit [message]` | `/workflow commit [message]` |
157
+ | `/pr [title]` | `/workflow pr [title]` |
158
+ | `/setname <name>` | `/name <name>` |
159
+ | `/fresh-task <request>` | `/fresh task <request>` |
160
+ | `/fresh-scout <request>` | `/fresh scout <request>` |
161
+ | `/fresh-be-to-fe <request>` | `/fresh be-to-fe <request>` |
162
+ | `/context-index` | `/context index` |
163
+ | `/task-preflight` | `/context preflight` |
164
+ | `/permission-status`, `/read-only`, `/workspace-write`, `/full-access` | `/permission ...` |
165
+
166
+ Git flow của Pi cố ý không dùng namespace `/git-*`. Daily flow là nói tự nhiên hoặc đi qua `/workflow`:
131
167
 
132
168
  ```text
133
- /commit docs: update onboarding notes
134
- /pr Add guarded git workflow
169
+ /workflow commit docs: update onboarding notes
170
+ /workflow pr Add guarded git workflow
135
171
  ```
136
172
 
137
- `/commit` chỉ tạo local commit. `/pr` có thể cần `git push` và GitHub write action, nên guard vẫn bắt agent xác nhận rõ branch/title/scope trước khi đẩy hoặc tạo PR. Các lệnh stage rộng như `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` cũng bị đưa qua confirmation để tránh gom nhầm file riêng tư hoặc unrelated diff.
173
+ Alias `/commit` và `/pr` vẫn chạy. Commit workflow chỉ tạo local commit. PR workflow có thể cần `git push` và GitHub write action, nên guard vẫn bắt agent xác nhận rõ branch/title/scope trước khi đẩy hoặc tạo PR. Các lệnh stage rộng như `git add .`, `git add -A`, `git add --all`, `git add -- .`, `git add :/` cũng bị đưa qua confirmation để tránh gom nhầm file riêng tư hoặc unrelated diff.
138
174
 
139
175
  ## Image/screenshot input
140
176
 
141
177
  | Tình huống | Cách dùng | Kết quả |
142
178
  |---|---|---|
143
- | Chat box trả ra local path ảnh | `/scout Check screenshot /var/folders/.../screenshot.png` | Platform attach ảnh và rewrite path thành `[image1]`. |
179
+ | Chat box trả ra local path ảnh | `/workflow scout Check screenshot /var/folders/.../screenshot.png` | Platform attach ảnh và rewrite path thành `[image1]`. |
144
180
  | Nhiều ảnh trong cùng prompt | Dán tối đa 4 path ảnh | Prompt có `[image1]`, `[image2]`, ... |
145
181
  | Ảnh quá lớn | Dùng Pi `read` tool trên file ảnh hoặc resize ảnh trước | Tránh nhồi ảnh quá lớn vào chat input. |
146
182
 
@@ -175,7 +211,7 @@ Tech stack option theo profile:
175
211
  | `data` | Data + database optional | `data=dbt database=postgres` |
176
212
  | `docs` | Docs | `docs=mintlify` |
177
213
 
178
- Sau khi chọn tech, platform tạo `.pi/tech-stack.json` và các file `.pi/tech-context/<tech>.json`. `/onboard-project` sẽ đưa các pointer này vào `.pi/context-index.json`. File context chỉ nên chứa tóm tắt ngắn/citation từ Context7, không lưu nguyên văn docs dài, token, session, hoặc secret.
214
+ Sau khi chọn tech, platform tạo `.pi/tech-stack.json` và các file `.pi/tech-context/<tech>.json`. `/onboard run` sẽ đưa các pointer này vào `.pi/context-index.json`. File context chỉ nên chứa tóm tắt ngắn/citation từ Context7, không lưu nguyên văn docs dài, token, session, hoặc secret.
179
215
 
180
216
  ## Đọc tài liệu ngoài project
181
217
 
@@ -229,7 +265,7 @@ Các command này thuộc Pi core hoặc package Pi chính. Tên/availability c
229
265
  | `Ctrl+P` | Cycle model | Đổi model trong scope nhanh. | Dùng sau khi đã setup `enabledModels`. |
230
266
  | `Shift+Ctrl+P` | Cycle model ngược | Quay lại model trước trong scope. | Tiện khi test provider. |
231
267
  | `Shift+Tab` | Đổi thinking level | Chọn effort như `medium`, `high`, `xhigh`, `max` nếu model hỗ trợ. | Model không hỗ trợ level nào thì Pi có thể clamp. |
232
- | `/session` | Xem session hiện tại | Cần session id/name/token/cost/context. | Dùng cùng `/piagent-usage`. |
268
+ | `/session` | Xem session hiện tại | Cần session id/name/token/cost/context. | Dùng sau `pi --name` hoặc `/name` để kiểm tra tên. |
233
269
  | `/resume` | Resume session | Khi tắt nhầm Pi hoặc muốn nối lại work cũ. | Dựa vào session list/id/name của Pi. |
234
270
  | `/compact` | Nén context | Khi context usage cao trước task dài. | Chỉ dùng khi cần; đọc lại context quan trọng sau compact. |
235
271
  | `/mcp` | Xem MCP | Kiểm tra server/tool MCP trong Pi. | Cần `pi-mcp-adapter` hoặc MCP config tương ứng. |
@@ -251,7 +287,7 @@ Các command này thuộc Pi core hoặc package Pi chính. Tên/availability c
251
287
 
252
288
  Các command này đến từ package `pi-subagents`. Tên hơi “package terminology”, nên bảng dưới dịch ra nghĩa thực tế.
253
289
 
254
- Quan trọng: daily flow không bắt anh phải nhớ các lệnh này. Các workflow `/task`, `/be-to-fe`, `/platform-improve`, `/plan`, `/review` dùng solo-first orchestration: parent agent lập task tree/review lenses trước, rồi chỉ spawn subagent khi task có phần việc độc lập và đáng token. Slash command dưới đây dùng khi anh muốn ép orchestration cụ thể hoặc debug.
290
+ Quan trọng: daily flow không bắt anh phải nhớ các lệnh này. Các workflow `/workflow task`, `/workflow be-to-fe`, `/workflow platform-improve`, `/workflow plan`, `/workflow review` dùng solo-first orchestration: parent agent lập task tree/review lenses trước, rồi chỉ spawn subagent khi task có phần việc độc lập và đáng token. Slash command dưới đây dùng khi anh muốn ép orchestration cụ thể hoặc debug.
255
291
 
256
292
  | Command | Dịch nghĩa dễ hiểu | Dùng khi nào | Kết quả mong đợi |
257
293
  |---|---|---|---|
@@ -376,14 +412,14 @@ Default của platform là an toàn:
376
412
  - `asyncByDefault: false`: không tự chạy background nếu anh không yêu cầu.
377
413
  - Một `piagent-worker` tại một thời điểm; parallel chủ yếu dùng cho scout/reviewer.
378
414
 
379
- Nếu anh không gọi gì thêm, `/task` vẫn chạy solo-first và chỉ tự dùng subagent theo `docs/auto-delegation-policy.md` khi có scout/planning/review độc lập đáng làm.
415
+ Nếu anh không gọi gì thêm, `/workflow task` vẫn chạy solo-first và chỉ tự dùng subagent theo `docs/auto-delegation-policy.md` khi có scout/planning/review độc lập đáng làm. Alias `/task` giữ cùng policy.
380
416
 
381
417
  ## Prompt mẫu cho bài toán thật
382
418
 
383
419
  ### Platform/package improvement
384
420
 
385
421
  ```text
386
- /platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage. Keep workflows public, project-agnostic, and verifiable.
422
+ /workflow platform-improve Improve onboarding, model scope, MCP setup, and verification docs for team usage. Keep workflows public, project-agnostic, and verifiable.
387
423
  ```
388
424
 
389
425
  Khi muốn tách rõ agents:
@@ -400,7 +436,7 @@ Use piagent-reviewer before final.
400
436
 
401
437
  ```text
402
438
  /profile be-readonly-fe
403
- /be-to-fe Implement FE support for <endpoint/spec>. Scout backend read-only, map contract, then edit frontend only.
439
+ /workflow be-to-fe Implement FE support for <endpoint/spec>. Scout backend read-only, map contract, then edit frontend only.
404
440
  ```
405
441
 
406
442
  Nếu muốn parallel read-only:
@@ -428,8 +464,8 @@ Các lệnh này chạy ngoài Pi.
428
464
  | Command | Dùng khi nào |
429
465
  |---|---|
430
466
  | `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.82.0` | Cài Pi CLI tương thích với release hiện tại. |
431
- | `npm install -g --ignore-scripts @piagent/platform@1.2.1` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
432
- | `pi install git:github.com/Vt-mmm/piagent@v1.2.1` | Cài pinned release khi cần reproducible team setup. |
467
+ | `npm install -g --ignore-scripts @piagent/platform@1.2.3` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
468
+ | `pi install git:github.com/Vt-mmm/piagent@v1.2.3` | Cài pinned release khi cần reproducible team setup. |
433
469
  | `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
434
470
  | `piagent-update --check` | Báo version hiện tại vs version sẽ lên cho cả ba thành phần; không cài gì. |
435
471
  | `piagent-update` | Full update một lệnh: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. Thêm `--project <path>` để chạy doctor sau. |
@@ -447,7 +483,7 @@ Các lệnh này chạy ngoài Pi.
447
483
  | `piagent-auto` | Mở Pi với project trust `--approve` cho lần chạy hiện tại; guard vẫn bật. |
448
484
  | `piagent-auto --read-only -p "<task>"` | Auto-run scout/read-only; guard chặn shell/write/unknown tool. |
449
485
  | `piagent-auto --full-access -p "<task>"` | Trusted automation style; không tắt protected paths/redaction/human gates. |
450
- | `pi` rồi `/full-access <task>` | Một lệnh trong Pi để bật full-access cho session và giao task. |
486
+ | `pi` rồi `/permission full-access <task>` | Một lệnh trong Pi để bật full-access cho session và giao task. Alias `/full-access <task>` vẫn chạy. |
451
487
  | `pi --list-models` | Xem model Pi thấy được theo credentials hiện tại. |
452
488
  | `piagent-install --with-mcp --with-subagents` | Cài global package + MCP + subagent baseline từ package bin. |
453
489
  | `piagent-setup <project> --profile auto` | Setup đầy đủ cho một project khi muốn preseed bằng bin. |
@@ -515,8 +551,12 @@ export GITHUB_PERSONAL_ACCESS_TOKEN=<github-token>
515
551
 
516
552
  | Câu hỏi | Lệnh |
517
553
  |---|---|
518
- | Session này đang dùng model gì? | `/session` hoặc `/piagent-usage` |
519
- | Context window đang còn bao nhiêu? | `/piagent-usage` |
554
+ | Session này đang dùng model gì? | `/session` hoặc `/usage` |
555
+ | Đặt/đổi tên session đang mở? | `/name <task/session name>` |
556
+ | Tắt nhầm, mở lại session gần nhất? | `pi --continue` |
557
+ | Chọn lại session cũ theo tên/id? | `pi --resume` hoặc `pi --session <id-or-file>` |
558
+ | Context window đang còn bao nhiêu? | `/usage` |
559
+ | Output test/build dài bị nén thì xem ở đâu? | `/logs` |
520
560
  | Exact token/cost từ terminal khác? | `piagent-usage /path/to/project` |
521
561
  | Tổng token/cost các session cũ? | `piagent-usage --history /path/to/project --days 7` |
522
562
  | CSV report cuối tuần toàn máy? | `piagent-usage --history --all-projects --days 7 --csv` |