@piagent/platform 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -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.1.0 - 2026-07-26
6
+
7
+ A document downloaded outside the repository can now be read by the agent, and the two documented install commands stop disagreeing about MCP.
8
+
9
+ ### Added
10
+
11
+ - Added `piagent_document_read`, which reads a document from a directory outside the project. Downloading a spec to `~/Downloads` and then having no way to hand it to the agent was a dead end with no workaround short of copying the file into the repository. A directory is granted through `additionalReadRoots` in the project profile or the `PIAGENT_ADDITIONAL_READ_ROOTS` environment variable, and the grant widens only where documents may come from. It is read-only. It accepts `.md`, `.markdown`, `.txt`, `.text`, `.csv`, `.tsv`, `.json`, `.yaml`, `.yml`, `.pdf`, and `.docx`, and refuses every other extension sitting in the same directory. `protectedPaths` still wins over it, matched against both the absolute and the project-relative form of the path so that root-anchored patterns are not silently skipped, and a capability pack that narrows filesystem read scope still narrows it for documents inside the project. Both the containment check and the extension check are made against the canonical path, so a link named `notes.md` cannot hand over the key file it points at.
12
+ - `.docx` is read without a dependency, from a bounds-checked archive reader that names what was wrong with a malformed file rather than reporting every failure as a missing document. Text struck out by an unaccepted tracked change is dropped instead of being spliced onto its replacement, tab-stop declarations no longer emit tab characters, field instruction codes are not read as prose, and a character reference outside the Unicode range is left as written rather than ending the read. `.pdf` goes through `pdftotext`, under a timeout, and a missing binary is reported as missing rather than as an empty document. Byte-order-marked UTF-16 is decoded rather than rejected as binary. Returned text is redacted and enclosed in a data region delimited by a marker the document cannot predict, because a downloaded document is exactly the kind of file that carries both a pasted key and a sentence addressed to an agent.
13
+ - Added `npm run site:check`, which verifies the published documentation site at every address it resolves to instead of once through whichever address a browser happened to pick. It requires each address to return the released version, reports a redirect from an address back to its own host as a loop rather than following it, and reports an address the machine cannot route to as unverified rather than as a pass. Release checklist step 8 was a manual look, and a manual look cannot see a partial outage.
14
+
15
+ ### Changed
16
+
17
+ - Raised the pinned Pi Coding Agent and Pi AI host from `0.81.1` to `0.82.0`. `typebox` stays exactly `1.1.38` across both, so the pin moves without a compatibility change. `npm run audit:runtime` on the `0.82.0` tree reports one high advisory, the same already-accepted `GHSA-mh99-v99m-4gvg` under review by 2026-08-25, and no critical. Verified against a real `0.82.0` host: runtime policy smoke and `team-doctor --strict-share` both pass with no warnings.
18
+ - `piagent-install` now installs the MCP baseline by default, the same as `piagent-setup` already did, and both accept `--no-mcp` to skip it. The two documented entry points disagreed: `piagent-setup` defaulted to installing MCP and `piagent-install` defaulted to not installing it, so a newcomer who followed the team onboarding document ended up with no MCP at all — and was then told to run `/mcp`, because the installer printed that next step whether or not it had installed anything. That next step is now printed only when MCP was installed, and `--mcp-preset` combined with `--no-mcp` fails instead of being accepted and quietly dropped.
19
+ - Cut the command count in the three places a new user actually lands. The README went from 28 shell blocks to 4 and now opens with install rather than four variants of a wrapper for software the reader has not installed yet; the Vietnamese quickstart went from 23 to 7 and its install step from 120 lines to 28; the documentation site's onboarding flow went from eight install command cards to one. Pinned rollouts, updates, rollback, the `--dev` channel, and per-tool command lists were not deleted — every one of them already had a dedicated document, and each is now linked from where it used to be inlined.
20
+
21
+ ### Fixed
22
+
23
+ - Writing MCP server definitions now says what each server still needs before it can connect: Chrome for the Chrome DevTools server, Docker plus `GITHUB_PERSONAL_ACCESS_TOKEN` for the GitHub server. Servers connect lazily, so a successful install proved nothing about whether they would work, and the Docker requirement existed only in a description string visible under `piagent-mcp --list`. The note goes to stderr so the report on stdout stays machine-readable, and `--list` now carries the same requirements as data.
24
+ - An advisory tool-registry verdict is now shown. `toolRegistry` defaults to `advisory` and the evaluation returned a `warn` decision, but the hook acted only on `block`, so the verdict was computed and discarded — advisory mode was indistinguishable from off, and the documentation said the agent received a warning. The notice is emitted once per tool per session, because one on every call would be noise rather than a warning.
25
+ - `piagent-uninstall --with-addons` now reports the MCP baseline file that install actually writes. It named the Pi-global override path while install writes the shared global path, so an operator following the printed advice inspected the wrong file — usually an empty one, which reads as "already clean".
26
+ - Project onboarding now says that the `.mcp.json` files it writes are empty on purpose and that the shared baseline lives in the global config. An empty file in a fresh project reads as a failed install.
27
+ - Documented that `mcpCapabilities` in a project profile, the `github` key in the policy tool registry, and the `github` MCP server are three unrelated things that share a name. No code maps a capability name to an MCP server, so declaring `github` in a profile does not enable the GitHub server and never did.
28
+ - `piagent-init` running from an installed package now writes `npm:@piagent/platform@<version>` into project settings, matching what `piagent-setup` already did. It is the second way a project gets its settings written, and it still wrote the directory the platform happened to be installed in — a value that means nothing on a teammate's machine, in a file meant to be committed.
29
+ - Documentation-coverage checks in the local gate now name the term that went missing and the files searched. They were bare `grep >/dev/null` calls under `set -e`, so dropping a term from a document failed the gate with exit 1 and no output at all. The gate's `npm test` and `npm run typecheck` steps had the same defect from the other direction — their output went to `/dev/null` on every run, so a failing test ended the gate with no indication of which test failed. Both now stay quiet on success and print what they captured on failure.
30
+ - Documented that `piagent-setup` installs the Herdr Pi integration when `herdr` is on `PATH`, and that installing Herdr afterwards needs `piagent-setup --global-only` to pick it up. The behaviour has always been the default and the skip is only a warning on stderr, so the ordering was discoverable only by reading the installer. Herdr is also now named as the way to run several Pi panes at once in the README, the quickstart, and the documentation site, none of which mentioned it, and every one of those places now carries the install command itself rather than a link to go find it. The `brew` form is listed beside the `curl` form that herdr.dev leads with, because piping a fetched script to a shell is worth an alternative in a project that pins everything else it installs.
31
+ - Folded a stale `Unreleased` section into v1.0.0, where its contents actually shipped. It had been left behind by the namespace rename and still described tools as `company_orchestration_policy`, `company_profile_tech_options`, `company_profile_tech_apply`, `company_profile_tech_context_record`, and `/company-orchestration`, none of which exist.
32
+
5
33
  ## v1.0.2 - 2026-07-25
