@maxiaochao/pi-toolkit 0.10.0 → 0.10.2

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
@@ -1,3 +1,19 @@
1
+ ## 2026-10-08 - v0.10.2
2
+
3
+ - bundle herdr-subagents v0.3.0: split execution and control tools and unify task runs
4
+ - Bundle the Herdr Subagents execution/control tool split and unified non-empty `tasks` input for single and multi-task runs.
5
+
6
+ ## 2026-10-08 - v0.10.1
7
+
8
+ - bundle herdr-subagents v0.2.1: add default thinking configuration and inline Herdr workflow video
9
+ - remove the bundled `calldiff` skill
10
+ - add merged global/project `defaultThinking` for Herdr Subagents, below persona-specific thinking and above parent-session fallback
11
+ - embed the Herdr workflow video directly in the GitHub README, retain the reproducible WebM source, and remove the GIF preview
12
+ - document every Herdr Subagents settings and persona option, accepted values, defaults, configuration paths, examples, and exact precedence
13
+ - add a full real-time Herdr Subagents WebM recording that focuses every child Agent pane before returning to the parent summary
14
+
15
+ - replace the rendered Herdr transcript demo with a real UI recording of a parent Pi conversation opening and completing three concurrent interactive Agent panes
16
+
1
17
  ## 2026-10-08 - v0.10.0
2
18
 
3
19
  - bundle herdr-subagents v0.2.0: replace Tiny Subagent with visible interactive Herdr agents and durable batch workflows
package/README.md CHANGED
@@ -66,7 +66,6 @@ bash scripts/install.sh
66
66
  | `herdr` | Control Herdr workspaces, tabs, panes, and agents |
67
67
  | `agent-team` | Run cross-vendor adversarial review through Herdr |
68
68
  | `tapd` | Use the TAPD CLI for requirements, defects, tasks, and wikis |
69
- | `calldiff` | Diff call stacks across commits |
70
69
 
71
70
  Package-specific skills, such as `pi-worktree`, are documented by their child package.
72
71
 
package/global/AGENTS.md CHANGED
@@ -4,71 +4,54 @@ Behavioral guidelines to reduce common LLM coding mistakes. Project-specific ins
4
4
 
5
5
  ## 1. Think Before Coding
6
6
 
7
- **Surface tradeoffs. Name confusion instead of resolving it silently.**
7
+ - Surface material assumptions, interpretations, and tradeoffs.
8
+ - If unresolved ambiguity would materially change the result, ask. When no human is reachable, choose a defensible interpretation, state it, and proceed with verifiable criteria.
9
+ - Prefer the simpler approach. Name conflicting requirements rather than silently compromising between them.
8
10
 
9
- - State your material assumptions explicitly.
10
- - If multiple interpretations exist, present them rather than picking one silently.
11
- - If a simpler approach exists, say so. Push back when warranted.
12
- - If requirements conflict (durability vs latency, correctness vs speed), name the conflict explicitly. Never average conflicting requirements into something that satisfies neither.
13
- - When unresolved ambiguity would materially change the result, ask. When no human is reachable (headless, async, subagent), choose the interpretation you can defend, state it as an assumption, and proceed under Rule 4.
11
+ ## 2. Minimal Solution
14
12
 
15
- ## 2. Simplicity First
13
+ Understand the problem and relevant code flow before choosing the first rung that works:
16
14
 
17
- **YAGNI cuts what you don't need; KISS keeps what remains simple.**
15
+ 1. Skip functionality that is speculative or was not requested.
16
+ 2. Reuse an existing project abstraction when it encodes the required semantics.
17
+ 3. Otherwise use the standard library or a native platform feature.
18
+ 4. Otherwise use a direct dependency already declared by the project.
19
+ 5. Only then write the minimum custom code that works.
18
20
 
