@dreki-gg/pi-subagent 0.10.0 → 0.11.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 +11 -0
- package/README.md +11 -0
- package/extensions/subagent/index.ts +23 -10
- package/package.json +1 -1
- package/prompts/advisor.md +1 -1
- package/prompts/bug-prover.md +1 -1
- package/prompts/docs-scout.md +1 -1
- package/prompts/planner.md +1 -1
- package/prompts/reviewer.md +1 -1
- package/prompts/scout.md +1 -1
- package/prompts/ux-designer.md +1 -1
- package/prompts/validator.md +1 -1
- package/skills/spawn-subagents/SKILL.md +23 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @dreki-gg/pi-subagent
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Model routing guidance and visible model attribution.
|
|
8
|
+
|
|
9
|
+
- `spawn-subagents` skill: new "Model routing" section — route each subagent task to the model whose strengths match the work (bulk token burn → cheap, user-facing → tasteful, reviews → strongest), honor a user model routing policy from AGENTS.md when one exists, and escalate without asking when a cheaper model's output misses the bar.
|
|
10
|
+
- Reasoning defaults: Opus-backed judgment/coding agents (advisor, planner, reviewer, validator, bug-prover, ux-designer) now run `thinking: high` instead of low/medium — reasoning effort applies per step, and high is the quality/cost sweet spot. Scouts stay low for cheap bulk recon.
|
|
11
|
+
- Result rendering: the model that ran each task is now shown next to the agent name in single, parallel, and chain headers (dim ` · model`), and in the working message while a run is active — so per-model quality is auditable at a glance. Parallel running placeholders resolve the model up front (task override → call default → agent default), so attribution shows while tasks are still running, not just after completion.
|
|
12
|
+
- `scout` and `docs-scout` default models move from `gpt-5.4-mini` to `gpt-5.6-luna` — near-Terra coding quality at the lowest benchmarked cost per task.
|
|
13
|
+
|
|
3
14
|
## 0.10.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -56,6 +56,17 @@ identical to pi-backed subagents.
|
|
|
56
56
|
- The model is passed as `cursor-agent --model <model> acp`; see `cursor-agent --list-models`
|
|
57
57
|
for available ids (e.g. `cursor:gpt-5.2`).
|
|
58
58
|
|
|
59
|
+
## Model Routing
|
|
60
|
+
|
|
61
|
+
The `spawn-subagents` skill teaches the orchestrating agent to route each task to the model whose strengths match the work instead of one default model for everything:
|
|
62
|
+
|
|
63
|
+
- **Bulk token burn goes cheap** — log digging, large specs, migrations, clear-spec implementation.
|
|
64
|
+
- **User-facing output goes tasteful** — public APIs, SDKs, UI copy go to (or are reviewed by) the highest-taste model.
|
|
65
|
+
- **Reviews get the strong model** — cheap models only as an extra perspective, never the sole reviewer.
|
|
66
|
+
- **Defaults, not limits** — redo cheap-model output on a stronger model without asking; judge the output, not the price tag.
|
|
67
|
+
|
|
68
|
+
If your context files (e.g. a global `AGENTS.md`) define a model routing policy — a table scoring your models on intelligence / taste / cost — the skill treats it as authoritative when picking per-task `model` overrides. Result headers and working messages show which model ran each task (` · model`), so quality is auditable per model.
|
|
69
|
+
|
|
59
70
|
## Opinionated Defaults
|
|
60
71
|
|
|
61
72
|
This package is intentionally opinionated about orchestration:
|
|
@@ -670,7 +670,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
670
670
|
: undefined;
|
|
671
671
|
|
|
672
672
|
if (ctx.hasUI) {
|
|
673
|
-
|
|
673
|
+
const stepModel =
|
|
674
|
+
step.model ?? params.model ?? agents.find((a) => a.name === step.agent)?.model;
|
|
675
|
+
ctx.ui.setWorkingMessage(
|
|
676
|
+
`Chain step ${i + 1}/${params.chain.length}: ${step.agent}${stepModel ? ` · ${stepModel}` : ''}`,
|
|
677
|
+
);
|
|
674
678
|
}
|
|
675
679
|
|
|
676
680
|
const result = await runSingleAgent(
|
|
@@ -750,10 +754,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
750
754
|
|
|
751
755
|
// Initialize placeholder results
|
|
752
756
|
for (let i = 0; i < params.tasks.length; i++) {
|
|
757
|
+
const t = params.tasks[i];
|
|
753
758
|
allResults[i] = {
|
|
754
|
-
agent:
|
|
759
|
+
agent: t.agent,
|
|
755
760
|
agentSource: 'unknown',
|
|
756
|
-
task:
|
|
761
|
+
task: t.task,
|
|
762
|
+
model: t.model ?? params.model ?? agents.find((a) => a.name === t.agent)?.model,
|
|
757
763
|
exitCode: -1, // -1 = still running
|
|
758
764
|
messages: [],
|
|
759
765
|
stderr: '',
|
|
@@ -840,7 +846,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
840
846
|
|
|
841
847
|
if (params.agent && params.task) {
|
|
842
848
|
if (ctx.hasUI) {
|
|
843
|
-
|
|
849
|
+
const singleModel = params.model ?? agents.find((a) => a.name === params.agent)?.model;
|
|
850
|
+
ctx.ui.setWorkingMessage(
|
|
851
|
+
`Running agent: ${params.agent}${singleModel ? ` · ${singleModel}` : ''}`,
|
|
852
|
+
);
|
|
844
853
|
}
|
|
845
854
|
|
|
846
855
|
const result = await runSingleAgent(
|
|
@@ -973,7 +982,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
973
982
|
|
|
974
983
|
if (expanded) {
|
|
975
984
|
const container = new Container();
|
|
976
|
-
let header = `${icon} ${theme.fg('toolTitle', theme.bold(r.agent))}${theme.fg('muted', ` (${r.agentSource})`)}`;
|
|
985
|
+
let header = `${icon} ${theme.fg('toolTitle', theme.bold(r.agent))}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''}${theme.fg('muted', ` (${r.agentSource})`)}`;
|
|
977
986
|
if (isError && r.stopReason) header += ` ${theme.fg('error', `[${r.stopReason}]`)}`;
|
|
978
987
|
container.addChild(new Text(header, 0, 0));
|
|
979
988
|
if (isError && r.errorMessage)
|
|
@@ -1010,7 +1019,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1010
1019
|
return container;
|
|
1011
1020
|
}
|
|
1012
1021
|
|
|
1013
|
-
let text = `${icon} ${theme.fg('toolTitle', theme.bold(r.agent))}${theme.fg('muted', ` (${r.agentSource})`)}`;
|
|
1022
|
+
let text = `${icon} ${theme.fg('toolTitle', theme.bold(r.agent))}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''}${theme.fg('muted', ` (${r.agentSource})`)}`;
|
|
1014
1023
|
if (isError && r.stopReason) text += ` ${theme.fg('error', `[${r.stopReason}]`)}`;
|
|
1015
1024
|
if (isError && r.errorMessage) text += `\n${theme.fg('error', `Error: ${r.errorMessage}`)}`;
|
|
1016
1025
|
else if (displayItems.length === 0) text += `\n${theme.fg('muted', '(no output)')}`;
|
|
@@ -1065,7 +1074,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1065
1074
|
container.addChild(new Spacer(1));
|
|
1066
1075
|
container.addChild(
|
|
1067
1076
|
new Text(
|
|
1068
|
-
`${theme.fg('muted', `─── Step ${r.step}: `) + theme.fg('accent', r.agent)} ${rIcon}`,
|
|
1077
|
+
`${theme.fg('muted', `─── Step ${r.step}: `) + theme.fg('accent', r.agent)}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''} ${rIcon}`,
|
|
1069
1078
|
0,
|
|
1070
1079
|
0,
|
|
1071
1080
|
),
|
|
@@ -1115,7 +1124,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1115
1124
|
for (const r of details.results) {
|
|
1116
1125
|
const rIcon = r.exitCode === 0 ? theme.fg('success', '✓') : theme.fg('error', '✗');
|
|
1117
1126
|
const displayItems = getDisplayItems(r.messages);
|
|
1118
|
-
text += `\n\n${theme.fg('muted', `─── Step ${r.step}: `)}${theme.fg('accent', r.agent)} ${rIcon}`;
|
|
1127
|
+
text += `\n\n${theme.fg('muted', `─── Step ${r.step}: `)}${theme.fg('accent', r.agent)}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''} ${rIcon}`;
|
|
1119
1128
|
if (displayItems.length === 0) text += `\n${theme.fg('muted', '(no output)')}`;
|
|
1120
1129
|
else text += `\n${renderDisplayItems(displayItems, 5)}`;
|
|
1121
1130
|
}
|
|
@@ -1156,7 +1165,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
1156
1165
|
|
|
1157
1166
|
container.addChild(new Spacer(1));
|
|
1158
1167
|
container.addChild(
|
|
1159
|
-
new Text(
|
|
1168
|
+
new Text(
|
|
1169
|
+
`${theme.fg('muted', '─── ') + theme.fg('accent', r.agent)}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''} ${rIcon}`,
|
|
1170
|
+
0,
|
|
1171
|
+
0,
|
|
1172
|
+
),
|
|
1160
1173
|
);
|
|
1161
1174
|
container.addChild(
|
|
1162
1175
|
new Text(theme.fg('muted', 'Task: ') + theme.fg('dim', r.task), 0, 0),
|
|
@@ -1204,7 +1217,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1204
1217
|
? theme.fg('success', '✓')
|
|
1205
1218
|
: theme.fg('error', '✗');
|
|
1206
1219
|
const displayItems = getDisplayItems(r.messages);
|
|
1207
|
-
text += `\n\n${theme.fg('muted', '─── ')}${theme.fg('accent', r.agent)} ${rIcon}`;
|
|
1220
|
+
text += `\n\n${theme.fg('muted', '─── ')}${theme.fg('accent', r.agent)}${r.model ? theme.fg('dim', ` · ${r.model}`) : ''} ${rIcon}`;
|
|
1208
1221
|
if (displayItems.length === 0)
|
|
1209
1222
|
text += `\n${theme.fg('muted', r.exitCode === -1 ? '(running...)' : '(no output)')}`;
|
|
1210
1223
|
else text += `\n${renderDisplayItems(displayItems, 5)}`;
|
package/package.json
CHANGED
package/prompts/advisor.md
CHANGED
package/prompts/bug-prover.md
CHANGED
|
@@ -3,7 +3,7 @@ name: bug-prover
|
|
|
3
3
|
description: Create the smallest failing repro for a suspected bug. Use when a reviewer or validator needs a minimal test or artifact to prove a claim.
|
|
4
4
|
tools: read, grep, find, ls, bash, edit, write
|
|
5
5
|
model: anthropic/claude-opus-4-6
|
|
6
|
-
thinking:
|
|
6
|
+
thinking: high
|
|
7
7
|
sessionStrategy: fork-at
|
|
8
8
|
---
|
|
9
9
|
|
package/prompts/docs-scout.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: docs-scout
|
|
3
3
|
description: Documentation scout that uses Context7 first, then summarizes the relevant implementation details
|
|
4
4
|
tools: context7_resolve_library_id, context7_get_library_docs, context7_get_cached_doc_raw, read, grep, find, ls
|
|
5
|
-
model: openai/gpt-5.
|
|
5
|
+
model: openai/gpt-5.6-luna
|
|
6
6
|
thinking: low
|
|
7
7
|
---
|
|
8
8
|
|
package/prompts/planner.md
CHANGED
|
@@ -3,7 +3,7 @@ name: planner
|
|
|
3
3
|
description: Creates implementation plans from context and requirements
|
|
4
4
|
tools: read, grep, find, ls, subagent
|
|
5
5
|
model: anthropic/claude-opus-4-6
|
|
6
|
-
thinking:
|
|
6
|
+
thinking: high
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
You are a planning specialist. You receive context (from a scout) and requirements, then produce a clear implementation plan.
|
package/prompts/reviewer.md
CHANGED
package/prompts/scout.md
CHANGED
package/prompts/ux-designer.md
CHANGED
|
@@ -3,7 +3,7 @@ name: ux-designer
|
|
|
3
3
|
description: Frontend UI designer that produces clean, human-designed interfaces — anti-Codex aesthetic
|
|
4
4
|
tools: read, grep, find, ls
|
|
5
5
|
model: anthropic/claude-opus-4-6
|
|
6
|
-
thinking:
|
|
6
|
+
thinking: high
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
You are a frontend UX designer agent. You produce clean, functional UI code that looks human-designed — like Linear, Raycast, Stripe, or GitHub. You exist to counter the default AI aesthetic.
|
package/prompts/validator.md
CHANGED
|
@@ -3,7 +3,7 @@ name: validator
|
|
|
3
3
|
description: Validate or falsify a specific bug, regression, or behavior claim from code, tests, and commands. Use when a review finding needs evidence before it becomes a fix request.
|
|
4
4
|
tools: read, grep, find, ls, bash
|
|
5
5
|
model: anthropic/claude-opus-4-6
|
|
6
|
-
thinking:
|
|
6
|
+
thinking: high
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
You are a validator.
|
|
@@ -26,6 +26,8 @@ Strong triggers:
|
|
|
26
26
|
- "ask advisor for a second opinion on this"
|
|
27
27
|
- "validate whether this review finding is real"
|
|
28
28
|
- "prove this bug with a minimal failing test"
|
|
29
|
+
- "route this to the cheap model"
|
|
30
|
+
- "use the right model for each piece"
|
|
29
31
|
|
|
30
32
|
Patterns:
|
|
31
33
|
|
|
@@ -114,13 +116,33 @@ Avoid:
|
|
|
114
116
|
- calling `advisor` when `planner` or `reviewer` already has enough signal to proceed alone
|
|
115
117
|
- sending speculative review findings back for fixes before they are validated when evidence is needed
|
|
116
118
|
|
|
117
|
-
## 8.
|
|
119
|
+
## 8. Model routing
|
|
120
|
+
Route each subagent task to the model whose strengths match the work, not to one default model for everything.
|
|
121
|
+
|
|
122
|
+
Policy source:
|
|
123
|
+
- If the user's context files (AGENTS.md or equivalent) define a model routing policy — a table scoring models on axes like intelligence, taste, and cost — that policy is authoritative. Apply it when picking `model` overrides for `single` / `parallel` / `chain` tasks.
|
|
124
|
+
- Without a user policy, use the agent prompt's default model and these structural rules.
|
|
125
|
+
|
|
126
|
+
Structural rules (harness-independent):
|
|
127
|
+
- **Bulk token burn goes cheap.** Log digging, reading large files/specs/PDFs, data analysis, mechanical migrations, and clear-spec implementation belong on the cheapest capable model.
|
|
128
|
+
- **User-facing output goes tasteful.** Public APIs, SDKs, UI copy, and design decisions go to the highest-taste model, or are reviewed by it before shipping.
|
|
129
|
+
- **Reviews get the strong model.** Plan and implementation reviews run on the strongest model; a cheap model may be added as an extra independent perspective, never as the only reviewer.
|
|
130
|
+
- **Defaults, not limits.** If a cheaper model's output does not meet the bar, rerun the task on a stronger model without asking. Judge the output, not the price tag — escalating costs less than shipping mediocre work.
|
|
131
|
+
- **Cost is a tiebreaker only.** Use cheap models to gather information before engaging an expensive one, never to avoid it.
|
|
132
|
+
- **Name the model.** When reporting delegated work back, say which model ran each task so quality can be judged per model.
|
|
133
|
+
|
|
134
|
+
Mechanics:
|
|
135
|
+
- Pass `model` per task/step (e.g. `{ agent: "worker", task: "…", model: "cursor:composer-2.5" }`) or once per call as a default for all tasks.
|
|
136
|
+
- `cursor:<model>` routes through Cursor's agent via ACP — useful as a distinct cheap/fast implementation backend.
|
|
137
|
+
|
|
138
|
+
## 9. Agent discovery and creation
|
|
118
139
|
Use `list_agents` before spawning when you're unsure which agents exist.
|
|
119
140
|
Use `/create-agent <name> [description]` to scaffold a new project-local agent in `.pi/prompts/` when the user needs a custom agent that doesn't exist yet.
|
|
120
141
|
- After creating, read and refine the prompt file to fit the use case.
|
|
121
142
|
- Remember to use `agentScope: "both"` or `"project"` to include project-local agents.
|
|
122
143
|
|
|
123
144
|
Execution rules:
|
|
145
|
+
- Route each task to the model whose strengths match the work; honor the user's model routing policy when one exists (section 8).
|
|
124
146
|
- Use `manager` when the task is too large for one prompt but still needs coherent decisions.
|
|
125
147
|
- Use `advisor` for targeted second opinions on tricky or high-risk cases.
|
|
126
148
|
- Use `validator` to confirm a claim before escalating it as a fix.
|