6
34
 
7
35
  Install and uninstall become two commands each. The five-command sequence was never the shortest path; it was the only one that produced a project configuration a teammate could use.
@@ -43,6 +71,8 @@ Breaking release. The `company` namespace is replaced by `piagent` with no alias
43
71
  - Added a golden enforcement suite covering protected paths, protected paths reached through the shell, destructive shell decisions, verification evidence, context budget ceilings, and secret redaction, with a valid and an invalid fixture for every shipped schema.
44
72
  - Added contributor documentation: `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, pull-request and issue templates.
45
73
  - Added a tag-driven publish workflow with npm provenance and pinned action revisions.
74
+ - Added a solo-first orchestration policy covering bounded subagent usage, review lenses, Field Guide status, and model-role guidance, surfaced by `piagent_orchestration_policy` and `/piagent-orchestration` so status reads without a model follow-up. Task contracts gained `workPlan`, `reviewLenses`, and `orchestration` snapshots to record it.
75
+ - Added select-style profile tech setup through `/profile setup` and `/profile tech setup`, including fullstack frontend, backend, and database selections. `piagent_profile_tech_options`, `piagent_profile_tech_apply`, and `piagent_profile_tech_context_record` produce Context7-ready stack manifests and per-tech snapshots.
46
76
 
47
77
  ### Changed
48
78
 
@@ -52,6 +82,9 @@ Breaking release. The `company` namespace is replaced by `piagent` with no alias
52
82
  - The package is now published rather than private, scoped as `@piagent/platform` with public access and provenance.
53
83
  - Split shell and external-action classification, shared types, and filesystem helpers out of the guard into their own modules. Behaviour is unchanged.
54
84
  - Onboarding now names instruction files written for other agents, states plainly that their rules are not in effect, and offers the import; anything inside them is treated as data.
85
+ - `/task`, `/plan`, `/review`, the subagent prompts, and the team docs now prefer one parent agent plus bounded scout, planner, and reviewer usage instead of broad swarm-style delegation.
86
+ - Onboarding and docs treat profile family and project tech stack as explicit operator selections rather than long model explanations, and `/profile` status and list output stay compact around the single namespace and the next exact command.
87
+ - Runtime support is stated across macOS Apple Silicon, macOS Intel, Linux x64 and ARM64, native Windows, and WSL2, and the installer and doctor report the runtime surface they are actually on.
55
88
 
56
89
  ### Fixed
57
90
 
@@ -60,34 +93,14 @@ Breaking release. The `company` namespace is replaced by `piagent` with no alias
60
93
  - Excluded maintainer working notes from the published tarball. The `files` allowlist takes precedence over `.npmignore`, so the exclusions live in `files`.
61
94
  - Fixed the package manifest declaring its extension entry points as a directory glob. Pi calls the default export of every path the field matches, so once the guard's helpers moved into modules beside it, the glob offered Pi two modules that export helpers and no extension factory. The manifest now names the guard, and the package still carried the old `@pi-agent/core` name the namespace rename was meant to retire.
62
95
  - Fixed the verify workflow, which had been unparseable since the runtime-platform step was added and so had not run at all. A single-line `run:` value containing `": "` ends the YAML scalar early; GitHub reports that as an instant failure with no job, so the gate was absent while still appearing present. The local gate now refuses that shape.
96
+ - Fixed orchestration config normalization so a malformed numeric setting falls back to a safe value instead of producing invalid policy state.
97
+ - Fixed tag CI verification, which checked tag object type and peeled commit identity without first fetching the annotated release tag ref.
98
+ - Profile doctor and team doctor now warn on entries that appear only in `shellProtectedPaths`. Those paths block shell access alone; write protection requires `protectedPaths` or `readOnlyPaths`, and the warning names the move.
63
99
 
64
100
  ### Security
65
101
 
66
102
  - The runtime host audit now names the one advisory it accepts instead of running at a blanket severity threshold. `GHSA-mh99-v99m-4gvg` (`brace-expansion`, denial of service) is accepted with its reasoning recorded in `scripts/check-runtime-advisories.mjs`: the Pi host publishes an `npm-shrinkwrap.json` that pins the affected version, a published shrinkwrap takes precedence over consumer overrides, and every released host carries a high `brace-expansion` advisory, so no host version and no change in this repository can resolve it. Every other high or critical advisory still fails the audit, the entry expires on a review date, and it fails once the advisory stops being reported so it cannot outlive the problem.
67
103
 
68
- ## Unreleased
69
-
70
- ### Added
71
-
72
- - Added solo-first orchestration policy for bounded subagent usage, review lenses, Field Guide status, and model-role guidance.
73
- - Added `company_orchestration_policy` and `/company-orchestration` for compact local orchestration status without a model follow-up.
74
- - Added task-contract fields for `workPlan`, `reviewLenses`, and `orchestration` snapshots.
75
- - Added select-style profile tech setup via `/profile setup` and `/profile tech setup`, including fullstack FE/BE/database selections.
76
- - Added `company_profile_tech_options`, `company_profile_tech_apply`, and `company_profile_tech_context_record` for Context7-ready tech stack manifests and concise per-tech snapshots.
77
-
78
- ### Changed
79
-
80
- - Updated `/task`, `/plan`, `/review`, subagent prompts, and team docs to prefer one parent agent plus bounded scout/planner/reviewer usage instead of broad swarm-style delegation.
81
- - Updated onboarding/docs to treat profile family and project tech stack as explicit operator selections instead of long model explanations.
82
- - Tightened `/profile` status/list output around the single namespace and next exact command so the default path stays compact.
83
- - Clarified runtime support across macOS Apple Silicon, macOS Intel, Linux x64/ARM64, native Windows, and WSL2, and made installer/doctor output report the current runtime surface.
84
-
85
- ### Fixed
86
-
87
- - Hardened orchestration config normalization so malformed numeric settings fall back safely instead of producing invalid policy state.
88
- - Fixed tag CI verification by fetching the annotated release tag ref before checking tag object type and peeled commit identity.
89
- - Added profile-doctor and team-doctor warnings for legacy `shellProtectedPaths`-only entries, clarifying that those paths block shell access only and must move to `protectedPaths` or `readOnlyPaths` for write protection.
90
-
91
104
  ## v0.4.8 - 2026-07-22
92
105
 
93
106
  ### Added
package/README.md CHANGED
@@ -4,35 +4,66 @@ Reusable Pi package for project onboarding, profile-based coding workflows, guar
4
4
 
5
5
  Public docs: [piagent.io.vn](https://piagent.io.vn)
6
6
 
7
- The goal is a simple daily flow:
7
+ ## Install
8
+
9
+ Node.js `>=22.19.0`. Two commands, run from the project you want to set up:
8
10
 
9
11
  ```bash
