@femtomc/mu-agent 26.2.107 → 26.2.108
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/README.md +5 -7
- package/assets/mu-tui-logo.png +0 -0
- package/dist/extensions/index.d.ts +0 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +0 -1
- package/dist/extensions/mu-operator.d.ts.map +1 -1
- package/dist/extensions/mu-operator.js +0 -2
- package/dist/extensions/mu-serve.d.ts.map +1 -1
- package/dist/extensions/mu-serve.js +0 -2
- package/dist/extensions/ui.d.ts.map +1 -1
- package/dist/extensions/ui.js +745 -25
- package/dist/operator.d.ts +7 -337
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +1 -62
- package/package.json +33 -33
- package/prompts/skills/core/SKILL.md +2 -2
- package/prompts/skills/core/memory/SKILL.md +2 -2
- package/prompts/skills/core/mu/SKILL.md +18 -7
- package/prompts/skills/subagents/SKILL.md +92 -8
- package/prompts/skills/subagents/control-flow/SKILL.md +118 -13
- package/prompts/skills/subagents/execution/SKILL.md +144 -31
- package/prompts/skills/subagents/model-routing/SKILL.md +146 -13
- package/prompts/skills/subagents/planning/SKILL.md +239 -90
- package/prompts/skills/writing/SKILL.md +2 -2
- package/dist/extensions/hud.d.ts +0 -4
- package/dist/extensions/hud.d.ts.map +0 -1
- package/dist/extensions/hud.js +0 -483
- package/prompts/skills/subagents/hud/SKILL.md +0 -205
|
@@ -23,7 +23,7 @@ semantics.
|
|
|
23
23
|
- [Planning handoff contract](#planning-handoff-contract)
|
|
24
24
|
- [Subagents/heartbeat execution contract](#subagentsheartbeat-execution-contract)
|
|
25
25
|
- [Failure + fallback policy](#failure--fallback-policy)
|
|
26
|
-
- [
|
|
26
|
+
- [mu_ui visibility and handoff](#mu_ui-visibility-and-handoff)
|
|
27
27
|
- [Evaluation scenarios](#evaluation-scenarios)
|
|
28
28
|
|
|
29
29
|
## Purpose
|
|
@@ -44,7 +44,7 @@ Load these skills before applying model-routing policies:
|
|
|
44
44
|
- `protocol` (protocol primitives/invariants)
|
|
45
45
|
- `execution` (durable execution runtime)
|
|
46
46
|
- `heartbeats` and/or `crons` (scheduler clock)
|
|
47
|
-
- `
|
|
47
|
+
- `mu` (for `/mu ui` inspection commands and communication checks)
|
|
48
48
|
- `control-flow` (optional; when loop/termination overlays are also active)
|
|
49
49
|
|
|
50
50
|
## Core contract
|
|
@@ -245,7 +245,7 @@ For one-shot execution:
|
|
|
245
245
|
|
|
246
246
|
```bash
|
|
247
247
|
mu exec --provider <provider> --model <model> --thinking <thinking> \
|
|
248
|
-
"Use skills subagents, protocol, execution, model-routing, and
|
|
248
|
+
"Use skills subagents, protocol, execution, model-routing, and mu. Work issue <issue-id> and keep routing visibility current via mu_ui."
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
For existing session turn:
|
|
@@ -299,18 +299,19 @@ Per orchestrator tick:
|
|
|
299
299
|
5. Verify with:
|
|
300
300
|
- `mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty`
|
|
301
301
|
- `mu issues validate <root-id>`
|
|
302
|
-
6.
|
|
302
|
+
6. Upsert routing visibility via `mu_ui` (`ui_id:"ui:subagents"` when orchestration is shared, or `ui_id:"ui:model-routing"` when standalone).
|
|
303
303
|
7. Post one concise `ORCH_PASS` status update.
|
|
304
304
|
8. If root is final, disable supervising heartbeat.
|
|
305
305
|
|
|
306
306
|
Reusable heartbeat prompt fragment:
|
|
307
307
|
|
|
308
308
|
```text
|
|
309
|
-
Use skills subagents, protocol, execution, model-routing, and
|
|
309
|
+
Use skills subagents, protocol, execution, model-routing, and mu.
|
|
310
310
|
For root <root-id>, enforce route:model-routing-v1.
|
|
311
311
|
Run exactly one bounded routing/orchestration transition pass: compute or validate
|
|
312
312
|
one issue's model recommendation from live `mu control harness` capabilities,
|
|
313
|
-
apply one action,
|
|
313
|
+
apply one action, keep route status current via mu_ui (`ui:subagents` or
|
|
314
|
+
`ui:model-routing`), verify DAG state, post one ORCH_PASS, then stop.
|
|
314
315
|
If validate is final, disable the supervising heartbeat and report completion.
|
|
315
316
|
```
|
|
316
317
|
|
|
@@ -334,15 +335,147 @@ If validate is final, disable the supervising heartbeat and report completion.
|
|
|
334
335
|
- every route change emits forum packet (`ROUTE_RECOMMENDATION`,
|
|
335
336
|
`ROUTE_FALLBACK`, `ROUTE_DEGRADED`)
|
|
336
337
|
|
|
337
|
-
##
|
|
338
|
+
## mu_ui visibility and handoff
|
|
338
339
|
|
|
339
|
-
|
|
340
|
+
Use `mu_ui` as the primary communication surface for active model-routing
|
|
341
|
+
execution.
|
|
340
342
|
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
343
|
+
- Publish routing status in one status-profile doc:
|
|
344
|
+
- shared orchestration: `ui_id:"ui:subagents"`
|
|
345
|
+
- standalone model-routing loop: `ui_id:"ui:model-routing"`
|
|
346
|
+
- Set status profile metadata for deterministic snapshots:
|
|
347
|
+
- `metadata.profile.id: "subagents"` or `"model-routing"`
|
|
348
|
+
- `metadata.profile.variant: "status"`
|
|
349
|
+
- `metadata.profile.snapshot.compact|multiline`
|
|
350
|
+
- Keep status docs non-interactive (`actions: []`).
|
|
351
|
+
- For user decisions (for example hard-constraint escalation), publish a separate
|
|
352
|
+
interactive prompt doc (for example `ui_id:"ui:model-routing:escalation"`).
|
|
353
|
+
- Update routing status docs each bounded pass before posting `ORCH_PASS`.
|
|
354
|
+
- On completion or handoff, remove model-routing-owned docs with explicit
|
|
355
|
+
`mu_ui remove` actions. Prefer `remove` over `clear`.
|
|
356
|
+
|
|
357
|
+
### Canonical status doc (`ui:model-routing`)
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"action": "set",
|
|
362
|
+
"doc": {
|
|
363
|
+
"v": 1,
|
|
364
|
+
"ui_id": "ui:model-routing",
|
|
365
|
+
"title": "Model-routing status",
|
|
366
|
+
"summary": "issue=<issue-id> · selected=openai-codex/gpt-5.3-codex/xhigh · alternates=2",
|
|
367
|
+
"components": [
|
|
368
|
+
{
|
|
369
|
+
"kind": "key_value",
|
|
370
|
+
"id": "route",
|
|
371
|
+
"title": "Current route",
|
|
372
|
+
"rows": [
|
|
373
|
+
{ "key": "policy", "value": "route:model-routing-v1" },
|
|
374
|
+
{ "key": "issue", "value": "<issue-id>" },
|
|
375
|
+
{ "key": "selected", "value": "openai-codex/gpt-5.3-codex/xhigh" },
|
|
376
|
+
{ "key": "alternates", "value": "2" },
|
|
377
|
+
{ "key": "next", "value": "Launch worker with explicit overrides" }
|
|
378
|
+
],
|
|
379
|
+
"metadata": {}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"kind": "list",
|
|
383
|
+
"id": "recent",
|
|
384
|
+
"title": "Recent routing events",
|
|
385
|
+
"items": [
|
|
386
|
+
{
|
|
387
|
+
"id": "e1",
|
|
388
|
+
"label": "ROUTE_RECOMMENDATION posted",
|
|
389
|
+
"detail": "selected openai-codex/gpt-5.3-codex/xhigh"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"id": "e2",
|
|
393
|
+
"label": "fallback budget",
|
|
394
|
+
"detail": "openrouter/google/gemini-3.1-pro-preview/high"
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"metadata": {}
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
"actions": [],
|
|
401
|
+
"revision": { "id": "model-routing-status", "version": 7 },
|
|
402
|
+
"updated_at_ms": 1772069500000,
|
|
403
|
+
"metadata": {
|
|
404
|
+
"profile": {
|
|
405
|
+
"id": "model-routing",
|
|
406
|
+
"variant": "status",
|
|
407
|
+
"snapshot": {
|
|
408
|
+
"compact": "selected=openai-codex/gpt-5.3-codex/xhigh · alternates=2",
|
|
409
|
+
"multiline": "issue: <issue-id>\nselected: openai-codex/gpt-5.3-codex/xhigh\nalternates: 2\nnext: launch worker"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Canonical escalation prompt (`ui:model-routing:escalation`)
|
|
418
|
+
|
|
419
|
+
```json
|
|
420
|
+
{
|
|
421
|
+
"action": "set",
|
|
422
|
+
"doc": {
|
|
423
|
+
"v": 1,
|
|
424
|
+
"ui_id": "ui:model-routing:escalation",
|
|
425
|
+
"title": "Routing escalation required",
|
|
426
|
+
"summary": "No authenticated model satisfies image + deep reasoning constraints.",
|
|
427
|
+
"components": [
|
|
428
|
+
{
|
|
429
|
+
"kind": "text",
|
|
430
|
+
"id": "question",
|
|
431
|
+
"text": "Routing is blocked by missing provider capability. Should execution wait for provider auth or run with degraded constraints?",
|
|
432
|
+
"metadata": {}
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"kind": "list",
|
|
436
|
+
"id": "options",
|
|
437
|
+
"title": "Choices",
|
|
438
|
+
"items": [
|
|
439
|
+
{ "id": "opt-auth", "label": "Pause and authenticate provider" },
|
|
440
|
+
{ "id": "opt-degrade", "label": "Proceed with degraded route" }
|
|
441
|
+
],
|
|
442
|
+
"metadata": {}
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
"actions": [
|
|
446
|
+
{
|
|
447
|
+
"id": "wait-for-auth",
|
|
448
|
+
"label": "Wait for provider auth",
|
|
449
|
+
"kind": "primary",
|
|
450
|
+
"payload": {},
|
|
451
|
+
"metadata": { "command_text": "/answer wait-for-auth" }
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"id": "approve-degraded-route",
|
|
455
|
+
"label": "Approve degraded route",
|
|
456
|
+
"kind": "secondary",
|
|
457
|
+
"payload": {},
|
|
458
|
+
"metadata": { "command_text": "/answer approve-degraded-route" }
|
|
459
|
+
}
|
|
460
|
+
],
|
|
461
|
+
"revision": { "id": "model-routing-escalation", "version": 1 },
|
|
462
|
+
"updated_at_ms": 1772069510000,
|
|
463
|
+
"metadata": {
|
|
464
|
+
"profile": {
|
|
465
|
+
"id": "model-routing-escalation",
|
|
466
|
+
"variant": "interactive"
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Teardown / handoff
|
|
474
|
+
|
|
475
|
+
```json
|
|
476
|
+
{"action":"remove","ui_id":"ui:model-routing:escalation"}
|
|
477
|
+
{"action":"remove","ui_id":"ui:model-routing"}
|
|
478
|
+
```
|
|
346
479
|
|
|
347
480
|
## Evaluation scenarios
|
|
348
481
|
|
|
@@ -1,47 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planning
|
|
3
|
-
description: "Builds and refines issue-DAG plans using
|
|
3
|
+
description: "Builds and refines issue-DAG plans using mu_ui status/prompt docs and approval loops. Use when the user asks for planning, decomposition, sequencing, or plan review."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# planning
|
|
7
7
|
|
|
8
|
-
Use this skill when the user asks for planning, decomposition, or a staged
|
|
8
|
+
Use this skill when the user asks for planning, decomposition, or a staged
|
|
9
|
+
execution roadmap.
|
|
9
10
|
|
|
10
11
|
## Contents
|
|
11
12
|
|
|
12
|
-
- [Planning
|
|
13
|
-
- [
|
|
13
|
+
- [Planning communication contract (mu_ui-first)](#planning-communication-contract-mu_ui-first)
|
|
14
|
+
- [mu_ui communication dependency](#mu_ui-communication-dependency)
|
|
14
15
|
- [Shared protocol dependency](#shared-protocol-dependency)
|
|
15
16
|
- [Core contract](#core-contract)
|
|
16
17
|
- [Suggested workflow](#suggested-workflow)
|
|
17
|
-
- [
|
|
18
|
+
- [Planning UI canonical docs](#planning-ui-canonical-docs)
|
|
19
|
+
- [Effective mu_ui usage heuristics](#effective-mu_ui-usage-heuristics)
|
|
18
20
|
- [Evaluation scenarios](#evaluation-scenarios)
|
|
19
21
|
- [Quality bar](#quality-bar)
|
|
20
22
|
|
|
21
|
-
## Planning
|
|
23
|
+
## Planning communication contract (mu_ui-first)
|
|
22
24
|
|
|
23
|
-
For this skill,
|
|
24
|
-
HUD usage is not optional for planning turns.
|
|
25
|
+
For this skill, `mu_ui` is the primary operator↔human communication surface.
|
|
25
26
|
|
|
26
|
-
- Keep
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
27
|
+
- Keep one status doc at `ui_id:"ui:planning"` during active planning turns.
|
|
28
|
+
- Keep status docs non-interactive (`actions: []`).
|
|
29
|
+
- Publish user-decision prompts in a separate interactive doc (for example
|
|
30
|
+
`ui_id:"ui:planning:approval"`) with `action.metadata.command_text`.
|
|
31
|
+
- Update planning UI docs before and after each major planning turn.
|
|
32
|
+
- Keep status-profile metadata current:
|
|
33
|
+
- `metadata.profile.id: "planning"`
|
|
34
|
+
- `metadata.profile.variant: "status"`
|
|
35
|
+
- `metadata.profile.snapshot.compact|multiline`
|
|
36
|
+
- Teardown or hand off planning-owned docs explicitly when planning completes.
|
|
31
37
|
|
|
32
|
-
Default per-turn
|
|
38
|
+
Default per-turn planning UI loop:
|
|
33
39
|
|
|
34
|
-
1.
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
1. Upsert `ui:planning` with current `phase`, `waiting_on_user`,
|
|
41
|
+
`next_action`, `blocker`, and `confidence`.
|
|
42
|
+
2. Keep checklist progress and root-issue linkage synchronized with the live DAG.
|
|
43
|
+
3. If user input is needed, upsert `ui:planning:approval` with concrete choices.
|
|
44
|
+
4. Use `mu_ui` snapshot/status output in user-facing planning updates.
|
|
37
45
|
|
|
46
|
+
## mu_ui communication dependency
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
Before publishing planning visibility or user prompts, use **`mu_ui`** and the
|
|
49
|
+
`/mu ui` command surface.
|
|
40
50
|
|
|
41
|
-
|
|
51
|
+
- Tool: `mu_ui`
|
|
52
|
+
- Actions: `status`, `snapshot`, `set`, `update`, `replace`, `remove`, `clear`
|
|
53
|
+
- Operator commands:
|
|
54
|
+
- `/mu ui status`
|
|
55
|
+
- `/mu ui snapshot compact`
|
|
56
|
+
- `/mu ui snapshot multiline`
|
|
57
|
+
- `/mu ui interact [ui_id [action_id]]`
|
|
42
58
|
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
If behavior is unclear, inspect implementation/tests before guessing:
|
|
60
|
+
|
|
61
|
+
- `packages/agent/src/extensions/ui.ts`
|
|
62
|
+
- `packages/agent/test/ui_extension.test.ts`
|
|
63
|
+
- `docs/mu-ui.md`
|
|
45
64
|
|
|
46
65
|
## Shared protocol dependency
|
|
47
66
|
|
|
@@ -50,16 +69,17 @@ shared protocol in **`protocol`**.
|
|
|
50
69
|
|
|
51
70
|
Before creating or reshaping DAG nodes, load that skill and use its canonical:
|
|
52
71
|
|
|
53
|
-
- protocol identity/tag (`hierarchical-work.protocol/v1`,
|
|
72
|
+
- protocol identity/tag (`hierarchical-work.protocol/v1`,
|
|
73
|
+
`proto:hierarchical-work-v1`)
|
|
54
74
|
- node kinds and context tags
|
|
55
75
|
- invariants for executable vs non-executable nodes
|
|
56
76
|
- planning handoff contract
|
|
57
77
|
|
|
58
78
|
Do not invent alternate protocol names or tag schemas.
|
|
59
79
|
|
|
60
|
-
If the user asks for explicit loop/termination behavior (for example
|
|
61
|
-
retry rounds), load **`control-flow`** and encode policy via
|
|
62
|
-
without changing protocol semantics.
|
|
80
|
+
If the user asks for explicit loop/termination behavior (for example
|
|
81
|
+
review-gated retry rounds), load **`control-flow`** and encode policy via
|
|
82
|
+
`flow:*` overlays without changing protocol semantics.
|
|
63
83
|
|
|
64
84
|
If the user asks for per-issue model/provider/thinking recommendations based on
|
|
65
85
|
live harness capabilities, load **`model-routing`** and encode policy via
|
|
@@ -73,21 +93,26 @@ changing protocol semantics.
|
|
|
73
93
|
- Avoid speculative plans when evidence is cheap to gather.
|
|
74
94
|
|
|
75
95
|
2. **Materialize the plan in mu issues using the shared protocol**
|
|
76
|
-
- Create root and child issues that comply with
|
|
96
|
+
- Create root and child issues that comply with
|
|
97
|
+
`hierarchical-work.protocol/v1`.
|
|
77
98
|
- Encode dependencies so the DAG reflects execution order and synth fan-in.
|
|
78
99
|
- Add clear titles, scope, acceptance criteria, and protocol tags.
|
|
79
|
-
- When model specialization is required, attach explicit `route:*`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
- Keep `phase`, `waiting_on_user`, `next_action`, `blocker`, and
|
|
85
|
-
|
|
100
|
+
- When model specialization is required, attach explicit `route:*`
|
|
101
|
+
intent tags/constraints to executable nodes.
|
|
102
|
+
|
|
103
|
+
3. **Drive communication through mu_ui**
|
|
104
|
+
- Keep `ui:planning` current as the canonical short planning status.
|
|
105
|
+
- Keep `phase`, `waiting_on_user`, `next_action`, `blocker`, and
|
|
106
|
+
`confidence` current in doc metadata/components.
|
|
107
|
+
- Keep status docs non-interactive; isolate user decisions in separate
|
|
108
|
+
interactive docs.
|
|
109
|
+
- Ensure UI doc state and natural-language responses never contradict each
|
|
110
|
+
other.
|
|
86
111
|
|
|
87
112
|
4. **Present the plan to the user**
|
|
88
113
|
- Summarize goals, sequencing, risks, and tradeoffs.
|
|
89
114
|
- Include issue IDs so the user can reference exact nodes.
|
|
90
|
-
- Include
|
|
115
|
+
- Include one compact planning UI snapshot line.
|
|
91
116
|
|
|
92
117
|
5. **Iterate until user approval**
|
|
93
118
|
- Treat user feedback as first-class constraints.
|
|
@@ -95,11 +120,13 @@ changing protocol semantics.
|
|
|
95
120
|
- Do not begin broad execution until the user signals satisfaction.
|
|
96
121
|
|
|
97
122
|
6. **After user approval, ask user about next steps**
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
123
|
+
- Remove resolved interactive planning docs (for example
|
|
124
|
+
`ui:planning:approval`).
|
|
125
|
+
- If handing off to `execution`, remove or replace `ui:planning` so
|
|
126
|
+
ownership is unambiguous.
|
|
127
|
+
- If no immediate follow-on skill starts, remove planning docs explicitly.
|
|
128
|
+
- Read the `execution` skill and offer to supervise execution to realize the
|
|
129
|
+
plan.
|
|
103
130
|
|
|
104
131
|
## Suggested workflow
|
|
105
132
|
|
|
@@ -112,42 +139,19 @@ mu forum read user:context --limit 50 --pretty
|
|
|
112
139
|
mu memory search --query "<topic>" --limit 30
|
|
113
140
|
```
|
|
114
141
|
|
|
115
|
-
|
|
142
|
+
Inspect active planning UI state:
|
|
116
143
|
|
|
117
144
|
```text
|
|
118
|
-
/mu
|
|
119
|
-
/mu
|
|
120
|
-
/mu hud snapshot
|
|
145
|
+
/mu ui status
|
|
146
|
+
/mu ui snapshot compact
|
|
121
147
|
```
|
|
122
148
|
|
|
123
|
-
Tool
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- Suggested planning doc structure:
|
|
130
|
-
- `title`: `Planning HUD`
|
|
131
|
-
- chips: `phase:<...>`, `steps:<done>/<total>`, `waiting:<yes|no>`, `conf:<low|medium|high>`
|
|
132
|
-
- sections:
|
|
133
|
-
- `kv` status block (`phase`, `root`, `waiting_on_user`, `confidence`, `next_action`, `blocker`)
|
|
134
|
-
- `checklist` block for plan milestones
|
|
135
|
-
- actions: include useful follow-ups (for example, `snapshot`)
|
|
136
|
-
- metadata: include `style_preset:"planning"` for consistent renderer emphasis without repeating style hints
|
|
137
|
-
|
|
138
|
-
Example tool calls:
|
|
139
|
-
- Turn HUD on:
|
|
140
|
-
- `{"action":"on"}`
|
|
141
|
-
- Set/replace planning doc after investigation pass:
|
|
142
|
-
- `{"action":"set","doc":{"v":1,"hud_id":"planning","title":"Planning HUD","scope":"mu-root-123","chips":[{"key":"phase","label":"phase:investigating","tone":"dim"},{"key":"steps","label":"steps:1/4","tone":"accent"},{"key":"waiting","label":"waiting:no","tone":"dim"},{"key":"confidence","label":"conf:medium","tone":"accent"}],"sections":[{"kind":"kv","title":"Status","items":[{"key":"phase","label":"phase","value":"investigating"},{"key":"root","label":"root","value":"mu-root-123"},{"key":"waiting","label":"waiting_on_user","value":"no"},{"key":"confidence","label":"confidence","value":"medium"},{"key":"next","label":"next_action","value":"Draft root DAG"},{"key":"blocker","label":"blocker","value":"(none)"}]},{"kind":"checklist","title":"Checklist","items":[{"id":"1","label":"Investigate relevant code/docs/state","done":true},{"id":"2","label":"Create root + child issue DAG","done":false},{"id":"3","label":"Present plan + tradeoffs","done":false},{"id":"4","label":"Refine until approved","done":false}]}],"actions":[{"id":"snapshot","label":"Snapshot","command_text":"/mu hud snapshot","kind":"secondary"}],"snapshot_compact":"HUD(plan) · phase=investigating · steps=1/4 · waiting=no · conf=medium","updated_at_ms":1771853115000,"metadata":{"style_preset":"planning","phase":"investigating","waiting_on_user":false,"confidence":"medium"}}}`
|
|
143
|
-
- Human-facing status line:
|
|
144
|
-
- `{"action":"snapshot","snapshot_format":"compact"}`
|
|
145
|
-
|
|
146
|
-
If HUD behavior is unclear, inspect implementation/tests before guessing:
|
|
147
|
-
- `packages/agent/src/extensions/hud.ts`
|
|
148
|
-
- `packages/agent/test/hud_tool.test.ts`
|
|
149
|
-
|
|
150
|
-
Also inspect repo files directly (read/bash) for implementation constraints.
|
|
149
|
+
Tool checks (when tools are available):
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{"action":"status"}
|
|
153
|
+
{"action":"snapshot","snapshot_format":"compact"}
|
|
154
|
+
```
|
|
151
155
|
|
|
152
156
|
### B) Draft DAG in mu-issue
|
|
153
157
|
|
|
@@ -194,7 +198,7 @@ mu issues validate "$root_id"
|
|
|
194
198
|
- Proposed issue DAG (IDs + titles + ordering)
|
|
195
199
|
- Risks and mitigations
|
|
196
200
|
- Open questions for user approval
|
|
197
|
-
-
|
|
201
|
+
- Planning UI snapshot (compact line)
|
|
198
202
|
|
|
199
203
|
### D) Revision loop
|
|
200
204
|
|
|
@@ -202,43 +206,188 @@ mu issues validate "$root_id"
|
|
|
202
206
|
- Re-run `mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty`.
|
|
203
207
|
- Validate protocol-root status via `mu issues validate <root-id>`.
|
|
204
208
|
- Present a concise diff of what changed and why.
|
|
205
|
-
-
|
|
209
|
+
- Keep planning UI docs aligned with latest state each turn.
|
|
210
|
+
|
|
211
|
+
Required UI updates during the loop:
|
|
212
|
+
|
|
213
|
+
- Re-emit `ui:planning` with current `phase`, checklist progress,
|
|
214
|
+
`waiting_on_user`, `next_action`, and `blocker` after each meaningful
|
|
215
|
+
planning step.
|
|
216
|
+
- Use `{"action":"snapshot","snapshot_format":"compact"}` for concise
|
|
217
|
+
user-facing snapshot lines.
|
|
218
|
+
- Keep `revision.version` and `updated_at_ms` monotonic across updates.
|
|
219
|
+
- On plan completion/handoff, remove planning-owned docs explicitly with
|
|
220
|
+
`mu_ui remove`.
|
|
221
|
+
|
|
222
|
+
## Planning UI canonical docs
|
|
223
|
+
|
|
224
|
+
Use these as copy/paste templates for planning communication.
|
|
225
|
+
|
|
226
|
+
### Canonical status doc (`ui:planning`)
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"action": "set",
|
|
231
|
+
"doc": {
|
|
232
|
+
"v": 1,
|
|
233
|
+
"ui_id": "ui:planning",
|
|
234
|
+
"title": "Planning status",
|
|
235
|
+
"summary": "phase=investigating · steps=1/4 · waiting=no · conf=medium",
|
|
236
|
+
"components": [
|
|
237
|
+
{
|
|
238
|
+
"kind": "key_value",
|
|
239
|
+
"id": "status",
|
|
240
|
+
"title": "Status",
|
|
241
|
+
"rows": [
|
|
242
|
+
{ "key": "phase", "value": "investigating" },
|
|
243
|
+
{ "key": "root", "value": "mu-root-123" },
|
|
244
|
+
{ "key": "waiting", "value": "no" },
|
|
245
|
+
{ "key": "confidence", "value": "medium" },
|
|
246
|
+
{ "key": "next", "value": "Draft root DAG" },
|
|
247
|
+
{ "key": "blocker", "value": "(none)" }
|
|
248
|
+
],
|
|
249
|
+
"metadata": {}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"kind": "list",
|
|
253
|
+
"id": "checklist",
|
|
254
|
+
"title": "Checklist",
|
|
255
|
+
"items": [
|
|
256
|
+
{ "id": "c1", "label": "Investigate relevant code/docs/state", "detail": "done" },
|
|
257
|
+
{ "id": "c2", "label": "Create root + child issue DAG", "detail": "pending" },
|
|
258
|
+
{ "id": "c3", "label": "Present plan + tradeoffs", "detail": "pending" },
|
|
259
|
+
{ "id": "c4", "label": "Refine until approved", "detail": "pending" }
|
|
260
|
+
],
|
|
261
|
+
"metadata": {}
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"actions": [],
|
|
265
|
+
"revision": { "id": "planning-status", "version": 3 },
|
|
266
|
+
"updated_at_ms": 1772069100000,
|
|
267
|
+
"metadata": {
|
|
268
|
+
"phase": "investigating",
|
|
269
|
+
"waiting_on_user": false,
|
|
270
|
+
"confidence": "medium",
|
|
271
|
+
"profile": {
|
|
272
|
+
"id": "planning",
|
|
273
|
+
"variant": "status",
|
|
274
|
+
"snapshot": {
|
|
275
|
+
"compact": "phase=investigating · steps=1/4 · waiting=no · conf=medium",
|
|
276
|
+
"multiline": "phase: investigating\nsteps: 1/4\nwaiting_on_user: no\nconfidence: medium\nnext_action: Draft root DAG"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
206
283
|
|
|
207
|
-
|
|
284
|
+
### Canonical approval prompt (`ui:planning:approval`)
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"action": "set",
|
|
289
|
+
"doc": {
|
|
290
|
+
"v": 1,
|
|
291
|
+
"ui_id": "ui:planning:approval",
|
|
292
|
+
"title": "Plan approval",
|
|
293
|
+
"summary": "Need user decision before execution handoff.",
|
|
294
|
+
"components": [
|
|
295
|
+
{
|
|
296
|
+
"kind": "text",
|
|
297
|
+
"id": "question",
|
|
298
|
+
"text": "Approve this plan for execution, or request one targeted revision?",
|
|
299
|
+
"metadata": {}
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"kind": "list",
|
|
303
|
+
"id": "options",
|
|
304
|
+
"title": "Choices",
|
|
305
|
+
"items": [
|
|
306
|
+
{ "id": "opt-approve", "label": "Approve and move to execution" },
|
|
307
|
+
{ "id": "opt-revise", "label": "Request one revision" }
|
|
308
|
+
],
|
|
309
|
+
"metadata": {}
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"actions": [
|
|
313
|
+
{
|
|
314
|
+
"id": "approve-plan",
|
|
315
|
+
"label": "Approve plan",
|
|
316
|
+
"kind": "primary",
|
|
317
|
+
"payload": {},
|
|
318
|
+
"metadata": { "command_text": "/answer approve-plan" }
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"id": "request-revision",
|
|
322
|
+
"label": "Request revision",
|
|
323
|
+
"kind": "secondary",
|
|
324
|
+
"payload": { "reason": "<reason>" },
|
|
325
|
+
"metadata": { "command_text": "/answer request-revision {{reason}}" }
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"revision": { "id": "planning-approval", "version": 1 },
|
|
329
|
+
"updated_at_ms": 1772069110000,
|
|
330
|
+
"metadata": {
|
|
331
|
+
"profile": {
|
|
332
|
+
"id": "planning-approval",
|
|
333
|
+
"variant": "interactive"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Teardown / handoff semantics
|
|
208
341
|
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
|
|
342
|
+
- Remove resolved decision prompts immediately.
|
|
343
|
+
- Remove or replace `ui:planning` when planning ends or execution takes over.
|
|
344
|
+
- Prefer `remove` over `clear` to avoid deleting docs owned by other skills.
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{"action":"remove","ui_id":"ui:planning:approval"}
|
|
348
|
+
{"action":"remove","ui_id":"ui:planning"}
|
|
349
|
+
```
|
|
213
350
|
|
|
214
|
-
## Effective
|
|
351
|
+
## Effective mu_ui usage heuristics
|
|
215
352
|
|
|
216
|
-
- Keep one canonical
|
|
217
|
-
|
|
218
|
-
-
|
|
219
|
-
|
|
220
|
-
-
|
|
353
|
+
- Keep one canonical status doc (`ui:planning`) and refresh it whenever planning
|
|
354
|
+
state changes.
|
|
355
|
+
- Keep `revision.version` and `updated_at_ms` monotonic so replay/reconnect
|
|
356
|
+
keeps the newest state deterministically.
|
|
357
|
+
- Keep status docs non-interactive; place user decisions in separate interactive
|
|
358
|
+
docs.
|
|
359
|
+
- Keep `next_action` to one concrete action, not a paragraph.
|
|
360
|
+
- Keep approval prompts decision-shaped with explicit command-text actions.
|
|
221
361
|
|
|
222
362
|
## Evaluation scenarios
|
|
223
363
|
|
|
224
364
|
1. **Initial decomposition request**
|
|
225
365
|
- Prompt: user asks for a staged roadmap.
|
|
226
|
-
- Expected: investigation pass runs first, root + child issues are created
|
|
366
|
+
- Expected: investigation pass runs first, root + child issues are created
|
|
367
|
+
with `proto:hierarchical-work-v1`, and `ui:planning` reflects
|
|
368
|
+
`phase=drafting`, `waiting_on_user=false`.
|
|
227
369
|
|
|
228
370
|
2. **Feedback-driven replan**
|
|
229
371
|
- Prompt: user requests scope change after first DAG draft.
|
|
230
|
-
- Expected: dependency/issue updates are applied, concise change diff is
|
|
372
|
+
- Expected: dependency/issue updates are applied, concise change diff is
|
|
373
|
+
presented, and planning UI transitions through `reviewing` and
|
|
374
|
+
`waiting_on_user` states.
|
|
231
375
|
|
|
232
376
|
3. **Blocked-by-missing-input planning turn**
|
|
233
377
|
- Prompt: required architecture constraint is unknown.
|
|
234
|
-
- Expected: plan captures explicit assumption gap,
|
|
378
|
+
- Expected: plan captures explicit assumption gap, `ui:planning` shows
|
|
379
|
+
blocked/waiting status, and an interactive planning prompt asks one concrete
|
|
380
|
+
unblock decision.
|
|
235
381
|
|
|
236
382
|
## Quality bar
|
|
237
383
|
|
|
238
384
|
- Every issue should be actionable and testable.
|
|
239
|
-
- DAG nodes must satisfy `hierarchical-work.protocol/v1` before execution
|
|
385
|
+
- DAG nodes must satisfy `hierarchical-work.protocol/v1` before execution
|
|
386
|
+
handoff.
|
|
240
387
|
- Keep tasks small enough to complete in one focused pass.
|
|
241
388
|
- Explicitly call out uncertain assumptions for user confirmation.
|
|
242
389
|
- Prefer reversible plans and incremental checkpoints.
|
|
243
|
-
- If `model-routing` is in scope, route intent/constraints are explicit and
|
|
244
|
-
-
|
|
390
|
+
- If `model-routing` is in scope, route intent/constraints are explicit and
|
|
391
|
+
non-conflicting.
|
|
392
|
+
- Planning UI state must be fresh, accurate, and aligned with user-visible
|
|
393
|
+
status updates.
|
|
@@ -36,7 +36,7 @@ Use this skill when asked to write, edit, or review technical prose. This includ
|
|
|
36
36
|
- Inverted pyramid: conclusion, supporting details, background.
|
|
37
37
|
|
|
38
38
|
4. **Actionability**
|
|
39
|
-
- Imperative for procedures: "Run the
|
|
39
|
+
- Imperative for procedures: "Run the command" not "The command should be run."
|
|
40
40
|
- Explicit consequences: state what happens if the user does X.
|
|
41
41
|
- Anticipate failure modes in troubleshooting sections.
|
|
42
42
|
|
|
@@ -77,7 +77,7 @@ Use this skill when asked to write, edit, or review technical prose. This includ
|
|
|
77
77
|
1. **What changed** (imperative, present tense)
|
|
78
78
|
2. **Why it changed** (context, motivation)
|
|
79
79
|
3. **How to verify** (testing steps, expected outcomes)
|
|
80
|
-
4. **Breaking changes** (if any, with
|
|
80
|
+
4. **Breaking changes** (if any, with explicit adoption guidance)
|
|
81
81
|
|
|
82
82
|
Keep under 80 characters per line in the summary. Body wraps at 72 characters.
|
|
83
83
|
|