@femtomc/mu-agent 26.2.105 → 26.2.107

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 (40) hide show
  1. package/README.md +39 -16
  2. package/assets/mu-tui-logo.png +0 -0
  3. package/dist/extensions/index.d.ts +1 -0
  4. package/dist/extensions/index.d.ts.map +1 -1
  5. package/dist/extensions/index.js +1 -0
  6. package/dist/extensions/mu-command-dispatcher.d.ts +0 -1
  7. package/dist/extensions/mu-command-dispatcher.d.ts.map +1 -1
  8. package/dist/extensions/mu-command-dispatcher.js +5 -42
  9. package/dist/extensions/mu-operator.d.ts.map +1 -1
  10. package/dist/extensions/mu-operator.js +2 -0
  11. package/dist/extensions/mu-serve.d.ts.map +1 -1
  12. package/dist/extensions/mu-serve.js +2 -0
  13. package/dist/extensions/ui.d.ts +4 -0
  14. package/dist/extensions/ui.d.ts.map +1 -0
  15. package/dist/extensions/ui.js +335 -0
  16. package/dist/operator.d.ts +169 -1
  17. package/dist/operator.d.ts.map +1 -1
  18. package/dist/operator.js +77 -7
  19. package/package.json +2 -2
  20. package/prompts/skills/automation/SKILL.md +25 -0
  21. package/prompts/skills/{crons → automation/crons}/SKILL.md +3 -2
  22. package/prompts/skills/{heartbeats → automation/heartbeats}/SKILL.md +3 -2
  23. package/prompts/skills/core/SKILL.md +28 -0
  24. package/prompts/skills/{code-mode → core/code-mode}/SKILL.md +1 -1
  25. package/prompts/skills/{mu → core/mu}/SKILL.md +38 -4
  26. package/prompts/skills/{tmux → core/tmux}/SKILL.md +1 -1
  27. package/prompts/skills/messaging/SKILL.md +27 -0
  28. package/prompts/skills/subagents/SKILL.md +21 -236
  29. package/prompts/skills/{control-flow → subagents/control-flow}/SKILL.md +5 -5
  30. package/prompts/skills/subagents/execution/SKILL.md +315 -0
  31. package/prompts/skills/{hud → subagents/hud}/SKILL.md +4 -3
  32. package/prompts/skills/subagents/model-routing/SKILL.md +363 -0
  33. package/prompts/skills/{planning → subagents/planning}/SKILL.md +13 -6
  34. package/prompts/skills/{orchestration → subagents/protocol}/SKILL.md +21 -19
  35. package/prompts/skills/writing/SKILL.md +1 -0
  36. /package/prompts/skills/{memory → core/memory}/SKILL.md +0 -0
  37. /package/prompts/skills/{setup-discord → messaging/setup-discord}/SKILL.md +0 -0
  38. /package/prompts/skills/{setup-neovim → messaging/setup-neovim}/SKILL.md +0 -0
  39. /package/prompts/skills/{setup-slack → messaging/setup-slack}/SKILL.md +0 -0
  40. /package/prompts/skills/{setup-telegram → messaging/setup-telegram}/SKILL.md +0 -0
@@ -1,249 +1,34 @@
1
1
  ---
2
2
  name: subagents
3
- description: "Orchestrates issue-driven subagent execution with heartbeat supervision and tmux fan-out. Use when work should progress through durable parallel subagent loops."
3
+ description: "Meta-skill for protocol-driven planning and execution. Routes to planning, protocol, execution, control-flow, model-routing, and hud."
4
4
  ---
5
5
 
6
- # Subagents
6
+ # subagents
7
7
 
8
- ## Contents
8
+ Use this meta-skill when work should run through the full multi-agent DAG stack.
9
9
 