19
- - Build what was asked, for the callers that exist today.
20
- - Introduce an abstraction after repeated use reveals a stable concept.
21
+ - Introduce abstractions only after repeated use reveals a stable concept.
22
+ - Prefer boring, focused code; review long or deeply nested functions for splitting.
23
+ - Never simplify away explicit requirements, trust-boundary validation, data-loss protection, security, or accessibility.
21
24
  - For states excluded by enforced invariants, fail visibly instead of inventing fallback behavior.
22
- - Each function you write does one thing. If it runs past a couple of screens or nests past three levels, review whether splitting it improves clarity.
25
+ - State the ceiling and upgrade trigger of any deliberate simplification that cuts a real corner.
23
26
 
24
- ## 3. Surgical Changes
27
+ ## 3. Skill Boundaries
25
28
 
26
- **Touch only what you must. Clean up only your own mess.**
29
+ After loading a skill, treat its documented interface as sufficient for normal use. Do not inspect the skill's implementation, installed executable, or package source unless the user asks to review, debug, or modify it; its documented behavior conflicts with observed behavior; or required usage details are missing from the skill.
27
30
 
28
- The test: every changed line traces to the user's request, or to a defect that request reveals.
31
+ ## 4. Read, Then Change Surgically
29
32
 
30
- - Match existing style, even if you'd do it differently.
31
- - Remove imports, variables, and functions that YOUR changes made unused. Leave pre-existing dead code in place and mention it.
33
+ Before editing, read the affected public API and its immediate callers. For a bug, find every statically discoverable caller and relevant implementation.
32
34
 
33
- When fixing a bug, fix the root cause, not the symptom. Find where the defect actually lives:
34
- - Find every statically discoverable caller and relevant implementation; a report names a symptom, and patching only the path the ticket mentions leaves sibling callers still broken.
35
- - If the shared function is wrong, fix it once - do not scatter per-caller guards. Name the sibling callers the fix now affects.
36
- - If one caller is wrong, fix that caller - do not add defensive handling to a correct shared function.
35
+ Every changed line traces to the user's request or to a defect that request reveals.
37
36
 
38
- ## 4. Goal-Driven Execution
37
+ - Match existing style.
38
+ - Remove imports, variables, and functions that your changes make unused. Leave pre-existing dead code in place and mention it.
39
+ - Fix a faulty shared function once and name affected sibling callers; if only one caller is wrong, fix that caller instead of guarding a correct shared function.
39
40
 
40
- **Define success criteria. Loop until verified.**
41
+ ## 5. Goal-Driven Execution
41
42
 
42
- Transform tasks into verifiable goals:
43
- - "Add validation" -> "Write tests for invalid inputs, then make them pass"
44
- - "Fix the bug" -> "Write a test that reproduces it, then make it pass"
45
- - "Refactor X" -> "Ensure tests pass before and after"
46
- - "Make X fast" -> "Write and test a simple reference implementation, then optimize against its results"
43
+ - Turn work into checkable outcomes: reproduce bugs before fixing them, preserve behavior during refactors, and optimize against a tested reference implementation.
44
+ - For multi-step or materially ambiguous work, state a brief plan and give every step its own verification.
45
+ - Leave the smallest relevant runnable check for new or changed non-trivial logic. Do not introduce a test framework solely for that check.
47
46
 
48
- For multi-step or materially ambiguous tasks, state a brief plan where every step carries its own check:
49
- 1. [Step] -> verify: [check]
47
+ ## 6. Fail Visibly
50
48
 
51
- Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
52
-
53
- ## 5. Read Before You Write
54
-
55
- **Understand adjacent code before changing it. "Looks orthogonal" is a dangerous assumption.**
56
-
57
- Before changing a file:
58
- - Read the file's exports and public API.
59
- - Read the immediate callers of the function you're modifying.
60
-
61
- ## 6. Fail Visibly, Not Silently
62
-
63
- **Silent skips are failures.**
64
-
65
- - "Completed" is wrong if anything was silently skipped.
49
+ - "Completed" is wrong if anything required was silently skipped.
66
50
  - "Tests pass" is wrong if any required test was skipped or not run.