10
- cd /path/to/project
11
- pi
12
+ npm install -g @piagent/platform
13
+ piagent-setup
12
14
  ```
13
15
 
14
- From there, Pi can onboard the project, select an operating profile, use the right tools, record task evidence, and hand off verified implementation work.
16
+ `piagent-setup` installs the exact Pi Coding Agent host this release pins, installs the Pi package, initializes the current directory, and runs the doctor. It also installs the MCP baseline, the subagents, and — when `herdr` is already on `PATH` — the Herdr Pi integration; pass `--no-mcp`, `--no-subagents`, `--no-herdr`, or `--global-only` to skip those.
15
17
 
16
- For a trusted project where you want Pi to load project-local `.pi` resources without another trust prompt on that run:
18
+ If you want [Herdr](https://herdr.dev/docs/install/), install it *before* `piagent-setup`:
17
19
 
18
20
  ```bash
19
- cd /path/to/project
20
- piagent-auto
21
+ brew install herdr # macOS
22
+ curl -fsSL https://herdr.dev/install.sh | sh # macOS or Linux
21
23
  ```
22
24
 
23
- Read-only scout mode:
25
+ The integration step is skipped with a warning when `herdr` is not on `PATH`, so installing Herdr afterwards means running `piagent-setup --global-only` again. The `curl` form runs a script fetched at install time; `brew` and the [GitHub releases](https://github.com/ogulcancelik/herdr/releases) are the reviewable alternatives. Stable Herdr covers macOS and Linux — Windows builds are preview only, which is outside this platform's rollout matrix either way.
26
+
27
+ Because it runs from an installed package, the source it writes into `.pi/settings.json` is `npm:@piagent/platform@<version>` — which means the same thing on a teammate's machine, so the file can be committed.
28
+
29
+ | Runtime surface | Team rollout status |
30
+ |---|---|
31
+ | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. |
32
+ | Linux x64 + Bash | Verified in CI for this release. |
33
+ | macOS Intel (`darwin/x64`) + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
34
+ | Linux ARM64 + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
35
+ | Native Windows | Not a team-rollout target yet; terminal helpers and shell policy rely on Bash/POSIX semantics. |
36
+ | WSL2 | Experimental and not release-gated yet. |
37
+
38
+ Pinned step-by-step rollouts, updates, rollback, and the fast-moving `--dev` channel are in [Release and install policy](docs/release-install-policy.md).
39
+
40
+ ## Daily use
24
41
 
25
42
  ```bash
