@xynogen/pix-skills 0.4.16 → 0.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/skills/subagent.md +73 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -60,11 +60,11 @@ exact file paths, the shared contracts (types, function signatures, interfaces),
60
60
  the naming, and the acceptance criteria **before** splitting. The whole point is
61
61
  that workers inherit decisions instead of inventing them.
62
62
 
63
- For large/complex tasks, delegate planning to the builtin `planner` first, get
63
+ For large/complex tasks, delegate planning to the builtin `Plan` agent first, get
64
64
  the plan, then decompose it:
65
65
 
66
66
  ```typescript
67
- subagent({ agent: "planner", task: "Plan: <task>. Emphasize independent, parallelizable units." })
67
+ subagent({ subagent_type: "Plan", prompt: "Plan: <task>. Emphasize independent, parallelizable units." })
68
68
  ```
69
69
 
70
70
  ### 2. Decompose
@@ -117,7 +117,14 @@ cheaper/smaller model.
117
117
  > Branch **only** truly-independent units; if you cannot fan them out
118
118
  > concurrently, keep the work on the orchestrator instead of delegating it.
119
119
 
120
- **Resolve the cheap model at call time — never hardcode it.** The active model is
120
+ **Type and model are orthogonal — set both, every time.** `subagent_type` (the
121
+ agent type) picks the tool allowlist and persona: `Explore` for read-only search,
122
+ `Plan` for read-only architecture, `general-purpose` for full-toolset work. It
123
+ does **not** pick the model. The model is always yours to choose per call via
124
+ `model:`. A read-only `Explore` worker is not automatically cheap — you make it
125
+ cheap by passing a cheap-tier model.
126
+
127
+ Resolve that model at call time — never hardcode it. The active model is
121
128
  dynamic: the user can switch it mid-chat, and the orchestrator's own model is
122
129
  whatever is current. So before fanning out:
123
130
 
@@ -128,9 +135,10 @@ whatever is current. So before fanning out:
128
135
  rather than guessing — the wrong pick wastes the run.
129
136
 
130
137
  The per-task `model` override is the right mechanism precisely because the main
131
- model can change: the override pins each worker to the chosen cheap model
132
- regardless of what the orchestrator is running at that moment. Examples below use
133
- `<cheap-model>` as a placeholder — substitute the resolved model.
138
+ model can change: the override pins each worker to the chosen model regardless
139
+ of what the orchestrator is running at that moment. Examples below use
140
+ `<cheap-model>` as a placeholder — substitute the resolved model. Omit `model:`
141
+ only when you deliberately want the worker to inherit the parent's model.
134
142
 
135
143
  ```typescript
136
144
  subagent({
@@ -224,6 +232,65 @@ Task: "Add the same new field + validation to 6 independent API handlers."
224
232
  across all 6, dedupes if they each inlined it.
225
233
  5. **Verify** — full test suite; fix any handler that drifted from the contract.
226
234
 
235
+ ## Common pitfalls
236
+
237
+ Five failure modes that look like optimizations but cost you. The meta-pattern
238
+ across all of them: **mechanical wins (faster, cheaper, parallel) only pay when
239
+ the underlying semantic is right.** Optimize the form and you lose the meaning.
240
+
241
+ ### 1. Serial delegation
242
+
243
+ Spawn one subagent, wait for the result, then spawn the next. The parent stays
244
+ tied up relaying the unit the whole time, so its scarce context/attention was
245
+ spent anyway — *and* the unit ran on a weaker model. You traded the strong
246
+ model's intelligence away and got nothing back, not even less of it spent. The
247
+ only thing serial delegation buys is context isolation, which rarely justifies
248
+ the quality hit. **When it's actually OK:** the unit is genuinely heavy (huge
249
+ file dump, web crawl, massive tool loop) and you need the context back before
250
+ the next step can even be planned. Rare. Otherwise: branch, don't relay.
251
+
252
+ ### 2. Dependency chains
253
+
254
+ B needs A's output, so you spawn A, wait, spawn B. The units serialize on each
255
+ other's data, collapsing back to serial. Two spawns' wall-clock with two
256
+ spawns' quality cost, no parallelism was ever possible. **Fix:** chain them
257
+ *inside one* subagent (let it do B after A) or do A→B yourself on the
258
+ orchestrator. Don't fan out a chain.
259
+
260
+ ### 3. Vague prompts
261
+
262
+ "Look at the auth flow and tell me what's wrong." The child has no memory of
263
+ your conversation. It doesn't know which auth flow, what you already tried,
264
+ what "wrong" means in your context, or what shape of answer you want. It
265
+ guesses, and you pay twice — once to spawn, once to re-spawn with a better
266
+ spec. **Fix:** write prompts like you're briefing a smart colleague who just
267
+ walked in cold. Include file paths, line numbers, the shared contract, the
268
+ expected output shape, how to validate locally. The cheap-worker prompt
269
+ contract above (goal / contract / constraints / validation / output) is the
270
+ minimum — more spec, not less, when the model is smaller.
271
+
272
+ ### 4. Trusting the summary blindly
273
+
274
+ The child returns "done, I fixed the bug." You mark the task done. The
275
+ child's summary describes what it *intended*, not what it *did*. For read-only
276
+ lookups that's fine. For write operations — edits, file creates, command runs
277
+ — the only verification is reading the actual diff. **Fix:** for any subagent
278
+ that wrote or edited, check the diff before reporting work as complete. A
279
+ subagent's "done" is a claim, not a fact.
280
+
281
+ ### 5. Type/model coupling
282
+
283
+ The agent *type* (Explore, Plan, general-purpose) implies a *model* — usually
284
+ baked into the type's default config. A caller's explicit `model:` gets
285
+ silently discarded because the type's default wins. The parent LLM was told
286
+ "pick a cheap model per call" but the code says "no you can't." The
287
+ principle — **type and model are orthogonal, the caller owns the model** —
288
+ is violated by the implementation, not just unenforced. **Fix:** types set
289
+ tool allowlist + persona only. Model is always caller-decided via `model:`.
290
+ A read-only `Explore` worker is not automatically cheap — you make it cheap
291
+ by passing a cheap-tier model. If you find yourself unable to override a
292
+ type's model, that's a bug in the precedence, not a feature of the type.
293
+
227
294
  ## Cost / efficiency notes
228
295
 
229
296
  - The win is **decomposition quality**, not raw parallelism. Bad splits create