67
- - If a required input, file, or tool is missing (or a step is impossible under the stated constraints), do NOT fabricate it to make a check pass. Report what is missing and what you need.
51
+ - If a required input, file, or tool is missing, or a step is impossible under the stated constraints, report what is missing and what you need. Never fabricate it to make a check pass.
52
+
53
+ ## 7. Worktree Isolation
68
54
 
69
- ## 7. Reuse Before Writing
55
+ For a Git-repository task that coordinates substantial changes across multiple files or modules, or implements a feature intended for release, ask before editing whether to isolate it in a worktree. Skip the question when already in a linked worktree.
70
56
 
71
- **Before writing new code, check in order:**
72
- 1. Reuse an existing project abstraction when it encodes project semantics. (If it is itself the bug, fix it once - see Rule 3.)
73
- 2. Otherwise use the standard library or a direct dependency already declared by the project.
74
- 3. Only then write it yourself.
57
+ If the user agrees, read the `pi-worktree` skill and establish the worktree before changing code. When no human is reachable, create a worktree only when the task explicitly requests one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxiaochao/pi-toolkit",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Personal pi coding agent toolkit: /todos, /btw, /cache_export and apply_patch extensions, browser automation, and bundled theme/skills.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -1,3 +1,18 @@
1
+ ## 2026-10-08 - v0.3.0
2
+
3
+ - split execution and control tools and unify task runs
4
+ - Split execution and control into `herdr_subagents` and `herdr_subagents_control`; require a non-empty `tasks` array for new runs so one-item runs and batches share background and concurrency semantics.
5
+ - Normalize legacy top-level single-task prompts into one-item task arrays before schema validation.
6
+
7
+ ## 2026-10-08 - v0.2.1
8
+
9
+ - add default thinking configuration and inline Herdr workflow video
10
+ - Add merged global/project `defaultThinking`, below persona-specific thinking and above parent-session fallback, with effective source reporting.
11
+ - Embed the workflow video directly in the GitHub README, retain the reproducible WebM source, and remove the GIF preview.
12
+ - Expand the README with every settings and persona option, accepted values, defaults, paths, examples, and exact model, thinking, skills, and definition precedence.
13
+ - Add a full WebM recording that focuses all three live child Agent panes before returning to the parent summary.
14
+ - Replace the rendered transcript media with a real Herdr UI recording that follows a parent Pi conversation through a three-Agent batch and final compact response.
15
+
1
16
  ## 2026-10-08 - v0.2.0
2
17
 
3
18
  - replace Tiny Subagent with visible interactive Herdr agents and durable batch workflows
@@ -2,11 +2,16 @@
2
2
 
3
3
  A Pi extension that runs focused foreground or background work as normal interactive Pi Agents in visible Herdr panes. Full answers and sessions stay in project-local records while the parent receives only concise summaries and document paths.
4
4
 
5
- ![Herdr Subagents production runner screenshot](docs/screenshot.png)
5
+ ![A parent Pi conversation running three visible Herdr Subagents panes](docs/screenshot.png)
6
6
 
7
7
  ## Demo
8
8
 
9
- ![Herdr Subagents demo](docs/demo.gif)
9
+ The recording shows a real Pi conversation invoking a three-task read-only batch, Herdr opening one interactive Agent pane per task, and the compact results returning to the parent.
10
+
11
+ https://github.com/user-attachments/assets/8ddf3ae6-a11a-492b-9cae-d9496ba65b67
12
+
13
+ The video starts a three-agent batch, focuses each live child pane in turn, then returns
14
+ to the parent summary. The reproducible source recording is retained as [`docs/demo.webm`](docs/demo.webm).
10
15
 
11
16
  ## Requirements and install
12
17
 
@@ -24,7 +29,7 @@ pi update npm:@maxiaochao/pi-herdr-subagents
24
29
 
25
30
  The full `@maxiaochao/pi-toolkit` package also bundles this extension. Install the full toolkit or this standalone child package, not both.
26
31
 