26
- piagent-auto --read-only -p "Scout payment mapping. Do not edit source."
43
+ cd /path/to/project
44
+ pi
27
45
  ```
28
46
 
29
- Trusted full-access style run:
47
+ That is the daily flow. Pi onboards the project, selects an operating profile, uses the right tools, records task evidence, and hands off verified implementation work.
48
+
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
+
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/*`.
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).
54
+
55
+ ## Uninstall
56
+
57
+ `piagent-uninstall` reports what it would remove and exits. It only acts with `--apply`, because it edits Pi settings that other tools also write to.
30
58
 
31
59
  ```bash
32
- piagent-auto --full-access -p "Run the trusted local benchmark suite."
60
+ piagent-uninstall
61
+ piagent-uninstall --apply
33
62
  ```
34
63
 
35
- `piagent-auto` is a convenience wrapper for Pi project trust (`pi --approve`). It does not bypass protected-path checks, destructive shell checks, task gates, or verification evidence.
64
+ That removes the Pi package this platform registered. Add-ons, the Pi host, a project's state, and the npm-global helper are each opt-in and separate — `piagent-uninstall --help` lists them.
65
+
66
+ Removal targets what is registered in Pi's settings rather than what the current version installs, so a package registered by an older release still comes out. Credentials, trust decisions, sessions, todos, and project memory are never removed, at any flag combination. Files written from a template and then edited — `AGENTS.md`, `.pi/settings.json`, `.pi/project-context.md` and the like — are listed for review rather than deleted.
36
67
 
37
68
  ## What it provides
38
69
 
@@ -96,172 +127,23 @@ Inside Pi:
96
127
 
97
128
  This shows the active mode, max subagents, review lenses, Field Guide path, and writer policy without triggering a model follow-up.
98
129
 
99
- ## Install
100
-
101
- Supported for this release:
102
-
103
- | Runtime surface | Team rollout status |
104
- |---|---|
105
- | macOS Apple Silicon (`darwin/arm64`) + Bash | Verified for this release. |
106
- | Linux x64 + Bash | Verified in CI for this release. |
107
- | macOS Intel (`darwin/x64`) + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
108
- | Linux ARM64 + Bash | Supported target, but run `piagent-doctor` and project smoke tests before wide rollout. |
109
- | Native Windows | Not a team-rollout target yet; terminal helpers and shell policy rely on Bash/POSIX semantics. |
110
- | WSL2 | Experimental and not release-gated yet. |
111
-
112
- Node.js `>=22.19.0` is required. Two commands:
130
+ ## Profiles
113
131
 
