@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.
- package/CHANGELOG.md +28 -0
- package/README.md +34 -27
- package/catalog/capabilities.json +8 -8
- package/docs/auto-delegation-policy.md +4 -4
- package/docs/command-reference-vietnamese.md +123 -86
- package/docs/context-window-policy.md +7 -7
- package/docs/distribution-standard.md +49 -11
- package/docs/herdr-workflow.md +3 -2
- package/docs/memory-policy.md +6 -3
- package/docs/operator-manual-vietnamese.md +81 -72
- package/docs/package-architecture-notes.md +6 -6
- package/docs/project-adapters.md +4 -4
- package/docs/project-onboarding.md +12 -11
- package/docs/publishing-for-teams.md +2 -2
- package/docs/quickstart-vietnamese.md +25 -23
- package/docs/release-install-policy.md +23 -7
- package/docs/runtime-harness-standard.md +7 -7
- package/docs/runtime-policy-design.md +1 -1
- package/docs/runtime-quality-baseline.md +1 -1
- package/docs/security-threat-model.md +1 -1
- package/docs/subagent-orchestration-capabilities.md +3 -3
- package/docs/subagents-and-multiagent.md +4 -4
- package/docs/task-implementation-contract.md +4 -4
- package/docs/task-lifecycle-vietnamese.md +2 -2
- package/docs/team-onboarding.md +39 -19
- package/docs/usage-observability.md +13 -12
- package/docs/workflow-recipes.md +12 -9
- package/docs-site/architecture.html +1 -1
- package/docs-site/commands.html +19 -15
- package/docs-site/content/commands.html +18 -14
- package/docs-site/content/permissions.html +11 -11
- package/docs-site/content/quickstart.html +12 -11
- package/docs-site/content/team.html +1 -1
- package/docs-site/content/workflows.html +17 -17
- package/docs-site/index.html +1 -1
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +12 -12
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +13 -12
- package/docs-site/runtime.html +1 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -1
- package/docs-site/team.html +2 -2
- package/docs-site/workflows.html +18 -18
- package/package.json +1 -1
- package/packages/piagent-core/README.md +27 -27
- package/packages/piagent-core/extensions/piagent-guard.ts +1055 -190
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/prompts/be-to-fe.md +3 -3
- package/packages/piagent-core/prompts/discuss.md +2 -2
- package/packages/piagent-core/prompts/plan.md +1 -1
- package/packages/piagent-core/prompts/platform-improve.md +1 -1
- package/packages/piagent-core/prompts/pr.md +1 -1
- package/packages/piagent-core/prompts/review.md +1 -1
- package/packages/piagent-core/prompts/scout.md +2 -2
- package/packages/piagent-core/prompts/task.md +2 -2
- package/scripts/init-project.sh +4 -3
- package/scripts/install-global.sh +47 -1
- package/scripts/profile-doctor.sh +1 -1
- package/scripts/setup.sh +4 -3
- package/scripts/team-doctor.sh +6 -8
- package/scripts/update-global.mjs +207 -11
- package/scripts/verify-local.sh +18 -17
- package/templates/project/.pi/context-index.json +2 -2
- package/templates/project/.pi/project-context.md +3 -3
- package/templates/project/AGENTS.md +4 -4
- package/packages/piagent-core/prompts/memory-policy.md +0 -52
- package/packages/piagent-core/prompts/model-options.md +0 -68
- package/packages/piagent-core/prompts/onboard-project.md +0 -147
- package/packages/piagent-core/prompts/piagent-commands.md +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.4 - 2026-07-30
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `piagent-update` remains a global machine update first; optional `--project <path>` now runs a post-update legacy project migration and strict-share doctor when a maintainer wants that extra check.
|
|
10
|
+
|
|
11
|
+
- Documented the global `npm exec --package @piagent/platform@X.Y.Z -- piagent-update ...` bootstrap command for machines that do not have the global `piagent-update` helper yet.
|
|
12
|
+
|
|
13
|
+
- `piagent-update` now falls back to a user-writable npm global prefix when the default prefix is locked by the OS, avoiding `/usr/local/lib/node_modules` permission failures during team rollout.
|
|
14
|
+
|
|
15
|
+
## v1.2.3 - 2026-07-30
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added short runtime command namespaces for team use: `/commands`, `/usage`, `/context`, `/permission`, `/memory`, `/onboard`, `/name`, and `/fresh`.
|
|
20
|
+
|
|
21
|
+
- Added a compatibility rewrite for `/piagent-workflow` so older muscle memory routes to `/workflow` instead of becoming a normal agent prompt.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- 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.
|
|
26
|
+
|
|
27
|
+
- 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.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- Removed prompt-file versions of runtime help commands that should execute locally rather than asking the agent to inspect docs.
|
|
32
|
+
|
|
5
33
|
## v1.2.2 - 2026-07-29
|
|
6
34
|
|
|
7
35
|
### Added
|
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
|
|
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
|
-
`/
|
|
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
|
|
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
|
-
-
|
|
74
|
-
-
|
|
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
|
|
109
|
+
Inside an active Pi session, use `/permission` for the menu or a session-local switch:
|
|
107
110
|
|
|
108
111
|
```text
|
|
109
|
-
/permission
|
|
110
|
-
/
|
|
111
|
-
/
|
|
112
|
-
/
|
|
113
|
-
/full-access
|
|
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
|
|
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. `/
|
|
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
|
-
| `/
|
|
171
|
-
| `/
|
|
172
|
-
| `/
|
|
173
|
-
| `/
|
|
174
|
-
| `/
|
|
175
|
-
| `/
|
|
176
|
-
| `/
|
|
177
|
-
| `/
|
|
178
|
-
| `/
|
|
179
|
-
| `/
|
|
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 `/
|
|
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.
|
|
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.4` 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":
|
|
44
|
-
"digest": "sha256:
|
|
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":
|
|
51
|
-
"digest": "sha256:
|
|
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":
|
|
58
|
-
"digest": "sha256:
|
|
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":
|
|
65
|
-
"digest": "sha256:
|
|
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ó
|
|
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
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
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
|
-
/
|
|
35
|
-
/onboard
|
|
36
|
-
/context
|
|
37
|
-
/memory
|
|
65
|
+
/commands
|
|
66
|
+
/onboard
|
|
67
|
+
/context index
|
|
68
|
+
/memory
|
|
38
69
|
```
|
|
39
70
|
|
|
40
71
|
Các lần sau:
|
|
@@ -47,102 +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
|
|
63
|
-
/fresh
|
|
64
|
-
/fresh
|
|
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
|
-
- `/
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
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
|
|
120
|
+
## Command chính cho team
|
|
85
121
|
|
|
86
122
|
Các command này đến từ package `piagent-core`.
|
|
87
123
|
|
|
88
|
-
| Command |
|
|
89
|
-
|
|
90
|
-
| `/
|
|
91
|
-
| `/
|
|
92
|
-
| `/
|
|
93
|
-
| `/
|
|
94
|
-
| `/
|
|
95
|
-
| `/
|
|
96
|
-
| `/
|
|
97
|
-
| `/
|
|
98
|
-
| `/
|
|
99
|
-
| `/
|
|
100
|
-
| `/
|
|
101
|
-
| `/
|
|
102
|
-
| `/profile
|
|
103
|
-
| `/profile setup` | Chọn profile + tech bằng option |
|
|
104
|
-
| `/
|
|
105
|
-
| `/
|
|
106
|
-
| `/
|
|
107
|
-
| `/
|
|
108
|
-
| `/
|
|
109
|
-
| `/
|
|
110
|
-
| `/
|
|
111
|
-
| `/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
|
116
|
-
|
|
117
|
-
| `/
|
|
118
|
-
| `/
|
|
119
|
-
| `/
|
|
120
|
-
| `/
|
|
121
|
-
| `/
|
|
122
|
-
| `/
|
|
123
|
-
| `/fresh-task
|
|
124
|
-
| `/fresh-
|
|
125
|
-
| `/
|
|
126
|
-
| `/
|
|
127
|
-
| `/
|
|
128
|
-
| `/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
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`:
|
|
133
167
|
|
|
134
168
|
```text
|
|
135
|
-
/commit docs: update onboarding notes
|
|
136
|
-
/pr Add guarded git workflow
|
|
169
|
+
/workflow commit docs: update onboarding notes
|
|
170
|
+
/workflow pr Add guarded git workflow
|
|
137
171
|
```
|
|
138
172
|
|
|
139
|
-
`/commit` chỉ tạo local commit.
|
|
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.
|
|
140
174
|
|
|
141
175
|
## Image/screenshot input
|
|
142
176
|
|
|
143
177
|
| Tình huống | Cách dùng | Kết quả |
|
|
144
178
|
|---|---|---|
|
|
145
|
-
| 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]`. |
|
|
146
180
|
| Nhiều ảnh trong cùng prompt | Dán tối đa 4 path ảnh | Prompt có `[image1]`, `[image2]`, ... |
|
|
147
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. |
|
|
148
182
|
|
|
@@ -177,7 +211,7 @@ Tech stack option theo profile:
|
|
|
177
211
|
| `data` | Data + database optional | `data=dbt database=postgres` |
|
|
178
212
|
| `docs` | Docs | `docs=mintlify` |
|
|
179
213
|
|
|
180
|
-
Sau khi chọn tech, platform tạo `.pi/tech-stack.json` và các file `.pi/tech-context/<tech>.json`. `/onboard
|
|
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.
|
|
181
215
|
|
|
182
216
|
## Đọc tài liệu ngoài project
|
|
183
217
|
|
|
@@ -231,7 +265,7 @@ Các command này thuộc Pi core hoặc package Pi chính. Tên/availability c
|
|
|
231
265
|
| `Ctrl+P` | Cycle model | Đổi model trong scope nhanh. | Dùng sau khi đã setup `enabledModels`. |
|
|
232
266
|
| `Shift+Ctrl+P` | Cycle model ngược | Quay lại model trước trong scope. | Tiện khi test provider. |
|
|
233
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. |
|
|
234
|
-
| `/session` | Xem session hiện tại | Cần session id/name/token/cost/context. | Dùng sau `pi --name` hoặc `/
|
|
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. |
|
|
235
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. |
|
|
236
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. |
|
|
237
271
|
| `/mcp` | Xem MCP | Kiểm tra server/tool MCP trong Pi. | Cần `pi-mcp-adapter` hoặc MCP config tương ứng. |
|
|
@@ -253,7 +287,7 @@ Các command này thuộc Pi core hoặc package Pi chính. Tên/availability c
|
|
|
253
287
|
|
|
254
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ế.
|
|
255
289
|
|
|
256
|
-
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.
|
|
257
291
|
|
|
258
292
|
| Command | Dịch nghĩa dễ hiểu | Dùng khi nào | Kết quả mong đợi |
|
|
259
293
|
|---|---|---|---|
|
|
@@ -378,14 +412,14 @@ Default của platform là an toàn:
|
|
|
378
412
|
- `asyncByDefault: false`: không tự chạy background nếu anh không yêu cầu.
|
|
379
413
|
- Một `piagent-worker` tại một thời điểm; parallel chủ yếu dùng cho scout/reviewer.
|
|
380
414
|
|
|
381
|
-
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.
|
|
382
416
|
|
|
383
417
|
## Prompt mẫu cho bài toán thật
|
|
384
418
|
|
|
385
419
|
### Platform/package improvement
|
|
386
420
|
|
|
387
421
|
```text
|
|
388
|
-
/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.
|
|
389
423
|
```
|
|
390
424
|
|
|
391
425
|
Khi muốn tách rõ agents:
|
|
@@ -402,7 +436,7 @@ Use piagent-reviewer before final.
|
|
|
402
436
|
|
|
403
437
|
```text
|
|
404
438
|
/profile be-readonly-fe
|
|
405
|
-
/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.
|
|
406
440
|
```
|
|
407
441
|
|
|
408
442
|
Nếu muốn parallel read-only:
|
|
@@ -430,12 +464,15 @@ Các lệnh này chạy ngoài Pi.
|
|
|
430
464
|
| Command | Dùng khi nào |
|
|
431
465
|
|---|---|
|
|
432
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. |
|
|
433
|
-
| `npm install -g --ignore-scripts @piagent/platform@1.2.
|
|
434
|
-
| `pi install git:github.com/Vt-mmm/piagent@v1.2.
|
|
467
|
+
| `npm install -g --ignore-scripts @piagent/platform@1.2.4` | Cài terminal helper `piagent-*` từ release tag hiện tại. |
|
|
468
|
+
| `pi install git:github.com/Vt-mmm/piagent@v1.2.4` | Cài pinned release khi cần reproducible team setup. |
|
|
435
469
|
| `pi install git:github.com/Vt-mmm/piagent` | Cài latest package platform cho máy cá nhân/sandbox. |
|
|
436
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ì. |
|
|
437
|
-
| `piagent-update` | Full update một lệnh: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu.
|
|
471
|
+
| `piagent-update` | Full update global một lệnh cho cả máy: Pi host → npm-global helper → Pi package, đúng thứ tự release yêu cầu. |
|
|
438
472
|
| `piagent-update --version X.Y.Z` | Update tới đúng một release thay vì latest; dùng cho rollout theo lô hoặc rollback. |
|
|
473
|
+
| `piagent-update --project <path>` | Bước phụ sau global update: migrate project cũ nếu có rồi chạy doctor strict-share cho project đó. |
|
|
474
|
+
| `piagent-update --npm-prefix ~/.pi/npm-global` | Ép updater cài host/helper vào npm global prefix của user; hữu ích khi `/usr/local/lib/node_modules` không ghi được. |
|
|
475
|
+
| `npm exec -y --package @piagent/platform@X.Y.Z -- piagent-update --version X.Y.Z --force` | Bootstrap/update global cho máy chưa có `piagent-update`; chạy từ Terminal, không cần mở Pi. |
|
|
439
476
|
| `PIAGENT_NO_UPDATE_CHECK=1` | Tắt notice "có bản mới" ở đầu session Pi. Mặc định bật, hỏi registry nhiều nhất một lần mỗi 24 giờ ở tiến trình nền. |
|
|
440
477
|
| Cài exact Pi host của release, rồi `npm install -g --ignore-scripts @piagent/platform@X.Y.Z` và `piagent-install --stable` | Sequence thủ công tương đương. Thứ tự bắt buộc: `piagent-install` fail nếu Pi host lệch bản pin và không tự cài host. Version pin của từng release nằm trong [release/install policy](release-install-policy.md). |
|
|
441
478
|
| Cài exact Pi host ghi trong release cũ, rồi helper `vPREVIOUS` và `piagent-install --stable` | Full rollback; đánh giá dependency risk của host cũ trước khi hạ version. |
|
|
@@ -449,7 +486,7 @@ Các lệnh này chạy ngoài Pi.
|
|
|
449
486
|
| `piagent-auto` | Mở Pi với project trust `--approve` cho lần chạy hiện tại; guard vẫn bật. |
|
|
450
487
|
| `piagent-auto --read-only -p "<task>"` | Auto-run scout/read-only; guard chặn shell/write/unknown tool. |
|
|
451
488
|
| `piagent-auto --full-access -p "<task>"` | Trusted automation style; không tắt protected paths/redaction/human gates. |
|
|
452
|
-
| `pi` rồi `/full-access <task>` | Một lệnh trong Pi để bật full-access cho session và giao task. |
|
|
489
|
+
| `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. |
|
|
453
490
|
| `pi --list-models` | Xem model Pi thấy được theo credentials hiện tại. |
|
|
454
491
|
| `piagent-install --with-mcp --with-subagents` | Cài global package + MCP + subagent baseline từ package bin. |
|
|
455
492
|
| `piagent-setup <project> --profile auto` | Setup đầy đủ cho một project khi muốn preseed bằng bin. |
|
|
@@ -517,12 +554,12 @@ export GITHUB_PERSONAL_ACCESS_TOKEN=<github-token>
|
|
|
517
554
|
|
|
518
555
|
| Câu hỏi | Lệnh |
|
|
519
556
|
|---|---|
|
|
520
|
-
| Session này đang dùng model gì? | `/session` hoặc `/
|
|
521
|
-
| Đặt/đổi tên session đang mở? | `/
|
|
557
|
+
| Session này đang dùng model gì? | `/session` hoặc `/usage` |
|
|
558
|
+
| Đặt/đổi tên session đang mở? | `/name <task/session name>` |
|
|
522
559
|
| Tắt nhầm, mở lại session gần nhất? | `pi --continue` |
|
|
523
560
|
| Chọn lại session cũ theo tên/id? | `pi --resume` hoặc `pi --session <id-or-file>` |
|
|
524
|
-
| Context window đang còn bao nhiêu? | `/
|
|
525
|
-
| Output test/build dài bị nén thì xem ở đâu? | `/
|
|
561
|
+
| Context window đang còn bao nhiêu? | `/usage` |
|
|
562
|
+
| Output test/build dài bị nén thì xem ở đâu? | `/logs` |
|
|
526
563
|
| Exact token/cost từ terminal khác? | `piagent-usage /path/to/project` |
|
|
527
564
|
| Tổng token/cost các session cũ? | `piagent-usage --history /path/to/project --days 7` |
|
|
528
565
|
| CSV report cuối tuần toàn máy? | `piagent-usage --history --all-projects --days 7 --csv` |
|