@femtomc/mu-agent 26.2.98 → 26.2.100
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 +20 -0
- package/dist/operator.d.ts +3 -1
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +141 -6
- package/dist/session_factory.d.ts +1 -0
- package/dist/session_factory.d.ts.map +1 -1
- package/package.json +2 -2
- package/prompts/skills/crons/SKILL.md +204 -0
- package/prompts/skills/heartbeats/SKILL.md +172 -0
- package/prompts/skills/hierarchical-work-protocol/SKILL.md +233 -0
- package/prompts/skills/memory/SKILL.md +154 -0
- package/prompts/skills/mu/SKILL.md +144 -0
- package/prompts/skills/planning/SKILL.md +75 -14
- package/prompts/skills/setup-discord/SKILL.md +141 -0
- package/prompts/skills/setup-neovim/SKILL.md +141 -0
- package/prompts/skills/setup-slack/SKILL.md +159 -0
- package/prompts/skills/setup-telegram/SKILL.md +171 -0
- package/prompts/skills/subagents/SKILL.md +92 -165
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: heartbeats
|
|
3
|
+
description: "Runs heartbeat-program lifecycle workflows for durable operator wake loops, bounded tick prompts, and diagnostics. Use when scheduling, tuning, or repairing recurring automation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# heartbeats
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks to schedule, inspect, tune, or debug `mu heartbeats` automation.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Core contract](#core-contract)
|
|
13
|
+
- [Preflight checks](#preflight-checks)
|
|
14
|
+
- [Heartbeat lifecycle workflow](#heartbeat-lifecycle-workflow)
|
|
15
|
+
- [Prompt design for bounded ticks](#prompt-design-for-bounded-ticks)
|
|
16
|
+
- [Diagnostics and recovery](#diagnostics-and-recovery)
|
|
17
|
+
- [Evaluation scenarios](#evaluation-scenarios)
|
|
18
|
+
|
|
19
|
+
## Core contract
|
|
20
|
+
|
|
21
|
+
1. **One bounded pass per wake**
|
|
22
|
+
- Heartbeats should run one small control-loop pass, verify, and exit.
|
|
23
|
+
- Avoid unbounded prompts that try to complete an entire project in one wake.
|
|
24
|
+
|
|
25
|
+
2. **CLI-first lifecycle control**
|
|
26
|
+
- Create/update/trigger/enable/disable via `mu heartbeats ...` commands.
|
|
27
|
+
- Do not hand-edit `heartbeats.jsonl`.
|
|
28
|
+
|
|
29
|
+
3. **Read -> mutate -> verify**
|
|
30
|
+
- Inspect current heartbeat state first.
|
|
31
|
+
- After mutation, re-read with `list/get` and run a trigger smoke test.
|
|
32
|
+
|
|
33
|
+
4. **Reason-coded automation**
|
|
34
|
+
- Use clear `--reason` values so wake and scheduler intent is auditable.
|
|
35
|
+
|
|
36
|
+
## Preflight checks
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
mu status --pretty
|
|
40
|
+
mu control status --pretty
|
|
41
|
+
mu control identities --all --pretty
|
|
42
|
+
mu heartbeats list --limit 20 --pretty
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If user expects channel delivery (for example Telegram/Slack), verify operator identities
|
|
46
|
+
are linked for the target channel before treating heartbeat execution as broken.
|
|
47
|
+
|
|
48
|
+
## Heartbeat lifecycle workflow
|
|
49
|
+
|
|
50
|
+
### 1) Inspect existing programs
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mu heartbeats list --limit 20 --pretty
|
|
54
|
+
mu heartbeats get <program-id> --pretty
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Use `--json --pretty` when you need full records.
|
|
58
|
+
|
|
59
|
+
### 2) Create a periodic heartbeat
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mu heartbeats create \
|
|
63
|
+
--title "<descriptive title>" \
|
|
64
|
+
--prompt "<bounded control-loop instruction>" \
|
|
65
|
+
--every-ms 15000 \
|
|
66
|
+
--reason <reason_code>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Notes:
|
|
70
|
+
- Omit `--every-ms` to use the default cadence (15000ms).
|
|
71
|
+
- `--every-ms 0` creates event-driven mode (no periodic timer).
|
|
72
|
+
|
|
73
|
+
### 3) Update cadence/prompt/enabled state
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mu heartbeats update <program-id> --every-ms 300000
|
|
77
|
+
mu heartbeats update <program-id> --prompt "<revised bounded instruction>"
|
|
78
|
+
mu heartbeats enable <program-id>
|
|
79
|
+
mu heartbeats disable <program-id>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 4) Trigger smoke pass
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
mu heartbeats trigger <program-id> --reason smoke_test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Then verify state and recent effects:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
mu heartbeats get <program-id> --pretty
|
|
92
|
+
mu store tail events --limit 30 --pretty
|
|
93
|
+
mu store tail cp_operator_turns --limit 30 --pretty
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 5) Remove obsolete programs
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
mu heartbeats delete <program-id>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Prompt design for bounded ticks
|
|
103
|
+
|
|
104
|
+
Use prompts that explicitly constrain each wake to one bounded pass.
|
|
105
|
+
|
|
106
|
+
Good pattern:
|
|
107
|
+
- inspect queue/state
|
|
108
|
+
- do exactly one action
|
|
109
|
+
- verify
|
|
110
|
+
- summarize progress
|
|
111
|
+
- exit
|
|
112
|
+
|
|
113
|
+
Example bounded prompt:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
Review ready issues under root <root-id>. Perform exactly one bounded step:
|
|
117
|
+
claim/work one ready issue (or report blocked), verify state, post concise progress,
|
|
118
|
+
then exit.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
For hierarchical DAG execution, pair this skill with:
|
|
122
|
+
- `planning`
|
|
123
|
+
- `hierarchical-work-protocol`
|
|
124
|
+
- `subagents`
|
|
125
|
+
|
|
126
|
+
For wall-clock scheduling semantics (`at`, `every`, `cron`), use `crons`.
|
|
127
|
+
|
|
128
|
+
## Diagnostics and recovery
|
|
129
|
+
|
|
130
|
+
If heartbeat automation appears stalled:
|
|
131
|
+
|
|
132
|
+
1. Confirm program exists and is enabled:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
mu heartbeats list --enabled true --limit 50 --pretty
|
|
136
|
+
mu heartbeats get <program-id> --pretty
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
2. Force a manual trigger to isolate scheduler cadence issues:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mu heartbeats trigger <program-id> --reason manual_recovery_test
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
3. Inspect runtime artifacts:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
mu store tail heartbeats --limit 20 --pretty
|
|
149
|
+
mu store tail events --limit 50 --pretty
|
|
150
|
+
mu store tail cp_operator_turns --limit 50 --pretty
|
|
151
|
+
mu store tail cp_outbox --limit 30 --pretty
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
4. Apply smallest recovery action:
|
|
155
|
+
- tighten or loosen `--every-ms`
|
|
156
|
+
- simplify prompt scope
|
|
157
|
+
- disable noisy/obsolete programs
|
|
158
|
+
- relink channel identity when delivery is missing
|
|
159
|
+
|
|
160
|
+
## Evaluation scenarios
|
|
161
|
+
|
|
162
|
+
1. **Periodic progress heartbeat**
|
|
163
|
+
- Setup: heartbeat created with bounded control-loop prompt and `--every-ms 15000`.
|
|
164
|
+
- Expected: each wake performs one bounded pass and exits; no unbounded run behavior.
|
|
165
|
+
|
|
166
|
+
2. **Event-driven heartbeat mode**
|
|
167
|
+
- Setup: heartbeat created/updated with `--every-ms 0`.
|
|
168
|
+
- Expected: no periodic timer firing; manual/explicit triggers still execute correctly.
|
|
169
|
+
|
|
170
|
+
3. **Stall recovery via trigger + audit**
|
|
171
|
+
- Setup: user reports no visible progress from heartbeat.
|
|
172
|
+
- Expected: manual trigger works, events/operator-turn logs reveal root cause, and one minimal config change resolves progression.
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hierarchical-work-protocol
|
|
3
|
+
description: "Defines the shared hierarchical planning/work issue-DAG protocol used by planning and subagents. Use when creating, validating, or executing protocol-driven DAG work."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# hierarchical-work-protocol
|
|
7
|
+
|
|
8
|
+
Use this skill when work should flow through one shared protocol from planning to execution.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Protocol identity](#protocol-identity)
|
|
13
|
+
- [Canonical tags and node roles](#canonical-tags-and-node-roles)
|
|
14
|
+
- [Protocol primitives](#protocol-primitives)
|
|
15
|
+
- [Required invariants](#required-invariants)
|
|
16
|
+
- [Planning handoff contract](#planning-handoff-contract)
|
|
17
|
+
- [Execution loop contract](#execution-loop-contract)
|
|
18
|
+
- [Minimal bootstrap template](#minimal-bootstrap-template)
|
|
19
|
+
- [Evaluation scenarios](#evaluation-scenarios)
|
|
20
|
+
|
|
21
|
+
## Protocol identity
|
|
22
|
+
|
|
23
|
+
- Protocol ID: `hierarchical-work.protocol/v1`
|
|
24
|
+
- Required issue tag on all protocol nodes: `proto:hierarchical-work-v1`
|
|
25
|
+
|
|
26
|
+
This system does **not** use backward-compatibility aliases for older protocol names.
|
|
27
|
+
Use only the protocol ID and tag above.
|
|
28
|
+
|
|
29
|
+
## Canonical tags and node roles
|
|
30
|
+
|
|
31
|
+
Use this controlled tag vocabulary:
|
|
32
|
+
|
|
33
|
+
- Protocol scope:
|
|
34
|
+
- `proto:hierarchical-work-v1`
|
|
35
|
+
- Node kind:
|
|
36
|
+
- `kind:root` (root container)
|
|
37
|
+
- `kind:goal` (top-level executable objective under root)
|
|
38
|
+
- `kind:spawn` (independent executable child)
|
|
39
|
+
- `kind:fork` (context-inheriting executable child)
|
|
40
|
+
- `kind:synth` (synthesis executable child)
|
|
41
|
+
- `kind:ask` (human-input node)
|
|
42
|
+
- Context mode:
|
|
43
|
+
- `ctx:clean` (independent context)
|
|
44
|
+
- `ctx:inherit` (depends on upstream outputs)
|
|
45
|
+
- `ctx:human` (user input required)
|
|
46
|
+
- Actor marker:
|
|
47
|
+
- `actor:user` for human question nodes
|
|
48
|
+
|
|
49
|
+
Node role rules:
|
|
50
|
+
|
|
51
|
+
1. Root container node
|
|
52
|
+
- Must include: `node:root`, `kind:root`, `proto:hierarchical-work-v1`
|
|
53
|
+
- Must be non-executable (`node:agent` removed)
|
|
54
|
+
|
|
55
|
+
2. Executable work nodes (`kind:goal|spawn|fork|synth`)
|
|
56
|
+
- Must include: `proto:hierarchical-work-v1`
|
|
57
|
+
- Must include exactly one `kind:*` from the executable set
|
|
58
|
+
- Must include one `ctx:*` tag (`ctx:clean` or `ctx:inherit`)
|
|
59
|
+
- Must remain executable (`node:agent` present)
|
|
60
|
+
|
|
61
|
+
3. Human input nodes (`kind:ask`)
|
|
62
|
+
- Must include: `proto:hierarchical-work-v1`, `kind:ask`, `ctx:human`, `actor:user`
|
|
63
|
+
- Must be non-executable (`node:agent` removed)
|
|
64
|
+
|
|
65
|
+
## Protocol primitives
|
|
66
|
+
|
|
67
|
+
### `read_tree`
|
|
68
|
+
|
|
69
|
+
Read current node + local neighborhood before every mutation:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mu issues get <issue-id> --pretty
|
|
73
|
+
mu issues children <issue-id> --pretty
|
|
74
|
+
mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
|
|
75
|
+
mu forum read issue:<issue-id> --limit 20 --pretty
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `claim`
|
|
79
|
+
|
|
80
|
+
Claim executable work before execution:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
mu issues claim <issue-id>
|
|
84
|
+
mu forum post issue:<issue-id> -m "START: <plan for this pass>" --author operator
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `spawn`
|
|
88
|
+
|
|
89
|
+
Create independent executable child work:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
child_json="$(mu issues create "<title>" \
|
|
93
|
+
--parent <issue-id> \
|
|
94
|
+
--body "<prompt + acceptance criteria>" \
|
|
95
|
+
--tag proto:hierarchical-work-v1 \
|
|
96
|
+
--tag kind:spawn \
|
|
97
|
+
--tag ctx:clean \
|
|
98
|
+
--priority 2 \
|
|
99
|
+
--json)"
|
|
100
|
+
child_id="$(echo "$child_json" | jq -r '.id')"
|
|
101
|
+
mu forum post issue:"$child_id" -m "<task packet>" --author operator
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### `fork`
|
|
105
|
+
|
|
106
|
+
Create context-inheriting executable child work:
|
|
107
|
+
|
|
108
|
+
1. Summarize dependency outputs from `mu forum read issue:<dep-id>`.
|
|
109
|
+
2. Create child with tags `kind:fork` + `ctx:inherit` + `proto:hierarchical-work-v1`.
|
|
110
|
+
|
|
111
|
+
### `ask`
|
|
112
|
+
|
|
113
|
+
Create explicit human-input nodes:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
ask_json="$(mu issues create "Question: <question>" \
|
|
117
|
+
--parent <issue-id> \
|
|
118
|
+
--tag proto:hierarchical-work-v1 \
|
|
119
|
+
--priority 1 \
|
|
120
|
+
--json)"
|
|
121
|
+
ask_id="$(echo "$ask_json" | jq -r '.id')"
|
|
122
|
+
mu issues update "$ask_id" \
|
|
123
|
+
--remove-tag node:agent \
|
|
124
|
+
--add-tag kind:ask \
|
|
125
|
+
--add-tag ctx:human \
|
|
126
|
+
--add-tag actor:user
|
|
127
|
+
mu forum post issue:"$ask_id" \
|
|
128
|
+
-m "QUESTION: <question>\nOPTIONS: <list or free-form>\nReply in this topic, then close this issue." \
|
|
129
|
+
--author operator
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `complete`
|
|
133
|
+
|
|
134
|
+
Close executable work with explicit result packets:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
mu forum post issue:<issue-id> -m "RESULT:\n<result>" --author operator
|
|
138
|
+
mu issues close <issue-id> --outcome success
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Use explicit non-success outcomes when required (`failure`, `needs_work`, `skipped`).
|
|
142
|
+
|
|
143
|
+
### `expand`
|
|
144
|
+
|
|
145
|
+
Encode decomposition as first-class graph transitions:
|
|
146
|
+
|
|
147
|
+
1. Create child work nodes via `spawn` and/or `fork`.
|
|
148
|
+
2. Create one synthesis child tagged `kind:synth`, `ctx:inherit`, `proto:hierarchical-work-v1`.
|
|
149
|
+
3. Block synthesis on all created children (`mu issues dep <child> blocks <synth>`).
|
|
150
|
+
4. Close expanded node with `mu issues close <issue-id> --outcome expanded`.
|
|
151
|
+
|
|
152
|
+
### `serial`
|
|
153
|
+
|
|
154
|
+
Encode ordered execution explicitly with dependency edges:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
mu issues dep <step-a> blocks <step-b>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Required invariants
|
|
161
|
+
|
|
162
|
+
- Read-before-act-verify for every mutation.
|
|
163
|
+
- Claim-before-work on executable nodes.
|
|
164
|
+
- Scoped authority: mutate only current issue and descendants.
|
|
165
|
+
- Non-executable containers/questions must not retain `node:agent`.
|
|
166
|
+
- Forum updates are append-only and resumable (`START`/`RESULT` packets).
|
|
167
|
+
- Every executable issue closes with explicit outcome.
|
|
168
|
+
- `mu issues validate <root-id>` must pass before declaring completion.
|
|
169
|
+
|
|
170
|
+
## Planning handoff contract
|
|
171
|
+
|
|
172
|
+
Before handoff from planning to subagent orchestration:
|
|
173
|
+
|
|
174
|
+
1. Root exists and is tagged `node:root`, `kind:root`, `proto:hierarchical-work-v1`.
|
|
175
|
+
2. Every in-scope node carries `proto:hierarchical-work-v1`.
|
|
176
|
+
3. Every node has exactly one `kind:*` tag.
|
|
177
|
+
4. Non-executable nodes (`kind:root`, `kind:ask`) have `node:agent` removed.
|
|
178
|
+
5. Executable nodes (`kind:goal|spawn|fork|synth`) include `ctx:*` and acceptance criteria.
|
|
179
|
+
6. Dependency edges encode required ordering and synth fan-in.
|
|
180
|
+
7. Ready set sanity check succeeds:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty
|
|
184
|
+
mu issues validate <root-id>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Execution loop contract
|
|
188
|
+
|
|
189
|
+
Worker/orchestrator passes always choose one primitive at a time:
|
|
190
|
+
|
|
191
|
+
1. `read_tree`
|
|
192
|
+
2. Choose one primitive (`ask` | `expand` | `complete` | orchestration primitive)
|
|
193
|
+
3. Apply
|
|
194
|
+
4. Verify (`get`, `children`, `ready`, `validate`)
|
|
195
|
+
5. Log concise progress to forum
|
|
196
|
+
6. Exit bounded pass
|
|
197
|
+
|
|
198
|
+
## Minimal bootstrap template
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
root_json="$(mu issues create "Root: <goal>" \
|
|
202
|
+
--tag node:root \
|
|
203
|
+
--tag kind:root \
|
|
204
|
+
--tag proto:hierarchical-work-v1 \
|
|
205
|
+
--json)"
|
|
206
|
+
root_id="$(echo "$root_json" | jq -r '.id')"
|
|
207
|
+
mu issues update "$root_id" --remove-tag node:agent
|
|
208
|
+
|
|
209
|
+
goal_json="$(mu issues create "Goal execution" \
|
|
210
|
+
--parent "$root_id" \
|
|
211
|
+
--tag kind:goal \
|
|
212
|
+
--tag ctx:clean \
|
|
213
|
+
--tag proto:hierarchical-work-v1 \
|
|
214
|
+
--priority 2 \
|
|
215
|
+
--json)"
|
|
216
|
+
goal_id="$(echo "$goal_json" | jq -r '.id')"
|
|
217
|
+
|
|
218
|
+
mu forum post issue:"$goal_id" -m "<goal brief + acceptance criteria>" --author operator
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Evaluation scenarios
|
|
222
|
+
|
|
223
|
+
1. **Planning-to-execution continuity**
|
|
224
|
+
- Setup: a freshly planned DAG.
|
|
225
|
+
- Expected: all nodes satisfy protocol tag/kind/context rules and can be consumed by subagents without re-shaping.
|
|
226
|
+
|
|
227
|
+
2. **Decomposition with synthesis fan-in**
|
|
228
|
+
- Setup: worker expands a complex node.
|
|
229
|
+
- Expected: spawn/fork children plus one synth child are created, dependencies block synth until all children finish, parent closes as `expanded`.
|
|
230
|
+
|
|
231
|
+
3. **Human-input interruption**
|
|
232
|
+
- Setup: missing external decision during execution.
|
|
233
|
+
- Expected: `kind:ask` node is created, marked non-executable, downstream nodes are blocked on the ask node, execution resumes after answer issue closes.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory
|
|
3
|
+
description: "Runs cross-store memory retrieval and index maintenance workflows with bounded filters and timeline anchors. Use when querying historical context or repairing memory index health."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# memory
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks for historical context lookup, timeline reconstruction,
|
|
9
|
+
or memory index diagnostics.
|
|
10
|
+
|
|
11
|
+
## Contents
|
|
12
|
+
|
|
13
|
+
- [Core contract](#core-contract)
|
|
14
|
+
- [Preflight checks](#preflight-checks)
|
|
15
|
+
- [Query workflows](#query-workflows)
|
|
16
|
+
- [Index maintenance workflows](#index-maintenance-workflows)
|
|
17
|
+
- [Diagnostics and recovery](#diagnostics-and-recovery)
|
|
18
|
+
- [Evaluation scenarios](#evaluation-scenarios)
|
|
19
|
+
|
|
20
|
+
## Core contract
|
|
21
|
+
|
|
22
|
+
1. **Bounded queries first**
|
|
23
|
+
- Start with narrow filters and explicit `--limit`.
|
|
24
|
+
- Expand scope only when needed.
|
|
25
|
+
|
|
26
|
+
2. **Use the memory CLI surface**
|
|
27
|
+
- Use `mu memory search|timeline|stats|index ...`.
|
|
28
|
+
- Do not manually inspect/parse store files first unless memory commands fail.
|
|
29
|
+
|
|
30
|
+
3. **Read -> refine -> verify**
|
|
31
|
+
- Run an initial query, inspect quality, refine filters, then confirm result relevance.
|
|
32
|
+
|
|
33
|
+
4. **Index-aware behavior**
|
|
34
|
+
- `search/timeline/stats` auto-heal missing indexes when possible.
|
|
35
|
+
- Use explicit index status/rebuild commands for deterministic maintenance.
|
|
36
|
+
|
|
37
|
+
## Preflight checks
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mu status --pretty
|
|
41
|
+
mu memory --help
|
|
42
|
+
mu memory index status --pretty
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Optional source inventory:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
mu memory stats --pretty
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Query workflows
|
|
52
|
+
|
|
53
|
+
### 1) Search for relevant context
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
mu memory search --query "<topic>" --limit 20
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Refine with anchors/filters as needed:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mu memory search \
|
|
63
|
+
--query "<topic>" \
|
|
64
|
+
--issue-id <issue-id> \
|
|
65
|
+
--run-id <run-id> \
|
|
66
|
+
--source events \
|
|
67
|
+
--limit 30 --pretty
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2) Reconstruct timeline around an anchor
|
|
71
|
+
|
|
72
|
+
Timeline requires at least one anchor (for example `--issue-id`, `--run-id`,
|
|
73
|
+
`--session-id`, `--conversation-key`, `--topic`, or `--channel`):
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mu memory timeline --issue-id <issue-id> --order desc --limit 40 --pretty
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 3) Gather source-level memory stats
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mu memory stats --pretty
|
|
83
|
+
mu memory stats --source events --json --pretty
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Useful for identifying dominant sources, recency gaps, and text-volume skew.
|
|
87
|
+
|
|
88
|
+
## Index maintenance workflows
|
|
89
|
+
|
|
90
|
+
### 1) Inspect index health
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
mu memory index status --pretty
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2) Rebuild full index
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
mu memory index rebuild --pretty
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 3) Rebuild selected sources
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
mu memory index rebuild --sources issues,forum,events --pretty
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use targeted rebuilds when one source is stale/corrupted.
|
|
109
|
+
|
|
110
|
+
## Diagnostics and recovery
|
|
111
|
+
|
|
112
|
+
If memory results are missing or low quality:
|
|
113
|
+
|
|
114
|
+
1. Verify index and rebuild if needed:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
mu memory index status --pretty
|
|
118
|
+
mu memory index rebuild --pretty
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
2. Re-run query with explicit anchors:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
mu memory search --query "<topic>" --issue-id <issue-id> --limit 30 --pretty
|
|
125
|
+
mu memory timeline --run-id <run-id> --order desc --limit 50 --pretty
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. Validate source coverage:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
mu memory stats --pretty
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
4. Apply smallest correction:
|
|
135
|
+
- tighten/expand filters
|
|
136
|
+
- adjust anchors (`issue_id`, `run_id`, `session_id`, `topic`, channel metadata)
|
|
137
|
+
- rebuild selected sources only
|
|
138
|
+
|
|
139
|
+
Compatibility note:
|
|
140
|
+
- `mu context ...` remains an alias to `mu memory ...`.
|
|
141
|
+
|
|
142
|
+
## Evaluation scenarios
|
|
143
|
+
|
|
144
|
+
1. **Issue-scoped context retrieval**
|
|
145
|
+
- Setup: user asks for prior decisions on one issue.
|
|
146
|
+
- Expected: `search` + `timeline` with `--issue-id` produce coherent, bounded context summary.
|
|
147
|
+
|
|
148
|
+
2. **Missing-index auto-heal and explicit rebuild**
|
|
149
|
+
- Setup: index file missing/stale.
|
|
150
|
+
- Expected: query path auto-heals missing index when possible; explicit `index rebuild` restores healthy status deterministically.
|
|
151
|
+
|
|
152
|
+
3. **Channel/session forensic lookup**
|
|
153
|
+
- Setup: user asks what happened in a specific conversation/session.
|
|
154
|
+
- Expected: anchored filters (`--session-id`/`--conversation-key`/`--channel`) recover relevant chronology without unrelated noise.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mu
|
|
3
|
+
description: "Runs core mu operator workflows for bounded investigation, CLI-first state operations, and session handoffs. Use when general mu execution or state-management guidance is needed."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# mu
|
|
7
|
+
|
|
8
|
+
Use this skill for day-to-day operator work in `mu`: inspect state, mutate state safely,
|
|
9
|
+
run focused execution loops, and hand off to specialized skills when needed.
|
|
10
|
+
|
|
11
|
+
## Contents
|
|
12
|
+
|
|
13
|
+
- [Core contract](#core-contract)
|
|
14
|
+
- [Default bounded investigation loop](#default-bounded-investigation-loop)
|
|
15
|
+
- [Common mutation patterns](#common-mutation-patterns)
|
|
16
|
+
- [Session and serve surfaces](#session-and-serve-surfaces)
|
|
17
|
+
- [Durable automation handoff](#durable-automation-handoff)
|
|
18
|
+
- [Evaluation scenarios](#evaluation-scenarios)
|
|
19
|
+
- [Escalation map](#escalation-map)
|
|
20
|
+
|
|
21
|
+
## Core contract
|
|
22
|
+
|
|
23
|
+
1. **Investigate first**
|
|
24
|
+
- Prefer cheap evidence over assumptions.
|
|
25
|
+
- Start with bounded queries (`--limit`, scoped filters), then drill into specific entities.
|
|
26
|
+
|
|
27
|
+
2. **CLI-first state operations**
|
|
28
|
+
- Read/mutate `issues`, `forum`, `memory`, and `control-plane` via `mu` CLI commands.
|
|
29
|
+
- Avoid hand-editing JSONL runtime journals for normal operations.
|
|
30
|
+
|
|
31
|
+
3. **Read -> act -> verify loop**
|
|
32
|
+
- Before writes: inspect relevant current state.
|
|
33
|
+
- After writes: re-read to confirm effect.
|
|
34
|
+
|
|
35
|
+
4. **Keep work reversible and explicit**
|
|
36
|
+
- Prefer small, composable steps.
|
|
37
|
+
- State assumptions and blockers clearly.
|
|
38
|
+
|
|
39
|
+
## Default bounded investigation loop
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mu status --pretty
|
|
43
|
+
mu issues list --status open --limit 20 --pretty
|
|
44
|
+
mu issues ready --limit 20 --pretty
|
|
45
|
+
mu forum read user:context --limit 20 --pretty
|
|
46
|
+
mu memory search --query "<topic>" --limit 20
|
|
47
|
+
mu store tail events --limit 20 --pretty
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then inspect concrete targets:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mu issues get <id> --pretty
|
|
54
|
+
mu forum read issue:<id> --limit 20 --pretty
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Common mutation patterns
|
|
58
|
+
|
|
59
|
+
Issue/forum lifecycle:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mu issues update <id> --status in_progress --pretty
|
|
63
|
+
mu forum post issue:<id> -m "START: <plan>" --author operator
|
|
64
|
+
mu forum post issue:<id> -m "RESULT: <summary>" --author operator
|
|
65
|
+
mu issues close <id> --outcome success --pretty
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Control-plane lifecycle:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
mu control status --pretty
|
|
72
|
+
mu control identities --all --pretty
|
|
73
|
+
mu control reload
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Store forensics:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
mu store ls --pretty
|
|
80
|
+
mu store tail cp_commands --limit 20 --pretty
|
|
81
|
+
mu store tail cp_outbox --limit 20 --pretty
|
|
82
|
+
mu store tail cp_adapter_audit --limit 20 --pretty
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Session and serve surfaces
|
|
86
|
+
|
|
87
|
+
Primary interactive surface:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mu serve
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Session follow-ups/handoffs:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mu session list --json --pretty
|
|
97
|
+
mu session <session-id>
|
|
98
|
+
mu turn --session-kind operator --session-id <session-id> --body "<follow-up>"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
In attached terminal operator chat, `/mu` helpers are available (`/mu events`, `/mu plan`, `/mu subagents`, `/mu help`).
|
|
102
|
+
|
|
103
|
+
## Durable automation handoff
|
|
104
|
+
|
|
105
|
+
Use heartbeat/cron programs for recurring or unattended progression:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
mu heartbeats --help
|
|
109
|
+
mu cron --help
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
When work is multi-step and issue-graph driven, use `planning` to shape the DAG,
|
|
113
|
+
then `hierarchical-work-protocol` to keep DAG semantics consistent, then
|
|
114
|
+
`subagents` for durable execution.
|
|
115
|
+
For recurring bounded automation loops, use `heartbeats`.
|
|
116
|
+
For wall-clock schedules (one-shot, interval, cron-expression), use `crons`.
|
|
117
|
+
|
|
118
|
+
## Evaluation scenarios
|
|
119
|
+
|
|
120
|
+
1. **Bounded investigation before mutation**
|
|
121
|
+
- Prompt: user asks for status + targeted change.
|
|
122
|
+
- Expected: skill gathers scoped evidence first (`mu status`, `issues`, `forum`, `memory`), then performs minimal write and verifies post-state.
|
|
123
|
+
|
|
124
|
+
2. **Control-plane diagnostics loop**
|
|
125
|
+
- Prompt: user reports messaging channel stopped responding.
|
|
126
|
+
- Expected: skill inspects `mu control status`, identities, and adapter audit/outbox logs, then proposes smallest reversible recovery step (`reload`, relink, or config fix).
|
|
127
|
+
|
|
128
|
+
3. **Session handoff continuity**
|
|
129
|
+
- Prompt: user asks to continue prior operator thread.
|
|
130
|
+
- Expected: skill inspects `mu session list`, resumes by ID, and keeps follow-up actions scoped to the resumed session context.
|
|
131
|
+
|
|
132
|
+
## Escalation map
|
|
133
|
+
|
|
134
|
+
- Historical context retrieval and index maintenance: **`memory`**
|
|
135
|
+
- Planning/decomposition and DAG review: **`planning`**
|
|
136
|
+
- Shared DAG semantics for planning + execution: **`hierarchical-work-protocol`**
|
|
137
|
+
- Durable multi-agent orchestration: **`subagents`**
|
|
138
|
+
- Recurring bounded automation scheduling: **`heartbeats`**
|
|
139
|
+
- Wall-clock scheduling workflows: **`crons`**
|
|
140
|
+
- Messaging adapter onboarding:
|
|
141
|
+
- **`setup-slack`**
|
|
142
|
+
- **`setup-discord`**
|
|
143
|
+
- **`setup-telegram`**
|
|
144
|
+
- **`setup-neovim`**
|