114
- ```bash
115
- npm install -g @piagent/platform
116
- piagent-setup
117
- ```
118
-
119
- `piagent-setup` installs the exact Pi Coding Agent host this release pins, installs the Pi package, initializes the current directory, and runs the doctor. Run it from the project you want to set up. It also installs the MCP baseline and subagents; pass `--no-mcp` and `--no-subagents` to skip them, or `--global-only` to install nothing into a project.
120
-
121
- Because it is running from an installed package, the source it writes into `.pi/settings.json` is `npm:@piagent/platform@<version>`, which means the same thing on a teammate's machine.
122
-
123
- To install each component explicitly instead — for a pinned team rollout where every step is reviewed:
124
-
125
- ```bash
126
- node --version # >= 22.19.0
127
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
128
- npm install -g --ignore-scripts @piagent/platform@1.0.2
129
- piagent-install --stable --dry-run
130
- piagent-install --stable
131
- ```
132
-
133
- `piagent-install --stable` resolves the helper's release tag to a commit SHA and installs the matching Pi package. In its output, `currentRelease` is the version of the terminal helper currently executing. The project release matrix above defines which OS/CPU surfaces this platform has verified.
134
-
135
- If you only need to install the Pi package and do not need the `piagent-*` terminal commands, pin the current release tag or a reviewed commit directly:
136
-
137
- ```bash
138
- pi install git:github.com/Vt-mmm/piagent@v1.0.2
139
- ```
140
-
141
- From a checked-out platform repo, the same helper is available as a script:
142
-
143
- ```bash
144
- bash scripts/install-global.sh --stable --dry-run
145
- bash scripts/install-global.sh --stable
146
- ```
147
-
148
- For a full update, update the exact Pi host first, then the npm-global helper, then apply its matching stable Pi package:
149
-
150
- ```bash
151
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.81.1
152
- npm install -g --ignore-scripts @piagent/platform@X.Y.Z
153
- piagent-install --stable --dry-run
154
- piagent-install --stable
155
- ```
156
-
157
- For rollback, read the target release's compatibility section and install its exact Pi host before changing the helper to `vPREVIOUS`; older hosts may reintroduce known dependency findings. If you intentionally want to change only the Pi package while keeping the terminal helper at its current version:
158
-
159
- ```bash
160
- piagent-install --version vX.Y.Z --resolve-tag --dry-run
161
- piagent-install --version vX.Y.Z --resolve-tag
162
- ```
163
-
164
- Use latest only for a personal machine or sandbox where fast updates are acceptable:
165
-
166
- ```bash
167
- bash scripts/install-global.sh --dev --dry-run
168
- bash scripts/install-global.sh --dev
169
- ```
170
-
171
- Optional Herdr integration:
172
-
173
- ```bash
174
- herdr integration install pi
175
- ```
176
-
177
- ## Uninstall
178
-
179
- `piagent-uninstall` reports what it would remove and exits. It only acts with `--apply`, because it edits Pi settings that other tools also write to.
180
-
181
- ```bash
182
- piagent-uninstall
183
- piagent-uninstall --apply
184
- ```
185
-
186
- That removes the Pi package this platform registered. Everything beyond it is opt-in:
187
-
188
- ```bash
189
- piagent-uninstall --apply --with-addons # pi-mcp-adapter, pi-subagents, pi-web-access
190
- piagent-uninstall --apply --with-host # the Pi Coding Agent host
191
- piagent-uninstall --apply --project /path/to/project # a project's profile, lock, and runtime state
192
- npm uninstall -g @piagent/platform # the npm-global helper, removed separately
193
- ```
194
-
195
- Removal targets what is registered in Pi's settings rather than what the current version installs, so a package registered by an older release still comes out.
196
-
197
- Credentials, trust decisions, sessions, todos, and project memory are never removed, at any flag combination. Files written from a template and then edited — `AGENTS.md`, `.pi/settings.json`, `.pi/project-context.md` and the like — are listed for review rather than deleted. A project's `.pi/settings.json` keeps every setting except the package entry pointing at this platform.
198
-
199
- ## Daily use
200
-
201
- ```bash
202
- cd /path/to/project
203
- pi
204
- ```
205
-
206
- First run inside a project:
132
+ Switching profile is one command inside Pi:
207
133
 
208
134
  ```text
209
- /login
210
- /model
211
- /scoped-models # optional: customize Ctrl+P model cycle
212
- /piagent-commands
213
- /mcp # inspect MCP servers
214
- /subagents-doctor # health check
215
- /onboard-project
216
- /memory-policy
135
+ /profile # status
136
+ /profile fullstack # apply
137
+ /profile setup # select profile, then select the tech for each role
217
138
  ```
218
139
 
