@femtomc/mu-agent 26.2.106 → 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 -17
  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 +2 -2
  22. package/prompts/skills/{heartbeats → automation/heartbeats}/SKILL.md +2 -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 +36 -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 -255
  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/{model-routing → subagents/model-routing}/SKILL.md +35 -8
  32. package/prompts/skills/{planning → subagents/planning}/SKILL.md +7 -7
  33. package/prompts/skills/{orchestration → subagents/protocol}/SKILL.md +7 -10
  34. package/prompts/skills/writing/SKILL.md +1 -0
  35. /package/prompts/skills/{memory → core/memory}/SKILL.md +0 -0
  36. /package/prompts/skills/{setup-discord → messaging/setup-discord}/SKILL.md +0 -0
  37. /package/prompts/skills/{setup-neovim → messaging/setup-neovim}/SKILL.md +0 -0
  38. /package/prompts/skills/{setup-slack → messaging/setup-slack}/SKILL.md +0 -0
  39. /package/prompts/skills/{setup-telegram → messaging/setup-telegram}/SKILL.md +0 -0
  40. /package/prompts/skills/{hud → subagents/hud}/SKILL.md +0 -0
@@ -1,268 +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
- - [Model-routing dependency](#model-routing-dependency)
14
- - [HUD skill dependency](#hud-skill-dependency)
15
- - [tmux skill dependency](#tmux-skill-dependency)
16
- - [When to use](#when-to-use)
17
- - [Success condition](#success-condition)
18
- - [Dispatch modes](#dispatch-modes)
19
- - [Orchestration loops](#orchestration-loops)
20
- - [Bootstrap and queue targeting](#bootstrap-and-queue-targeting)
21
- - [Dispatch templates](#dispatch-templates)
22
- - [Subagents HUD](#subagents-hud)
23
- - [Evaluation scenarios](#evaluation-scenarios)
24
- - [Reconciliation](#reconciliation)
25
- - [Safety](#safety)
10
+ ## Subskills
26
11
 
27
- ## 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.
28
18
 
29
- Use this skill for **durable multi-agent orchestration**: work that must keep moving
30
- over time, not just one-shot execution.
19
+ ## Hard-cutover naming
31
20
 
32
- This skill is execution-supervision focused:
21
+ - Use `protocol` (not `orchestration`).
22
+ - Use `execution` (not the old execution leaf named `subagents`).
33
23
 
34
- - `mu heartbeats` / `mu cron` = orchestrator wake cadence
35
- - `tmux` + `mu exec` = parallel worker execution
36
- - subagents HUD = operator observability/control board
24
+ ## Recommended bundles
37
25
 
38
- 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
39
29
 
40
- ## Shared protocol dependency
30
+ ## Common patterns
41
31
 
42
- This skill executes DAG work defined by **`orchestration`**.
43
-
44
- Before orchestration begins, load that skill and enforce:
45
-
46
- - Protocol ID/tag: `hierarchical-work.protocol/v1` + `proto:hierarchical-work-v1`
47
- - Canonical node kinds, context tags, and invariants
48
- - Primitive semantics (`read_tree`, `claim`, `spawn`, `fork`, `ask`, `expand`, `complete`, `serial`)
49
-
50
- Do not run subagent orchestration against alternate protocol tags.
51
-
52
- ## Control-flow dependency
53
-
54
- When a subtree declares explicit loop/termination policy (for example
55
- `flow:review-gated-v1`), load **`control-flow`** and apply policy transitions as
56
- an overlay on orchestration primitives.
57
-
58
- - Keep DAG structure protocol-valid (`orchestration` remains source-of-truth).
59
- - Compile control-flow decisions into protocol primitives (`spawn`, `expand`,
60
- `ask`, `complete`, `serial`), not ad-hoc mutations.
61
-
62
- ## Model-routing dependency
63
-
64
- When a subtree declares per-issue model/provider/thinking policy (for example
65
- `route:model-routing-v1`), load **`model-routing`** and apply routing transitions
66
- as an overlay on orchestration primitives.
67
-
68
- - Keep DAG structure protocol-valid (`orchestration` remains source-of-truth).
69
- - Drive recommendations from live harness capabilities (`mu control harness --json`).
70
- - Apply route selections with per-turn/per-session overrides (`mu exec`/`mu turn`
71
- `--provider --model --thinking`) instead of mutating workspace-global defaults.
72
- - Emit auditable route packets (`ROUTE_RECOMMENDATION`, `ROUTE_FALLBACK`,
73
- `ROUTE_DEGRADED`) in forum topics.
74
-
75
- ## HUD skill dependency
76
-
77
- Before emitting or mutating subagent HUD state, load **`hud`** and follow its canonical contract.
78
- HUD usage is not optional for this skill.
79
-
80
- - Treat `hud` as source-of-truth for generic `mu_hud` actions, `HudDoc` shape, and rendering constraints.
81
- - This subagents skill defines orchestration-specific conventions only (for example `hud_id: "subagents"`, queue/activity semantics).
82
-
83
- ## tmux skill dependency
84
-
85
- Before spawning/inspecting worker sessions, load **`tmux`** and follow its
86
- canonical session lifecycle and bounded send/capture protocol.
87
-
88
- - Treat `tmux` as source-of-truth for session ownership, completion markers, and teardown.
89
- - This subagents skill defines orchestration semantics and queue policy.
90
-
91
- ## When to use
92
-
93
- - Work is represented as issue-scoped deliverables with explicit outcomes.
94
- - Dependencies may unblock over time.
95
- - You want unattended progress between manual check-ins.
96
-
97
- ## Success condition
98
-
99
- - Each executable issue is claimed, worked, and closed with an explicit outcome.
100
- - Results are posted in `issue:<id>` forum topics.
101
- - Root completion is validated via `mu issues validate <root-id>`.
102
-
103
- ## Dispatch modes
104
-
105
- ### 1) Heartbeat dispatch (orchestrator cadence)
106
-
107
- Use when you want orchestration to continue over time.
108
-
109
- Each heartbeat tick runs **one bounded orchestration pass**:
110
-
111
- 1. Read queue/tree state.
112
- 2. Select one protocol primitive/action.
113
- 3. Apply one bounded action.
114
- 4. Verify state + log progress.
115
- 5. Exit.
116
-
117
- Heartbeat dispatch is the orchestrator clock. It should supervise/advance the graph,
118
- not run unbounded worker sessions.
119
-
120
- ### 2) tmux dispatch (parallel workers)
121
-
122
- Use when several ready leaves should execute concurrently now.
123
-
124
- Spawn one tmux session per ready issue. Each worker claims one issue, executes one
125
- full issue loop, then exits.
126
-
127
- ## Orchestration loops
128
-
129
- ### Orchestrator heartbeat tick loop
130
-
131
- For root `<root-id>`:
132
-
133
- 1. Inspect queue and local protocol state:
134
-
135
- ```bash
136
- mu issues get <root-id> --pretty
137
- mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
138
- mu forum read issue:<root-id> --limit 20 --pretty
139
- ```
140
-
141
- 2. Choose exactly one action/primitive from `orchestration`.
142
- 3. Apply it.
143
- 4. Verify (`get`, `children`, `ready`, `validate`).
144
- 5. Update `hud_id:"subagents"` (required) and emit a compact snapshot.
145
- 6. Post a human-facing `ORCH_PASS` update to forum:
146
- - start with a short title that captures status in plain language
147
- - follow with one concise paragraph covering: project objective context, milestone moved this pass, impact, overall progress, and next high-level step
148
- - include queue/worker/drift internals only when diagnosing blocker/anomaly.
149
- 7. Exit tick.
150
-
151
- Stop automation when `mu issues validate <root-id>` returns final.
152
-
153
- ### Worker issue loop (single issue pass)
154
-
155
- For claimed issue `<issue-id>` under `<root-id>`:
156
-
157
- 1. Run `read_tree`.
158
- 2. Choose one primitive:
159
- - route policy present and no valid route decision -> apply one `model-routing` transition
160
- - missing input -> `ask`
161
- - needs decomposition -> `expand`
162
- - directly solvable -> `complete`
163
- 3. Apply primitive.
164
- 4. Verify state.
165
- 5. Post progress to `issue:<issue-id>` focused on deliverable status, capability impact, and next step.
166
-
167
- Repeat bounded passes until issue closes.
168
-
169
- ## Bootstrap and queue targeting
170
-
171
- If root DAG does not yet exist, create it using the
172
- `orchestration` bootstrap template first.
173
-
174
- During orchestration, always scope queue reads with protocol tag:
175
-
176
- ```bash
177
- mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
178
- ```
179
-
180
- ## Dispatch templates
181
-
182
- ### A) Heartbeat autopilot (preferred for supervision)
183
-
184
- ```bash
185
- mu heartbeats create \
186
- --title "hierarchical-work-v1 <root-id>" \
187
- --reason orchestration_v1 \
188
- --every-ms 15000 \
189
- --prompt "Use skills subagents, orchestration, 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. 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."
190
- ```
191
-
192
- Reusable status-voice add-on for heartbeat prompts (copy/paste):
193
-
194
- ```text
195
- Write each ORCH_PASS as a human status note, not operator telemetry.
196
- Use a short plain-language title + one concise paragraph covering:
197
- project objective, milestone moved this pass, impact/precondition,
198
- overall progress, and next high-level step.
199
- Keep queue/worker/session internals out unless diagnosing a blocker.
200
- ```
201
-
202
- ### B) tmux fan-out (parallel workers)
203
-
204
- ```bash
205
- run_id="$(date +%Y%m%d-%H%M%S)"
206
- for issue_id in $(mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --json | jq -r '.[].id' | head -n 3); do
207
- session="mu-sub-${run_id}-${issue_id}"
208
- tmux new-session -d -s "$session" \
209
- "cd '$PWD' && mu exec 'Use skills subagents, orchestration, 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"
210
- done
211
- ```
212
-
213
- ## Subagents HUD
214
-
215
- HUD usage is required for this skill. Truth still lives in issues/forum.
216
-
217
- ```text
218
- /mu hud on
219
- /mu hud status
220
- /mu hud snapshot
221
- ```
222
-
223
- Tool: `mu_hud`
224
-
225
- - Canonical contract: see skill `hud`
226
- - Actions: `status`, `snapshot`, `on`, `off`, `toggle`, `set`, `update`, `replace`, `remove`, `clear`
227
- - Subagents convention: maintain a HUD doc with `hud_id: "subagents"`
228
- - Suggested subagents doc structure:
229
- - chips: health, mode, paused
230
- - sections: queue counts + recent activity lines
231
- - actions: refresh/spawn command hooks (if desired)
232
- - metadata: include `style_preset:"subagents"` for consistent renderer emphasis
233
- - Example update:
234
- - `{"action":"set", "doc": {"hud_id":"subagents", ...}}` (see `hud` skill for exact shape)
235
- - Follow the HUD ownership and teardown protocol from `hud` skill for completion and handoff.
236
-
237
- ## Evaluation scenarios
238
-
239
- 1. **Heartbeat bounded-orchestration tick**
240
- - Setup: root issue with multiple ready leaves tagged `proto:hierarchical-work-v1`.
241
- - Expected: one heartbeat tick performs exactly one bounded orchestration action, verifies state, posts a high-level titled narrative status update, and exits.
242
-
243
- 2. **tmux fan-out on ready leaves**
244
- - Setup: at least three independent ready issues under one root.
245
- - Expected: one worker session per issue is spawned, each worker claims before work, and each writes `START`/`RESULT` packets to `issue:<id>`.
246
-
247
- 3. **Human-question blocking flow (`ask`)**
248
- - Setup: worker encounters missing critical input.
249
- - Expected: skill applies protocol `ask` semantics, creates a human-input node, and downstream work remains blocked until the answer issue closes.
250
-
251
- 4. **Model-routing overlay with fallback**
252
- - Setup: ready issue tagged `route:model-routing-v1` and selected model fails at launch.
253
- - Expected: one bounded pass emits `ROUTE_FALLBACK`, selects alternate/provider fallback deterministically, and continues execution without violating DAG protocol rules.
254
-
255
- ## Reconciliation
256
-
257
- - Run `mu issues validate <root-id>` before declaring completion.
258
- - Merge synth-node outputs into one final user-facing result.
259
- - Convert unresolved gaps into new child issues tagged `proto:hierarchical-work-v1`.
260
- - Tear down temporary tmux sessions.
261
- - Tear down/handoff `hud_id:"subagents"` ownership following the `hud` skill protocol.
262
-
263
- ## Safety
264
-
265
- - Prefer small, reversible child issues.
266
- - Keep child prompts explicit about deliverables + acceptance criteria.
267
- - Pause spawning while queue semantics are unclear.
268
- - 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.