10
- - [Purpose (what this skill is for)](#purpose-what-this-skill-is-for)
11
- - [Shared protocol dependency](#shared-protocol-dependency)
12
- - [Control-flow dependency](#control-flow-dependency)
13
- - [HUD skill dependency](#hud-skill-dependency)
14
- - [tmux skill dependency](#tmux-skill-dependency)
15
- - [When to use](#when-to-use)
16
- - [Success condition](#success-condition)
17
- - [Dispatch modes](#dispatch-modes)
18
- - [Orchestration loops](#orchestration-loops)
19
- - [Bootstrap and queue targeting](#bootstrap-and-queue-targeting)
20
- - [Dispatch templates](#dispatch-templates)
21
- - [Subagents HUD](#subagents-hud)
22
- - [Evaluation scenarios](#evaluation-scenarios)
23
- - [Reconciliation](#reconciliation)
24
- - [Safety](#safety)
10
+ ## Subskills
25
11
 
26
- ## Purpose (what this skill is for)
12
+ - `planning` build/refine issue DAGs and approval loops.
13
+ - `protocol` — canonical DAG protocol contract and primitives.
14
+ - `execution` — durable orchestration/supervision loop over the DAG.
15
+ - `control-flow` — loop/termination overlays (`flow:*`) on top of protocol primitives.
16
+ - `model-routing` — provider/model/thinking overlays (`route:*`) from live harness capabilities.
17
+ - `hud` — canonical HUD ownership/update/teardown contract.
27
18
 
28
- Use this skill for **durable multi-agent orchestration**: work that must keep moving
29
- over time, not just one-shot execution.
19
+ ## Hard-cutover naming
30
20
 
31
- This skill is execution-supervision focused:
21
+ - Use `protocol` (not `orchestration`).
22
+ - Use `execution` (not the old execution leaf named `subagents`).
32
23
 
33
- - `mu heartbeats` / `mu cron` = orchestrator wake cadence
34
- - `tmux` + `mu exec` = parallel worker execution
35
- - subagents HUD = operator observability/control board
24
+ ## Recommended bundles
36
25
 
37
- Source of truth remains in `mu issues` + `mu forum`.
26
+ - Planning bundle: `planning` + `protocol` + `hud`
27
+ - Execution bundle: `execution` + `protocol` + `hud`
28
+ - Policy overlays: add `control-flow` and/or `model-routing` as needed
38
29
 
39
- ## Shared protocol dependency
30
+ ## Common patterns
40
31
 
41
- This skill executes DAG work defined by **`orchestration`**.
42
-
43
- Before orchestration begins, load that skill and enforce:
44
-
45
- - Protocol ID/tag: `hierarchical-work.protocol/v1` + `proto:hierarchical-work-v1`
46
- - Canonical node kinds, context tags, and invariants
47
- - Primitive semantics (`read_tree`, `claim`, `spawn`, `fork`, `ask`, `expand`, `complete`, `serial`)
48
-
49
- Do not run subagent orchestration against alternate protocol tags.
50
-
51
- ## Control-flow dependency
52
-
53
- When a subtree declares explicit loop/termination policy (for example
54
- `flow:review-gated-v1`), load **`control-flow`** and apply policy transitions as
55
- an overlay on orchestration primitives.
56
-
57
- - Keep DAG structure protocol-valid (`orchestration` remains source-of-truth).
58
- - Compile control-flow decisions into protocol primitives (`spawn`, `expand`,
59
- `ask`, `complete`, `serial`), not ad-hoc mutations.
60
-
61
- ## HUD skill dependency
62
-
63
- Before emitting or mutating subagent HUD state, load **`hud`** and follow its canonical contract.
64
- HUD usage is not optional for this skill.
65
-
66
- - Treat `hud` as source-of-truth for generic `mu_hud` actions, `HudDoc` shape, and rendering constraints.
67
- - This subagents skill defines orchestration-specific conventions only (for example `hud_id: "subagents"`, queue/activity semantics).
68
-
69
- ## tmux skill dependency
70
-
71
- Before spawning/inspecting worker sessions, load **`tmux`** and follow its
72
- canonical session lifecycle and bounded send/capture protocol.
73
-
74
- - Treat `tmux` as source-of-truth for session ownership, completion markers, and teardown.
75
- - This subagents skill defines orchestration semantics and queue policy.
76
-
77
- ## When to use
78
-
79
- - Work is represented as issue-scoped deliverables with explicit outcomes.
80
- - Dependencies may unblock over time.
81
- - You want unattended progress between manual check-ins.
82
-
83
- ## Success condition
84
-
85
- - Each executable issue is claimed, worked, and closed with an explicit outcome.
86
- - Results are posted in `issue:<id>` forum topics.
87
- - Root completion is validated via `mu issues validate <root-id>`.
88
-
89
- ## Dispatch modes
90
-
91
- ### 1) Heartbeat dispatch (orchestrator cadence)
92
-
93
- Use when you want orchestration to continue over time.
94
-
95
- Each heartbeat tick runs **one bounded orchestration pass**:
96
-
97
- 1. Read queue/tree state.
98
- 2. Select one protocol primitive/action.
99
- 3. Apply one bounded action.
100
- 4. Verify state + log progress.
101
- 5. Exit.
102
-
103
- Heartbeat dispatch is the orchestrator clock. It should supervise/advance the graph,
104
- not run unbounded worker sessions.
105
-
106
- ### 2) tmux dispatch (parallel workers)
107
-
108
- Use when several ready leaves should execute concurrently now.
109
-
110
- Spawn one tmux session per ready issue. Each worker claims one issue, executes one
111
- full issue loop, then exits.
112
-
113
- ## Orchestration loops
114
-
115
- ### Orchestrator heartbeat tick loop
116
-
117
- For root `<root-id>`:
118
-
119
- 1. Inspect queue and local protocol state:
120
-
121
- ```bash
122
- mu issues get <root-id> --pretty
123
- mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
124
- mu forum read issue:<root-id> --limit 20 --pretty
125
- ```
126
-
127
- 2. Choose exactly one action/primitive from `orchestration`.
128
- 3. Apply it.
129
- 4. Verify (`get`, `children`, `ready`, `validate`).
130
- 5. Update `hud_id:"subagents"` (required) and emit a compact snapshot.
131
- 6. Post a human-facing `ORCH_PASS` update to forum:
132
- - start with a short title that captures status in plain language
133
- - follow with one concise paragraph covering: project objective context, milestone moved this pass, impact, overall progress, and next high-level step
134
- - include queue/worker/drift internals only when diagnosing blocker/anomaly.
135
- 7. Exit tick.
136
-
137
- Stop automation when `mu issues validate <root-id>` returns final.
138
-
139
- ### Worker issue loop (single issue pass)
140
-
141
- For claimed issue `<issue-id>` under `<root-id>`:
142
-
143
- 1. Run `read_tree`.
144
- 2. Choose one primitive:
145
- - missing input -> `ask`
146
- - needs decomposition -> `expand`
147
- - directly solvable -> `complete`
148
- 3. Apply primitive.
149
- 4. Verify state.
150
- 5. Post progress to `issue:<issue-id>` focused on deliverable status, capability impact, and next step.
151
-
152
- Repeat bounded passes until issue closes.
153
-
154
- ## Bootstrap and queue targeting
155
-
156
- If root DAG does not yet exist, create it using the
157
- `orchestration` bootstrap template first.
158
-
159
- During orchestration, always scope queue reads with protocol tag:
160
-
161
- ```bash
162
- mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
163
- ```
164
-
165
- ## Dispatch templates
166
-
167
- ### A) Heartbeat autopilot (preferred for supervision)
168
-
169
- ```bash
170
- mu heartbeats create \
171
- --title "hierarchical-work-v1 <root-id>" \
172
- --reason orchestration_v1 \
173
- --every-ms 15000 \
174
- --prompt "Use skills subagents, orchestration, control-flow, and hud for root <root-id>. Run exactly one bounded orchestration pass: inspect the proto:hierarchical-work-v1 queue, perform exactly one corrective orchestration action (including in_progress-without-worker drift recovery) or claim/work-start one ready issue, then verify state. If flow:* policy tags are present, apply one control-flow transition from the control-flow skill in this pass. Report human-facing progress as a titled status note plus one concise paragraph that explains project context, milestone moved, impact, overall progress, and next high-level step; avoid low-level orchestration internals unless diagnosing a blocker/anomaly. Post a matching ORCH_PASS update to issue:<root-id>. Stop when 'mu issues validate <root-id>' is final."
175
- ```
176
-
177
- Reusable status-voice add-on for heartbeat prompts (copy/paste):
178
-
179
- ```text
180
- Write each ORCH_PASS as a human status note, not operator telemetry.
181
- Use a short plain-language title + one concise paragraph covering:
182
- project objective, milestone moved this pass, impact/precondition,
183
- overall progress, and next high-level step.
184
- Keep queue/worker/session internals out unless diagnosing a blocker.
185
- ```
186
-
187
- ### B) tmux fan-out (parallel workers)
188
-
189
- ```bash
190
- run_id="$(date +%Y%m%d-%H%M%S)"
191
- for issue_id in $(mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --json | jq -r '.[].id' | head -n 3); do
192
- session="mu-sub-${run_id}-${issue_id}"
193
- tmux new-session -d -s "$session" \
194
- "cd '$PWD' && mu exec 'Use skills subagents, orchestration, control-flow, and hud. Work issue ${issue_id} using hierarchical-work.protocol/v1. If flow:* policy tags are present, apply the control-flow overlay before selecting the next primitive. Claim first, then run one full control loop.' ; rc=\$?; echo __MU_DONE__:\$rc"
195
- done
196
- ```
197
-
198
- ## Subagents HUD
199
-
200
- HUD usage is required for this skill. Truth still lives in issues/forum.
201
-
202
- ```text
203
- /mu hud on
204
- /mu hud status
205
- /mu hud snapshot
206
- ```
207
-
208
- Tool: `mu_hud`
209
-
210
- - Canonical contract: see skill `hud`
211
- - Actions: `status`, `snapshot`, `on`, `off`, `toggle`, `set`, `update`, `replace`, `remove`, `clear`
212
- - Subagents convention: maintain a HUD doc with `hud_id: "subagents"`
213
- - Suggested subagents doc structure:
214
- - chips: health, mode, paused
215
- - sections: queue counts + recent activity lines
216
- - actions: refresh/spawn command hooks (if desired)
217
- - metadata: include `style_preset:"subagents"` for consistent renderer emphasis
218
- - Example update:
219
- - `{"action":"set", "doc": {"hud_id":"subagents", ...}}` (see `hud` skill for exact shape)
220
- - Follow the HUD ownership and teardown protocol from `hud` skill for completion and handoff.
221
-
222
- ## Evaluation scenarios
223
-
224
- 1. **Heartbeat bounded-orchestration tick**
225
- - Setup: root issue with multiple ready leaves tagged `proto:hierarchical-work-v1`.
226
- - Expected: one heartbeat tick performs exactly one bounded orchestration action, verifies state, posts a high-level titled narrative status update, and exits.
227
-
228
- 2. **tmux fan-out on ready leaves**
229
- - Setup: at least three independent ready issues under one root.
230
- - Expected: one worker session per issue is spawned, each worker claims before work, and each writes `START`/`RESULT` packets to `issue:<id>`.
231
-
232
- 3. **Human-question blocking flow (`ask`)**
233
- - Setup: worker encounters missing critical input.
234
- - Expected: skill applies protocol `ask` semantics, creates a human-input node, and downstream work remains blocked until the answer issue closes.
235
-
236
- ## Reconciliation
237
-
238
- - Run `mu issues validate <root-id>` before declaring completion.
239
- - Merge synth-node outputs into one final user-facing result.
240
- - Convert unresolved gaps into new child issues tagged `proto:hierarchical-work-v1`.
241
- - Tear down temporary tmux sessions.
242
- - Tear down/handoff `hud_id:"subagents"` ownership following the `hud` skill protocol.
243
-
244
- ## Safety
245
-
246
- - Prefer small, reversible child issues.
247
- - Keep child prompts explicit about deliverables + acceptance criteria.
248
- - Pause spawning while queue semantics are unclear.
249
- - Never overwrite unrelated files across shards.
32
+ - **End-to-End Orchestration**: Route to `planning` to get a structured issue DAG, present the plan in the `hud` to the user, then route to `execution` to drive the workers until the DAG is complete.
33
+ - **DAG Recovery / Unblocking**: If a DAG stalls, route to `protocol` to inspect `mu issues ready` constraints, followed by a bounded `execution` pass to claim and manually unblock the stalled task.
34
+ - **Differentiated Model Provisioning**: If different nodes need different abilities (e.g. specialized docs vs. complex refactoring), add `model-routing` to set `route:model-routing-v1` policies per issue. The `execution` worker shell will then automatically spin up the required model profiles based on those policies.
@@ -6,7 +6,7 @@ description: "Defines compositional control-flow policies for orchestration DAGs
6
6
  # control-flow
7
7
 
8
8
  Use this skill when work needs explicit loop/termination policy on top of the
9
- shared orchestration protocol.
9
+ shared protocol.
10
10
 
11
11
  ## Contents
12
12
 
@@ -22,7 +22,7 @@ shared orchestration protocol.
22
22
 
23
23
  ## Purpose
24
24
 
25
- Control-flow policies are overlays. They do not replace orchestration protocol
25
+ Control-flow policies are overlays. They do not replace protocol
26
26
  semantics; they guide which protocol primitive to apply next.
27
27
 
28
28
  Examples:
@@ -34,8 +34,8 @@ Examples:
34
34
 
35
35
  Load these skills before applying control-flow policies:
36
36
 
37
- - `orchestration` (protocol primitives/invariants)
38
- - `subagents` (durable execution runtime)
37
+ - `protocol` (protocol primitives/invariants)
38
+ - `execution` (durable execution runtime)
39
39
  - `heartbeats` and/or `crons` (scheduler clock)
40
40
  - `hud` (required visibility/handoff surface)
41
41
 
@@ -134,7 +134,7 @@ Per orchestrator tick:
134
134
  Reusable bounded heartbeat prompt fragment:
135
135
 
136
136
  ```text
137
- Use skills orchestration, control-flow, subagents, and hud.
137
+ Use skills subagents, protocol, execution, control-flow, and hud.
138
138
  For root <root-id>, enforce flow:review-gated-v1 with spawn-per-attempt rounds.
139
139
  Run exactly one bounded control-flow transition pass, verify DAG state,
140
140
  post one ORCH_PASS, and stop. If validate is final, disable the supervising
@@ -0,0 +1,315 @@
1
+ ---
2
+ name: execution
3
+ description: "Runs issue-driven execution supervision with heartbeat orchestration and tmux fan-out. Use when work should progress through durable parallel execution loops."
4
+ ---
5
+
6
+ # execution
7
+
8
+ Use this skill for **durable multi-agent orchestration**: work that must keep moving
9
+ over time, not just one-shot execution.
10
+
11
+ This skill is execution-supervision focused:
12
+
13
+ - `mu heartbeats` / `mu cron` = orchestrator wake cadence
14
+ - `tmux` + `mu exec` = parallel worker execution
15
+ - subagents HUD = operator observability/control board
16
+
17
+ Source of truth remains in `mu issues` + `mu forum`.
18
+
19
+ ## Contents
20
+
21
+ - [Shared protocol dependency](#shared-protocol-dependency)
22
+ - [Control-flow dependency](#control-flow-dependency)
23
+ - [Model-routing dependency](#model-routing-dependency)
24
+ - [Model quality defaults for orchestration](#model-quality-defaults-for-orchestration)
25
+ - [HUD skill dependency](#hud-skill-dependency)
26
+ - [tmux skill dependency](#tmux-skill-dependency)
27
+ - [When to use](#when-to-use)
28
+ - [Success condition](#success-condition)
29
+ - [Dispatch modes](#dispatch-modes)
30
+ - [Orchestration loops](#orchestration-loops)
31
+ - [Bootstrap and queue targeting](#bootstrap-and-queue-targeting)
32
+ - [Dispatch templates](#dispatch-templates)
33
+ - [Execution HUD (subagents profile)](#execution-hud-subagents-profile)
34
+ - [Evaluation scenarios](#evaluation-scenarios)
35
+ - [Reconciliation](#reconciliation)
36
+ - [Safety](#safety)
37
+
38
+ ## Shared protocol dependency
39
+
40
+ This skill executes DAG work defined by **`protocol`**.
41
+
42
+ Before execution begins, load that skill and enforce:
43
+
44
+ - Protocol ID/tag: `hierarchical-work.protocol/v1` + `proto:hierarchical-work-v1`
45
+ - Canonical node kinds, context tags, and invariants
46
+ - Primitive semantics (`read_tree`, `claim`, `spawn`, `fork`, `ask`, `expand`, `complete`, `serial`)
47
+
48
+ Do not run subagent orchestration against alternate protocol tags.
49
+
50
+ ## Control-flow dependency
51
+
52
+ When a subtree declares explicit loop/termination policy (for example
53
+ `flow:review-gated-v1`), load **`control-flow`** and apply policy transitions as
54
+ an overlay on orchestration primitives.
55
+
56
+ - Keep DAG structure protocol-valid (`protocol` remains source-of-truth).
57
+ - Compile control-flow decisions into protocol primitives (`spawn`, `expand`,
58
+ `ask`, `complete`, `serial`), not ad-hoc mutations.
59
+
60
+ ## Model-routing dependency
61
+
62
+ When a subtree declares per-issue model/provider/thinking policy (for example
63
+ `route:model-routing-v1`), load **`model-routing`** and apply routing transitions
64
+ as an overlay on orchestration primitives.
65
+
66
+ - Keep DAG structure protocol-valid (`protocol` remains source-of-truth).
67
+ - Drive recommendations from live harness capabilities (`mu control harness --json`).
68
+ - Apply route selections with per-turn/per-session overrides (`mu exec`/`mu turn`
69
+ `--provider --model --thinking`) instead of mutating workspace-global defaults.
70
+ - Emit auditable route packets (`ROUTE_RECOMMENDATION`, `ROUTE_FALLBACK`,
71
+ `ROUTE_DEGRADED`) in forum topics.
72
+
73
+ ## Model quality defaults for orchestration
74
+
75
+ When executing protocol/runtime/schema/cross-adapter DAGs, enforce an explicit
76
+ high-quality model profile unless the user overrides it.
77
+
78
+ Default high-quality profile:
79
+
80
+ - provider: `openai-codex`
81
+ - model: `gpt-5.3-codex`
82
+ - thinking: `xhigh`
83
+
84
+ Operational rules:
85
+
86
+ 1. Worker launches must pass explicit `--provider --model --thinking`.
87
+ 2. Do not use mini/fast profiles for close/validate/signoff passes.
88
+ 3. If you must downgrade, post a `ROUTE_FALLBACK` packet with rationale and
89
+ expected risk/tradeoff before continuing.
90
+ 4. Keep profile policy in `model-routing` (`ROUTE_POLICY`) so skills can update
91
+ behavior without extension-code changes.
92
+ 5. Helper shell workflows must fail fast with actionable usage text whenever
93
+ required provider/model/thinking args are missing.
94
+
95
+ ## HUD skill dependency
96
+
97
+ Before emitting or mutating subagent HUD state, load **`hud`** and follow its canonical contract.
98
+ HUD usage is not optional for this skill.
99
+
100
+ - Treat `hud` as source-of-truth for generic `mu_hud` actions, `HudDoc` shape, and rendering constraints.
101
+ - This execution skill defines orchestration-specific conventions only (for example `hud_id: "subagents"`, queue/activity semantics).
102
+
103
+ ## tmux skill dependency
104
+
105
+ Before spawning/inspecting worker sessions, load **`tmux`** and follow its
106
+ canonical session lifecycle and bounded send/capture protocol.
107
+
108
+ - Treat `tmux` as source-of-truth for session ownership, completion markers, and teardown.
109
+ - This execution skill defines orchestration semantics and queue policy.
110
+
111
+ ## When to use
112
+
113
+ - Work is represented as issue-scoped deliverables with explicit outcomes.
114
+ - Dependencies may unblock over time.
115
+ - You want unattended progress between manual check-ins.
116
+
117
+ ## Success condition
118
+
119
+ - Each executable issue is claimed, worked, and closed with an explicit outcome.
120
+ - Results are posted in `issue:<id>` forum topics.
121
+ - Root completion is validated via `mu issues validate <root-id>`.
122
+
123
+ ## Dispatch modes
124
+
125
+ ### 1) Heartbeat dispatch (orchestrator cadence)
126
+
127
+ Use when you want orchestration to continue over time.
128
+
129
+ Each heartbeat tick runs **one bounded orchestration pass**:
130
+
131
+ 1. Read queue/tree state.
132
+ 2. Select one protocol primitive/action.
133
+ 3. Apply one bounded action.
134
+ 4. Verify state + log progress.
135
+ 5. Exit.
136
+
137
+ Heartbeat dispatch is the orchestrator clock. It should supervise/advance the graph,
138
+ not run unbounded worker sessions.
139
+
140
+ ### 2) tmux dispatch (parallel workers)
141
+
142
+ Use when several ready leaves should execute concurrently now.
143
+
144
+ Spawn one tmux session per ready issue. Each worker claims one issue, executes one
145
+ full issue loop, then exits.
146
+
147
+ ## Orchestration loops
148
+
149
+ ### Orchestrator heartbeat tick loop
150
+
151
+ For root `<root-id>`:
152
+
153
+ 1. Inspect queue and local protocol state:
154
+
155
+ ```bash
156
+ mu issues get <root-id> --pretty
157
+ mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
158
+ mu forum read issue:<root-id> --limit 20 --pretty
159
+ ```
160
+
161
+ 2. Choose exactly one action/primitive from `protocol`.
162
+ 3. Apply it.
163
+ 4. Verify (`get`, `children`, `ready`, `validate`).
164
+ 5. Update `hud_id:"subagents"` (required) and emit a compact snapshot.
165
+ 6. Post a human-facing `ORCH_PASS` update to forum:
166
+ - start with a short title that captures status in plain language
167
+ - follow with one concise paragraph covering: project objective context, milestone moved this pass, impact, overall progress, and next high-level step
168
+ - include queue/worker/drift internals only when diagnosing blocker/anomaly.
169
+ 7. Exit tick.
170
+
171
+ Stop automation when `mu issues validate <root-id>` returns final.
172
+
173
+ ### Worker issue loop (single issue pass)
174
+
175
+ For claimed issue `<issue-id>` under `<root-id>`:
176
+
177
+ 1. Run `read_tree`.
178
+ 2. Choose one primitive:
179
+ - route policy present and no valid route decision -> apply one `model-routing` transition
180
+ - missing input -> `ask`
181
+ - needs decomposition -> `expand`
182
+ - directly solvable -> `complete`
183
+ 3. Apply primitive.
184
+ 4. Verify state.
185
+ 5. Post progress to `issue:<issue-id>` focused on deliverable status, capability impact, and next step.
186
+
187
+ Repeat bounded passes until issue closes.
188
+
189
+ ## Bootstrap and queue targeting
190
+
191
+ If root DAG does not yet exist, create it using the
192
+ `protocol` bootstrap template first.
193
+
194
+ During orchestration, always scope queue reads with protocol tag:
195
+
196
+ ```bash
197
+ mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
198
+ ```
199
+
200
+ ## Dispatch templates
201
+
202
+ ### A) Heartbeat autopilot (preferred for supervision)
203
+
204
+ ```bash
205
+ root_id="${1:-}"
206
+ provider="${2:-}"
207
+ model="${3:-}"
208
+ thinking="${4:-}"
209
+
210
+ if [ -z "$root_id" ] || [ -z "$provider" ] || [ -z "$model" ] || [ -z "$thinking" ]; then
211
+ cat >&2 <<'USAGE'
212
+ usage: ./orch-heartbeat.sh <root-id> <provider> <model> <thinking>
213
+ example: ./orch-heartbeat.sh mu-4be265df openai-codex gpt-5.3-codex xhigh
214
+ USAGE
215
+ exit 64
216
+ fi
217
+
218
+ mu heartbeats create \
219
+ --title "hierarchical-work-v1 ${root_id}" \
220
+ --reason orchestration_v1 \
221
+ --every-ms 15000 \
222
+ --prompt "Use skills subagents, protocol, execution, control-flow, model-routing, and hud for root ${root_id}. Run exactly one bounded orchestration pass: inspect the proto:hierarchical-work-v1 queue, perform exactly one corrective orchestration action (including in_progress-without-worker drift recovery) or claim/work-start one ready issue, then verify state. If flow:* policy tags are present, apply one control-flow transition from the control-flow skill in this pass. If route:* policy tags are present, apply one model-routing transition from the model-routing skill in this pass using live `mu control harness` capabilities and per-turn provider/model/thinking overrides. If route:* policy tags are absent, use the high-quality orchestration profile (openai-codex / gpt-5.3-codex / xhigh) for any execution launch in this pass. Any execution launch in this pass must pass explicit overrides: --provider ${provider} --model ${model} --thinking ${thinking}; if this tuple cannot be used, stop and post BLOCKED with remediation options. Report human-facing progress as a titled status note plus one concise paragraph that explains project context, milestone moved, impact, overall progress, and next high-level step; avoid low-level orchestration internals unless diagnosing a blocker/anomaly. Post a matching ORCH_PASS update to issue:${root_id}. Stop when 'mu issues validate ${root_id}' is final."
223
+ ```
224
+
225
+ Reusable status-voice add-on for heartbeat prompts (copy/paste):
226
+
227
+ ```text
228
+ Write each ORCH_PASS as a human status note, not operator telemetry.
229
+ Use a short plain-language title + one concise paragraph covering:
230
+ project objective, milestone moved this pass, impact/precondition,
231
+ overall progress, and next high-level step.
232
+ Keep queue/worker/session internals out unless diagnosing a blocker.
233
+ ```
234
+
235
+ ### B) tmux fan-out (parallel workers)
236
+
237
+ ```bash
238
+ root_id="${1:-}"
239
+ provider="${2:-}"
240
+ model="${3:-}"
241
+ thinking="${4:-}"
242
+ limit="${5:-3}"
243
+
244
+ if [ -z "$root_id" ] || [ -z "$provider" ] || [ -z "$model" ] || [ -z "$thinking" ]; then
245
+ cat >&2 <<'USAGE'
246
+ usage: ./orch-fanout.sh <root-id> <provider> <model> <thinking> [limit]
247
+ example: ./orch-fanout.sh mu-4be265df openai-codex gpt-5.3-codex xhigh 3
248
+ USAGE
249
+ exit 64
250
+ fi
251
+
252
+ run_id="$(date +%Y%m%d-%H%M%S)"
253
+ for issue_id in $(mu issues ready --root "$root_id" --tag proto:hierarchical-work-v1 --json | jq -r '.[].id' | head -n "$limit"); do
254
+ session="mu-sub-${run_id}-${issue_id}"
255
+ tmux new-session -d -s "$session" \
256
+ "cd '$PWD' && mu exec --provider '$provider' --model '$model' --thinking '$thinking' 'Use skills subagents, protocol, execution, control-flow, model-routing, and hud. Work issue ${issue_id} using hierarchical-work.protocol/v1. If flow:* policy tags are present, apply the control-flow overlay before selecting the next primitive. If route:* policy tags are present, apply the model-routing overlay using live harness capabilities before selecting the next primitive. Claim first, then run one full control loop.' ; rc=\$?; echo __MU_DONE__:\$rc"
257
+ done
258
+ ```
259
+
260
+ ## Execution HUD (subagents profile)
261
+
262
+ HUD usage is required for this skill. Truth still lives in issues/forum.
263
+
264
+ ```text
265
+ /mu hud on
266
+ /mu hud status
267
+ /mu hud snapshot
268
+ ```
269
+
270
+ Tool: `mu_hud`
271
+
272
+ - Canonical contract: see skill `hud`
273
+ - Actions: `status`, `snapshot`, `on`, `off`, `toggle`, `set`, `update`, `replace`, `remove`, `clear`
274
+ - Subagents convention: maintain a HUD doc with `hud_id: "subagents"`
275
+ - Suggested subagents doc structure:
276
+ - chips: health, mode, paused
277
+ - sections: queue counts + recent activity lines
278
+ - actions: refresh/spawn command hooks (if desired)
279
+ - metadata: include `style_preset:"subagents"` for consistent renderer emphasis
280
+ - Example update:
281
+ - `{"action":"set", "doc": {"hud_id":"subagents", ...}}` (see `hud` skill for exact shape)
282
+ - Follow the HUD ownership and teardown protocol from `hud` skill for completion and handoff.
283
+
284
+ ## Evaluation scenarios
285
+
286
+ 1. **Heartbeat bounded-orchestration tick**
287
+ - Setup: root issue with multiple ready leaves tagged `proto:hierarchical-work-v1`.
288
+ - Expected: one heartbeat tick performs exactly one bounded orchestration action, verifies state, posts a high-level titled narrative status update, and exits.
289
+
290
+ 2. **tmux fan-out on ready leaves**
291
+ - Setup: at least three independent ready issues under one root.
292
+ - Expected: one worker session per issue is spawned, each worker claims before work, and each writes `START`/`RESULT` packets to `issue:<id>`.
293
+
294
+ 3. **Human-question blocking flow (`ask`)**
295
+ - Setup: worker encounters missing critical input.
296
+ - Expected: skill applies protocol `ask` semantics, creates a human-input node, and downstream work remains blocked until the answer issue closes.
297
+
298
+ 4. **Model-routing overlay with fallback**
299
+ - Setup: ready issue tagged `route:model-routing-v1` and selected model fails at launch.
300
+ - Expected: one bounded pass emits `ROUTE_FALLBACK`, selects alternate/provider fallback deterministically, and continues execution without violating DAG protocol rules.
301
+
302
+ ## Reconciliation
303
+
304
+ - Run `mu issues validate <root-id>` before declaring completion.
305
+ - Merge synth-node outputs into one final user-facing result.
306
+ - Convert unresolved gaps into new child issues tagged `proto:hierarchical-work-v1`.
307
+ - Tear down temporary tmux sessions.
308
+ - Tear down/handoff `hud_id:"subagents"` ownership following the `hud` skill protocol.
309
+
310
+ ## Safety
311
+
312
+ - Prefer small, reversible child issues.
313
+ - Keep child prompts explicit about deliverables + acceptance criteria.
314
+ - Pause spawning while queue semantics are unclear.
315
+ - Never overwrite unrelated files across shards.
@@ -19,7 +19,7 @@ This skill is the canonical HUD reference for:
19
19
  - [HudDoc shape](#huddoc-shape)
20
20
  - [Recommended turn loop](#recommended-turn-loop)
21
21
  - [Ownership and teardown protocol](#ownership-and-teardown-protocol)
22
- - [Planning and subagents profiles](#planning-and-subagents-profiles)
22
+ - [Planning, subagents, and model-routing profiles](#planning-subagents-and-model-routing-profiles)
23
23
  - [Determinism and rendering limits](#determinism-and-rendering-limits)
24
24
  - [Evaluation scenarios](#evaluation-scenarios)
25
25
 
@@ -143,7 +143,7 @@ that skill declares HUD-required behavior.
143
143
 
144
144
  1. **Own explicit `hud_id` values**
145
145
  - Each active skill owns one canonical doc id (for example `planning`,
146
- `subagents`, `control-flow`).
146
+ `subagents`, `control-flow`, `model-routing`).
147
147
  - Prefer `remove <hud_id>` over `clear` to avoid deleting other skills’ docs.
148
148
 
149
149
  2. **Teardown is mandatory at skill end**
@@ -168,12 +168,13 @@ Example full teardown (no next HUD skill):
168
168
  {"action":"off"}
169
169
  ```
170
170
 
171
- ## Planning and subagents profiles
171
+ ## Planning, subagents, and model-routing profiles
172
172
 
173
173
  Use profile-specific `hud_id` values:
174
174
 
175
175
  - planning profile: `hud_id: "planning"`
176
176
  - subagents profile: `hud_id: "subagents"`
177
+ - model-routing profile: `hud_id: "model-routing"`
177
178
 
178
179
  Treat these as conventions layered on top of this generic contract.
179
180