219
- `/onboard-project` will inspect the repository with bounded context, recommend a profile, explain tradeoffs, ask before applying, then write:
220
-
221
- - `.pi/piagent-profile.json`
222
- - `.pi/piagent-profile.lock.json`
223
- - `.pi/tech-stack.json`
224
- - `.pi/tech-context/*`
225
- - `.pi/project-context.md`
226
- - `.pi/memory/*`
227
-
228
- Switch profiles later:
229
-
230
- ```text
231
- /profile # short status, no model follow-up
232
- /profile list # compact profile list
233
- /profile fullstack # apply immediately
234
- /profile be-readonly-fe # apply immediately
235
- /profile web-frontend # apply immediately
236
- /profile backend-api # apply immediately
237
- /profile auto # apply detected recommendation
238
- /profile fe # alias for web-frontend
239
- /profile be-fe # alias for be-readonly-fe
240
- /profile setup # select profile, then select role tech
241
- /profile setup fullstack # select FE, BE, and database tech
242
- /profile tech # short tech stack status
243
- /profile tech setup fullstack
244
- /profile tech apply fullstack frontend=nextjs backend=nestjs database=prisma
245
- ```
246
-
247
- The setup flow prefers native select UI. If the Pi host does not expose a select control yet, it falls back to a compact options card and an exact `/profile tech apply ...` command instead of asking the model to explain every option.
140
+ `/profile list` shows every profile and its aliases. The setup flow prefers a native select UI; where the Pi host has no select control, it falls back to a compact options card and an exact `/profile tech apply ...` line rather than asking the model to explain every option.
248
141
 
249
142
  ## Capability packs
250
143
 
251
- Capability packs group governed prompts, skills, subagents, policies, adapters, recipes, and eval scenarios behind a declarative manifest. Project profiles select exact pack versions and explicitly grant owner, lifecycle, filesystem, network, and external-action boundaries.
144
+ Capability packs group governed prompts, skills, subagents, policies, adapters, recipes, and eval scenarios behind a declarative manifest. Project profiles select exact pack versions and explicitly grant owner, lifecycle, filesystem, network, and external-action boundaries. The generated lock is deterministic and records profile, pack, artifact, and permission digests.
252
145
 
253
- ```bash
254
- piagent-capabilities catalog --check
255
- piagent-capabilities doctor \
256
- --profile .pi/piagent-profile.json \
257
- --lock .pi/piagent-profile.lock.json
258
- piagent-capabilities resolve \
259
- --profile .pi/piagent-profile.json \
260
- --output .pi/piagent-profile.lock.json \
261
- --package-source ../
262
- ```
263
-
264
- The generated lock is deterministic and records profile, pack, artifact, and permission digests. See [Capability packs](docs/capability-packs.md).
146
+ Commands and lock format: [Capability packs](docs/capability-packs.md).
265
147
 
266
148
  ## Built-in profiles
267
149
 
@@ -281,125 +163,34 @@ The generated lock is deterministic and records profile, pack, artifact, and per
281
163
 
282
164
  ## Main workflows
283
165
 
284
- ### General implementation
285
-
286
- ```text
287
- /task Implement <bounded task>. Follow profile, required context, protected paths, verify commands, and trace.
288
- ```
289
-
290
- Use `/task` when the requirement is clear enough to implement.
291
-
292
- ### Guarded Git workflows
293
-
294
- Pi Agent intentionally keeps Git as a capability instead of adding a `/git-*` namespace. Use short workflow commands or natural language:
295
-
296
- ```text
297
- /commit docs: update onboarding notes
298
- /pr Add guarded git workflow
299
- ```
300
-
301
- `/commit` starts a governed local-commit workflow: inspect status/diff, stage only the intended files, run relevant verification, then commit locally. It does not push.
302
-
303
- `/pr` starts a governed pull-request workflow: inspect branch/status/commits, handle uncommitted changes explicitly, then ask for confirmation before any `git push` or GitHub PR create/update action. Draft PRs are the default unless the user asks for ready-for-review.
304
-
305
- Broad staging commands such as `git add .`, `git add -A`, `git add --all`, `git add -- .`, and `git add :/` require confirmation so unrelated or private files are not swept into a commit silently.
306
-
307
- For read-only investigation:
308
-
309
- ```text
310
- /scout Scout <module/spec/contract/risk>. Do not edit source.
311
- ```
312
-
313
- Use `/scout` for payment/auth/data/BE-contract mapping before deciding whether to implement.
314
-
315
- When the current session is already heavy, use the fresh workflow commands. They open a new governed Pi session and replay the compact workflow prompt automatically:
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.
316
167
 