27
- Inside a Herdr workspace, the package registers `herdr_subagents` and `/herdr-subagents`. Outside Herdr (or without a workspace ID), the extension registers neither, so the tool is absent from the model context. Start Pi inside Herdr or reload the extension there to enable them.
32
+ Inside a Herdr workspace, the package registers `herdr_subagents`, `herdr_subagents_control`, and `/herdr-subagents`. Outside Herdr (or without a workspace ID), the extension registers none of them, so these capabilities are absent from the model context. Start Pi inside Herdr or reload the extension there to enable them.
28
33
 
29
34
  The design replaces hidden print-mode subprocesses with ordinary interactive Pi Agents managed through Herdr, so delegated work stays visible, inspectable, resumable, and durably recorded.
30
35
 
@@ -33,16 +38,17 @@ The design replaces hidden print-mode subprocesses with ordinary interactive Pi
33
38
  Discover the effective personas first:
34
39
 
35
40
  ```text
36
- herdr_subagents({ action: "list" })
41
+ herdr_subagents_control({ action: "list" })
37
42
  ```
38
43
 
39
44
  Then run one self-contained task:
40
45
 
41
46
  ```text
42
47
  herdr_subagents({
43
- agent: "worker",
44
48
  label: "auth-review",
45
- prompt: "Inspect the authentication flow and summarize the risks"
49
+ tasks: [
50
+ { name: "auth", agent: "worker", prompt: "Inspect the authentication flow and summarize the risks" }
51
+ ]
46
52
  })
47
53
  ```
48
54
 
@@ -59,21 +65,21 @@ herdr_subagents({
59
65
  })
60
66
  ```
61
67
 
62
- Set `background: true` to return a stable run ID immediately while the queue continues. One run is dispatched at a time by an extension instance; later runs remain queued and start FIFO. Each background run sends one compact parent notification only when the whole run completes, partially fails, fails, or blocks. Individual successful tasks do not wake the parent model.
68
+ `tasks` is always a non-empty array: one item is a single task and multiple items form a batch. Set `background: true` for either form to return a stable run ID immediately while the queue continues. One run is dispatched at a time by an extension instance; later runs remain queued and start FIFO. Each background run sends one compact parent notification only when the whole run completes, partially fails, fails, or blocks. Individual successful tasks do not wake the parent model.
63
69
 
64
- A child missing required information reports `needs-input` with an exact question. The run becomes blocked, keeps its Herdr tab, pane, partial report, and Pi session, and returns control to the parent. Answer through the same tool to continue the original session:
70
+ A child missing required information reports `needs-input` with an exact question. The run becomes blocked, keeps its Herdr tab, pane, partial report, and Pi session, and returns control to the parent. Answer through the control tool to continue the original session:
65
71
 
66
72
  ```text