317
- ```text
318
- /fresh-task <request>
319
- /fresh-scout <read-only request>
320
- /fresh-be-to-fe <backend-readonly/frontend request>
321
- ```
322
-
323
- The input guard also collapses pasted mandatory-flow boilerplate automatically. Users should not paste the full piagent checklist into every task.
324
-
325
- ### Screenshots and local images
326
-
327
- If a chat box paste or screen capture produces a local image path instead of a native Pi image attachment, paste the path directly in the task:
328
-
329
- ```text
330
- /scout Check this UI state from screenshot /var/folders/.../screenshot.png
331
- ```
332
-
333
- The input guard converts supported local image paths (`.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`) into Pi image attachments and rewrites the prompt to:
334
-
335
- ```text
336
- /scout Check this UI state from screenshot [image1]
337
- ```
338
-
339
- Limits: up to 4 chat images, 8 MB each. For oversized images, use Pi's `read` tool on the file so Pi can resize it.
340
-
341
- ### Project improvement
342
-
343
- ```text
344
- /platform-improve Improve <platform/setup/workflow behavior>. Update docs and verification.
345
- ```
346
-
347
- Use `/platform-improve` for package-level work such as setup, MCP, model scope, memory, runtime policy, prompts, skills, or subagent workflows.
348
-
349
- ### Backend spec to frontend
350
-
351
- ```text
352
- /profile be-readonly-fe
353
- /be-to-fe Implement frontend support for <backend endpoint/spec>. Backend is read-only.
354
- ```
168
+ | Command | Use when |
169
+ |---|---|
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. |
355
180
 
356
- Use `/be-to-fe` when the backend/spec must be inspected read-only and the implementation target is frontend.
181
+ 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.
357
182
 
358
- ### Planning and clarification
183
+ Paste a local screenshot path straight into a task and the guard attaches it as `[image1]` before the model sees the prompt: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, up to 4 images at 8 MB each. The guard also collapses pasted mandatory-flow boilerplate, so there is no need to paste a checklist into every task.
359
184
 
360
- ```text
361
- /discuss <rough request>
362
- /plan <goal>
363
- /review current diff
364
- ```
185
+ A spec that lives outside the project — the one just downloaded to `~/Downloads` — is read with `piagent_document_read` once its directory is listed in the profile's `additionalReadRoots`. The grant is read-only, covers `.md`, `.txt`, `.csv`, `.json`, `.yaml`, `.pdf`, and `.docx` only, and does not open anything `protectedPaths` covers. See [command reference](docs/command-reference-vietnamese.md).
365
186
 
366
187
  ## Model selection
367
188
 
368
- Model selection is handled by Pi’s native UI.
369
-
370
- ```text
371
- /model # selector
372
- Ctrl+L # selector hotkey
373
- /scoped-models # edit model cycle scope
374
- Ctrl+P # cycle scoped models
375
- Shift+Tab # cycle thinking level when supported by the selected model
376
- ```
377
-
378
- Global setup can seed `enabledModels`. To inspect or re-apply:
379
-
380
- ```bash
381
- piagent-models
382
- piagent-model-scope --preset full
383
- ```
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.
384
190
 
385
191
  ## MCP setup
386
192
 
387
- Global setup installs `pi-mcp-adapter` and seeds the `core` MCP preset unless disabled.
388
-
389
- ```bash
390
- piagent-mcp --preset core --scope global --replace
391
- piagent-mcp --preset popular --scope global --replace
392
- piagent-mcp --preset design --scope project --project /path/to/project
393
- piagent-mcp --list
394
- ```
395
-
396
- If the repo is cloned from Git and npm bins are not linked yet:
397
-
398
- ```bash
399
- bash /path/to/piagent/scripts/configure-mcp.sh --preset core --scope global --replace
400
- ```
401
-
402
- Preset summary:
193
+ `piagent-setup` and `piagent-install` both install `pi-mcp-adapter` and seed the `core` preset. Pass `--no-mcp` to skip it.
403
194
 
404
195
  | Preset | Includes |
405
196
  |---|---|
@@ -407,59 +198,15 @@ Preset summary:
407
198
  | `popular` | core + Playwright + Figma remote |
408
199
  | `all` | popular + Figma desktop/local |
409
200
 
410
- Keep secrets in environment variables, never in committed config:
201
+ Seeding writes server definitions; it does not start or authenticate anything. Servers connect lazily, so each one needs its own prerequisite before its first call: Chrome DevTools needs a local Chrome, and GitHub needs Docker running plus `GITHUB_PERSONAL_ACCESS_TOKEN` exported. `piagent-mcp --list` prints what each server requires. Project-scope `.mcp.json` files ship empty on purpose — the shared baseline is the global config, not the project one.
411
202
 
412
- ```bash
413
- export CONTEXT7_API_KEY=ctx7sk_...
414
- export GITHUB_PERSONAL_ACCESS_TOKEN=<github-token>
415
- ```
203
+ Keep provider keys in environment variables, never in committed config. Switching presets and per-project scoping: [MCP and tools](docs/mcp-and-tools.md).
416
204
 
417
205
  ## Subagents
418
206
 
419
- Global setup installs `pi-subagents` and applies the `safe` preset unless disabled.
420
-
421
- ```bash
422
- piagent-subagents --preset safe
423
- ```
207
+ `piagent-setup` installs `pi-subagents` with the `safe` preset unless disabled. Daily task prompts stay solo-first: they delegate bounded scout, planning, and review work only when it is independent enough to be worth the cost, and the final handoff states whether subagents were used and why.
424
208
 
425
- Fallback when cloned from Git without npm bins:
426
-
427
- ```bash
428
- bash /path/to/piagent/scripts/configure-subagents.sh --preset safe
429
- ```
430
-
431
- Common Pi commands:
432
-
433
- ```text
434
- /subagents-doctor
435
- /subagents-models
436
- /subagents-fleet
437
- /subagent-cost
438
- /run piagent-scout "Map the auth flow. Read-only."
439
- /run piagent-planner "Plan implementation from context.md."
440
- /run piagent-worker "Implement the approved plan."
441
- /run piagent-reviewer "Review current diff."
442
- ```
443
-
444
- Daily task prompts are solo-first: they can delegate bounded scout/planning/review work when useful, and the final handoff should state whether subagents were used and why.
445
-
446
- Optional web/docs research support:
447
-
448
- ```bash
449
- pi install npm:pi-web-access@0.13.0
450
- ```
451
-
452
- ## Optional preseed setup
453
-
454
- Most projects do not need shell init. Use this only when you want to pre-create `.pi` files in a repo or bootstrap team templates:
455
-
456
- ```bash
457
- bash /path/to/piagent/scripts/setup.sh /path/to/project \
458
- --profile be-readonly-fe \
459
- --package-source git:github.com/Vt-mmm/piagent@v1.0.2 \
460
- --mcp-preset core \
461
- --subagents-preset safe
462
- ```
209
+ `/subagents-doctor` runs a health check; `/run piagent-scout "…"` and its planner, worker, and reviewer counterparts dispatch work. See [Subagents and multi-agent](docs/subagents-and-multiagent.md).
463
210
 
464
211
  ## Repository layout
465
212
 
@@ -479,49 +226,13 @@ piagent/
479
226
 
480
227
  ## Verification
481
228
 
482
- ```bash
483
- npm ci --ignore-scripts --legacy-peer-deps
484
- npm run typecheck
485
- npm test
486
- npm run benchmark:redaction
487
- bash scripts/verify-local.sh
488
- bash scripts/team-doctor.sh . --strict-share
489
- pi list --approve
490
- ```
491
-
492
- Quality benchmark:
493
-
494
- ```bash
495
- bash scripts/quality-benchmark.sh /path/to/project --init
496
- bash scripts/quality-benchmark.sh /path/to/project --record \
497
- --scenario bounded-source-fix \
498
- --surface pi \
499
- --result pass \
500
- --tokens 12345 \
501
- --verify "npm test"
502
- ```
503
-
504
- Sensitive-data redaction benchmark:
229
+ One command runs the full local gate — typecheck, tests, capability catalog, doctor, and the scaffold check:
505
230
 
506
231
  ```bash
507
- npm run benchmark:redaction
508
- ```
509
-
510
- Usage / token follow-up:
511
-
512
- ```text
513
- /task-preflight
514
- /task-preflight compact
515
- /piagent-usage
516
- /session
232
+ npm run verify
517
233
  ```
518
234
 
519
- From another terminal:
520
-
521
- ```bash
522
- piagent-usage /path/to/project
523
- bash scripts/pi-session-stats.sh /path/to/project
524
- ```
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).
525
236
 
526
237
  ## Public safety
527
238
 
@@ -559,6 +270,7 @@ This repository intentionally excludes:
559
270
  - [Subagent orchestration capabilities](docs/subagent-orchestration-capabilities.md)
560
271
  - [Context-window policy](docs/context-window-policy.md)
561
272
  - [Memory policy](docs/memory-policy.md)
273
+ - [Task lifecycle tiếng Việt](docs/task-lifecycle-vietnamese.md)
562
274
  - [Task implementation contract](docs/task-implementation-contract.md)
563
275
  - [Runtime quality baseline](docs/runtime-quality-baseline.md)
564
276
  - [Usage observability](docs/usage-observability.md)
@@ -571,7 +283,7 @@ This repository intentionally excludes:
571
283
 
572
284
  ## Maturity
573
285
 
574
- 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.0.2` or a reviewed commit.
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.1.0` or a reviewed commit.
575
287
 
576
288
  Ready for:
577
289