67
- herdr_subagents({ action: "respond", runId: "<run-id>", answer: "Use the main branch." })
73
+ herdr_subagents_control({ action: "respond", runId: "<run-id>", answer: "Use the main branch." })
68
74
  ```
69
75
 
70
76
  While a batch is active, its task rows stay below the editor. With an empty editor, press `↓` to enter the list, `↑`/`↓` to choose a task, `Enter` to focus its exact pane, and `Esc` to return. `/herdr-subagents focus <task-number>` remains available as a fallback.
71
77
 
72
78
  ## History
73
79
 
74
- Run `/herdr-subagents history` or `herdr_subagents({ action: "history" })` to list compact project-local run and task reports after Herdr tabs close. Full results, described documents, artifacts, and persistent Pi sessions remain separate on disk and are not loaded into parent context.
80
+ Run `/herdr-subagents history` or `herdr_subagents_control({ action: "history" })` to list compact project-local run and task reports after Herdr tabs close. Full results, described documents, artifacts, and persistent Pi sessions remain separate on disk and are not loaded into parent context.
75
81
 
76
- Continue a saved conversation in a new Herdr tab with `herdr_subagents({ action: "resume", runId: "<run-id>", task: 1, prompt: "Follow up..." })`. Remove only a selected archive with `herdr_subagents({ action: "cleanup", runId: "<run-id>" })`. History has no automatic count-based eviction. The extension adds the runtime path to local Git excludes when available (and otherwise uses `.pi/.gitignore`) without overwriting unrelated rules.
82
+ Continue a saved conversation in a new Herdr tab with `herdr_subagents_control({ action: "resume", runId: "<run-id>", task: 1, prompt: "Follow up..." })`. Remove only a selected archive with `herdr_subagents_control({ action: "cleanup", runId: "<run-id>" })`. History has no automatic count-based eviction. The extension adds the runtime path to local Git excludes when available (and otherwise uses `.pi/.gitignore`) without overwriting unrelated rules.
77
83
 
78
84
  Read-only tasks start FIFO up to the configured concurrency limit. A pane is created only when its task starts, belongs exclusively to that task, and is never reused. Completed panes remain inspectable while another task in the batch is unsettled. Results remain in input order, and one failed task does not cancel its siblings. Any batch containing a write-capable persona is forced to concurrency one.
79
85
 
@@ -98,49 +104,172 @@ The complete result is not copied into the parent model context. Each run is ret
98
104
 
99
105
  The task directory contains the full result, structured report, task metadata, system prompt, and persistent Pi session. Run-level metadata is stored in the parent run directory.
100
106
 
101
- ## Personas
107
+ ## Configuration and personas
102
108
 
103
- The package includes `worker` (write access), `explorer` (read access), and `reviewer` (read access). Persona definitions are discovered in this order, with the first available higher-precedence definition replacing the lower one:
109
+ Herdr Subagents loads settings and persona definitions from separate files:
104
110
 
105
- 1. `.pi/herdr-subagents/agents/*.md` in the project
106
- 2. `~/.pi/agent/herdr-subagents/agents/*.md` globally
107
- 3. this package's `agents/*.md`
111
+ | Scope | Settings | Persona definitions |
112
+ | --- | --- | --- |
113
+ | Project | `.pi/herdr-subagents.json` | `.pi/herdr-subagents/agents/*.md` |
114
+ | Global | `~/.pi/agent/herdr-subagents.json` | `~/.pi/agent/herdr-subagents/agents/*.md` |
115
+ | Package | built-in defaults | installed package `agents/*.md` |
108
116
 
109
- A custom persona without `access` is treated as write-capable. Definitions may set `access`, `model`, `thinking`, `tools`, and `skills` in frontmatter.
117
+ Project JSON values recursively override global JSON values. The built-in setting defaults are `defaultConcurrency: 1`, `maxConcurrency: 4`, and `stalledWarningSeconds: 300`. `defaultModel` and `defaultThinking` are unset, so the parent Pi model and its thinking level are inherited unless another setting wins.
110
118
 
111
- The default `agents/worker.md` uses this format:
119
+ ### Settings file option reference
112
120
 
113
- ```md
114
- ---
115
- name: worker
116
- description: General-purpose worker for one focused task
117
- tools: read, bash, edit, write, grep, find, ls
118
- ---
121
+ These are all supported top-level fields in `herdr-subagents.json`:
119
122
 
120
- You are a focused worker subagent.
121
- ```
123
+ | Option | Accepted value | Default | Effect |
124
+ | --- | --- | --- | --- |
125
+ | `defaultConcurrency` | Positive integer | `1` | Number of read-only tasks allowed to run together when a batch call omits `concurrency`. It is capped to `maxConcurrency`. |
126
+ | `maxConcurrency` | Positive integer | `4` | Hard ceiling for requested/default batch concurrency. A batch containing any write-capable persona still runs serially. |
127
+ | `stalledWarningSeconds` | Positive integer | `300` | Seconds before a still-running child emits a warning. This is not a timeout and does not stop the child. |
128
+ | `defaultModel` | Non-empty Pi model string, normally `provider/model` | Unset | Model used when neither JSON persona settings nor persona Markdown select one. If unset, the parent model is inherited. Use `/herdr-subagents models` to list authenticated models. |
129
+ | `defaultThinking` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` | Unset | Thinking level below persona-specific settings. Provider/model support can vary. If unset, parent thinking is inherited only when the parent model is also inherited. |
130
+ | `personas` | Object keyed by an existing persona name | `{}` | Per-persona JSON overrides described below. This does not create a persona; a matching Markdown definition must exist. |
131
+
132
+ Known fields with an invalid JSON type, an empty required string, or a non-positive integer are ignored with a diagnostic shown by `/herdr-subagents settings`. Model IDs, thinking-level compatibility, and skill availability are ultimately validated by Pi when the child starts. When `defaultConcurrency` exceeds `maxConcurrency`, the effective default is reduced to the maximum.
122
133
 
123
- Supported frontmatter:
134
+ Each `personas.<name>` object supports exactly these overrides:
124
135
 
125
- - `name` and `description` are required.
126
- - `model` optionally selects a child model. A call-level `model` overrides it; otherwise the current session model is inherited.
127
- - `tools` optionally restricts built-in tools. `subagent_report` is always added so the child can settle the task.
128
- - `access` is `read` or `write`; omitted custom values default to `write`.
129
- - `thinking` and `skills` provide persona defaults.
136
+ | Option | Accepted value | Effect |
137
+ | --- | --- | --- |
138
+ | `model` | Non-empty Pi model string | Overrides the model from the effective persona Markdown and `defaultModel`. |
139
+ | `thinking` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` | Overrides persona Markdown and `defaultThinking`. The value is passed to Pi's `--thinking` option. |
140
+ | `skills` | Array of non-empty strings | Replaces the entire lower-precedence skill list. Use `[]` to clear inherited skills. Each item is passed to child Pi as `--skill`. |
130
141
 
131
- Global settings live at `~/.pi/agent/herdr-subagents.json`; project overrides live at `.pi/herdr-subagents.json`. Both support `defaultConcurrency`, `maxConcurrency`, `stalledWarningSeconds`, `defaultModel`, and a `personas` object whose entries can override `model`, `thinking`, and `skills`.
142
+ JSON persona overrides cannot change `name`, `description`, `access`, `tools`, or the system prompt; define those in persona Markdown.
143
+
144
+ A global configuration can establish shared defaults:
132
145
 
133
146
  ```json
134
147
  {
135
- "defaultModel": "provider/model",
136
- "maxConcurrency": 3,
148
+ "defaultConcurrency": 2,
149
+ "maxConcurrency": 4,
150
+ "stalledWarningSeconds": 300,
151
+ "defaultModel": "anthropic/claude-sonnet-4-5",
152
+ "defaultThinking": "medium",
137
153
  "personas": {
138
- "reviewer": { "thinking": "high", "skills": ["code-review"] }
154
+ "explorer": {
155
+ "model": "anthropic/claude-haiku-4-5",
156
+ "thinking": "medium",
157
+ "skills": ["code-search"]
158
+ },
159
+ "reviewer": {
160
+ "thinking": "high",
161
+ "skills": ["code-review"]
162
+ }
139
163
  }
140
164
  }
141
165
  ```
142
166
 
143
- Project values override global values recursively. Model resolution is: task override, project persona setting, global persona setting, persona frontmatter, global/project default model, then parent model. Run `/herdr-subagents agents`, `/herdr-subagents models`, or `/herdr-subagents settings` to inspect effective values and their sources.
167
+ The project file can override only the fields that differ. Persona fields are merged by persona name:
168
+
169
+ ```json
170
+ {
171
+ "defaultConcurrency": 3,
172
+ "stalledWarningSeconds": 600,
173
+ "defaultThinking": "high",
174
+ "personas": {
175
+ "explorer": {
176
+ "model": "openai/gpt-5.2"
177
+ },
178
+ "reviewer": {
179
+ "skills": ["security-review", "code-review"]
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ The package includes these personas:
186
+
187
+ | Persona | Access | Built-in tools | Intended use |
188
+ | --- | --- | --- | --- |
189
+ | `worker` | write | `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls` | Focused implementation work |
190
+ | `explorer` | read | `read`, `bash`, `grep`, `find`, `ls` | Fast codebase investigation |
191
+ | `reviewer` | read | `read`, `bash`, `grep`, `find`, `ls` | Correctness and maintainability review |
192
+
193
+ Persona definitions use Markdown frontmatter followed by the child system prompt. For example, save this as `.pi/herdr-subagents/agents/security-reviewer.md`:
194
+
195
+ ```md
196
+ ---
197
+ name: security-reviewer
198
+ description: Read-only reviewer for security risks
199
+ access: read
200
+ model: anthropic/claude-sonnet-4-5
201
+ thinking: high
202
+ tools: read, bash, grep, find, ls
203
+ skills: security-review, code-review
204
+ ---
205
+
206
+ Review the assigned scope without modifying files. Report concrete risks and evidence.
207
+ ```
208
+
209
+ Persona Markdown supports these frontmatter fields:
210
+
211
+ | Field | Accepted value | Required/default | Effect |
212
+ | --- | --- | --- | --- |
213
+ | `name` | Non-empty string | Required | Persona identifier used by `agent`. Names must be unique within one persona directory. |
214
+ | `description` | Non-empty string | Required | Description shown to the parent when agents are listed. |
215
+ | `access` | `read` or `write` | `write` | Scheduling declaration. Any batch containing `write` is forced to concurrency one. `read` permits parallel scheduling but does not itself remove tools. |
216
+ | `model` | Non-empty Pi model string | Unset | Persona model default. |
217
+ | `thinking` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` | Unset | Persona thinking default passed to Pi's `--thinking` option. |
218
+ | `tools` | Non-empty comma-separated list, optionally bracketed | Child Pi defaults | Restricts built-in tools. Supported names are `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`, and `powershell`. `subagent_report` is always added. |
219
+ | `skills` | Comma-separated list, optionally bracketed | None | Skills loaded explicitly into child Pi; automatic skill discovery is disabled. |
220
+
221
+ The Markdown body after the frontmatter is the child system prompt and may be empty. To make a custom persona operationally read-only, set `access: read` **and** choose an appropriate `tools` allowlist; `access` alone is not a tool sandbox. Model names and skill values are passed to Pi, so they must be available in the installed Pi environment.
222
+
223
+ Persona Markdown definitions use replacement precedence, not field merging. A same-name project definition replaces the entire global or package definition:
224
+
225
+ 1. project `.pi/herdr-subagents/agents/*.md`
226
+ 2. global `~/.pi/agent/herdr-subagents/agents/*.md`
227
+ 3. package built-ins
228
+
229
+ ### Model and persona-option precedence
230
+
231
+ The child model is selected in this exact order:
232
+
233
+ 1. `model` on the task or call
234
+ 2. project `personas.<name>.model` JSON setting
235
+ 3. global `personas.<name>.model` JSON setting
236
+ 4. `model` in the effective persona Markdown frontmatter
237
+ 5. effective `defaultModel` JSON setting (project overrides global)
238
+ 6. parent Pi model
239
+
240
+ The child thinking level is selected in this order:
241
+
242
+ 1. project `personas.<name>.thinking` JSON setting
243
+ 2. global `personas.<name>.thinking` JSON setting
244
+ 3. `thinking` in the effective persona Markdown frontmatter
245
+ 4. effective `defaultThinking` JSON setting (project overrides global)
246
+ 5. parent Pi thinking level when the child also inherits the parent model
247
+
248
+ Thinking has no call-level override. `skills` uses the first three persona-level steps and has no global default; a project `skills` array replaces, rather than appends to, the global or Markdown list.
249
+
250
+ Override the model for one task:
251
+
252
+ ```text
253
+ herdr_subagents({
254
+ tasks: [
255
+ { name: "authorization", agent: "reviewer", model: "anthropic/claude-opus-4-1:high", prompt: "Review the authorization boundary" }
256
+ ]
257
+ })
258
+ ```
259
+
260
+ Each task in a batch can select its own model:
261
+
262
+ ```text
263
+ herdr_subagents({
264
+ concurrency: 2,
265
+ tasks: [
266
+ { name: "map", agent: "explorer", model: "anthropic/claude-haiku-4-5", prompt: "Map the request flow" },
267
+ { name: "review", agent: "reviewer", model: "anthropic/claude-sonnet-4-5", prompt: "Review input validation" }
268
+ ]
269
+ })
270
+ ```
271
+
272
+ Run `/herdr-subagents agents`, `/herdr-subagents models`, or `/herdr-subagents settings` to inspect effective values and their sources.
144
273
 
145
274
  ## Recovery and failures
146
275
 
@@ -4,8 +4,9 @@
4
4
 
5
5
  1. `npm --prefix packages/herdr-subagents test` runs deterministic scheduler, recovery, and persona tests.
6
6
  2. `pi -ne -ns --no-session -e ./packages/herdr-subagents/extensions/herdr-subagents.ts` verifies extension loading.
7
- 3. `npm pack ./packages/herdr-subagents --dry-run` verifies package contents.
8
- 4. Verify the README example and the production-runner media `docs/screenshot.png` and `docs/demo.gif` are present in the tarball.
7
+ 3. From a visible X11 Herdr client with the GStreamer X11 and VP8 plugins installed, run `HERDR_MEDIA_WINDOW_ID=<window-id> node scripts/capture-package-media.mjs`. The Herdr capture must show a parent Pi conversation, a three-task run tab, each of the three real interactive Agent panes receiving focus in turn, and the final compact parent response.
8
+ 4. `npm pack ./packages/herdr-subagents --dry-run` verifies package contents.
9
+ 5. Verify the README renders the GitHub attachment video directly and live Herdr UI media `docs/screenshot.png` and `docs/demo.webm` are present in the tarball; `docs/demo.gif` must be absent. Inspect the WebM metadata and play it through once to confirm the parent → three focused children → parent sequence.
9
10
 
10
11
  ## Cases
11
12
 
@@ -15,10 +16,10 @@
15
16
  - Force write-capable batches to serial execution while allowing bounded read-only parallelism.
16
17
  - Preserve compact reports, full results, Pi sessions, blocked questions, and historical follow-ups.
17
18
  - Recover queued/running work after interruption without retrying post-prompt side effects, including truncated reports and recovery errors.
18
- - Verify the flat public contract and injectable extension wiring, including conditional registration only inside Herdr, Fleet rendering, editor focus ownership, terminal-input passthrough, exact-pane navigation, and stable display while another background run queues.
19
+ - Verify the split public contracts (`herdr_subagents` with required `tasks`, plus `herdr_subagents_control` with required `action`) and injectable extension wiring, including conditional registration only inside Herdr, Fleet rendering, editor focus ownership, terminal-input passthrough, exact-pane navigation, and stable display while another background run queues.
19
20
  - Verify blocked-response live Fleet updates, authoritative stale-field replacement, parent-shutdown cancellation, cleanup notifications, atomic state replacement, non-retried uncertain startup operations, and stalled warnings.
20
21
  - Verify resumed batches retain newly allocated pane IDs and historical follow-ups exclude simultaneous session writers.
21
22
 
22
23
  ## Latest baseline
23
24
 
24
- All 133 deterministic scheduler, recovery, process-boundary, schema-validation, navigation, and persona cases must pass. Release validation also requires extension loading and a real Herdr read-only batch smoke with distinct task panes and final tab cleanup. The latest smoke completed two concurrent tasks, retained its focused run tab through settlement, and closed it automatically after focus moved away.
25
+ All 137 deterministic scheduler, recovery, process-boundary, schema-validation, navigation, and persona cases must pass. Release validation also requires extension loading and a real Herdr read-only batch smoke with distinct task panes and final tab cleanup. The latest smoke completed two concurrent tasks, retained its focused run tab through settlement, and closed it automatically after focus moved away.