@mutmutco/cursor-plugin 4.2.7 → 4.3.1

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 (35) hide show
  1. package/.cursor-plugin/plugin.json +2 -3
  2. package/package.json +1 -1
  3. package/scripts/edit-tool-paths.mjs +4 -4
  4. package/skills/bootstrap/SKILL.md +2 -2
  5. package/skills/bootstrap/seeds/README.template.md +2 -2
  6. package/skills/bootstrap/seeds/gate.template.yml +5 -5
  7. package/skills/bootstrap/seeds/manifest.json +1 -0
  8. package/skills/bootstrap/seeds/test-policy.template.json +4 -0
  9. package/skills/hotfix/SKILL.md +1 -1
  10. package/skills/rcand/SKILL.md +1 -1
  11. package/skills/release/SKILL.md +38 -9
  12. package/skills/secrets/SKILL.md +1 -1
  13. package/skills/stage/SKILL.md +1 -1
  14. package/bin/mmi-hook +0 -2
  15. package/bin/mmi-hook-console.cmd +0 -16
  16. package/bin/mmi-hook.exe +0 -0
  17. package/hooks/cursor-hooks.json +0 -26
  18. package/scripts/command-ladder-core.mjs +0 -339
  19. package/scripts/command-ladder-gate.mjs +0 -126
  20. package/scripts/deny-gate-crash.mjs +0 -179
  21. package/scripts/env-write-lint.mjs +0 -146
  22. package/scripts/hook-io.mjs +0 -22
  23. package/scripts/hook-policy.mjs +0 -78
  24. package/scripts/hook-run.mjs +0 -434
  25. package/scripts/hook-trace.mjs +0 -151
  26. package/scripts/pretooluse-shell-gates.mjs +0 -720
  27. package/scripts/secret-echo-lint.mjs +0 -177
  28. package/scripts/test-command-policy-core.mjs +0 -294
  29. package/scripts/throttle-core.mjs +0 -332
  30. package/scripts/vault-edit-gate.mjs +0 -94
  31. package/skills/browser-automation/SKILL.md +0 -122
  32. package/skills/mmi/SKILL.md +0 -544
  33. package/skills/mmi-doctor/SKILL.md +0 -66
  34. package/skills/mmi-resume/SKILL.md +0 -123
  35. package/skills/onboard/SKILL.md +0 -72
@@ -1,544 +0,0 @@
1
- ---
2
- name: mmi
3
- description: Show, claim, move, or file work on the repo board.
4
- ---
5
-
6
- # mmi — start of work
7
-
8
- Shows a dev their workboard for this repo: what they're working on, what's free to pick up, and what others
9
- have claimed. Read-only by default — render the board, then get out of the way.
10
-
11
- Explicit invocation is host-native: `/mmi:mmi` in Claude Code, `$mmi:mmi` in Codex, `/mmi`
12
- (canonical `/skill:mmi`) in Kimi Code CLI, and the `mmi` skill (listed in Kilo's `/` picker, invoked via
13
- the `skill` tool) in Kilo Code. The `/mmi` label used below names this workflow; it is not a
14
- universal literal command.
15
-
16
- Status values: `Todo · In Progress · In Review · Done` (GitHub enforces who can move what — don't re-explain
17
- it on every move). Closed/finished items auto-archive after they go quiet; archived ones aren't on the board.
18
-
19
- ## Hard invariants (#5552 — load before any write)
20
-
21
- Two rules sit above every later step. Read them before claiming, filing, or guessing a CLI route:
22
-
23
- 1. **Claims are board mutations.** The only valid claim write is
24
- `mmi-cli oracle board claim <ref>` (optional `--json` / `--for` / `--check`). Never infer or guess an
25
- `oracle issue claim` route — that path does not exist under `oracle issue` (create/view/edit/… only).
26
- If the exact write route was not already grounded in this skill or a live
27
- `mmi-cli commands` / `mmi-cli explain` result, read one of those before invoking it. Do not retry a
28
- guessed `issue …` spelling after a refusal; take the suggested `oracle board claim` form.
29
- 2. **`learning`-tagged reports are cloud-agent work.** After `mmi-cli learning report` (or
30
- `learning skill-lesson`), file and forget: return to the current task immediately. Never claim, poll,
31
- wait on, force-take, or duplicate implementation of the filed learning issue. Consume eventual
32
- propagation separately when it lands; do not own that fix in this session.
33
-
34
- ## Step 0 — identity, greet, eager preflight when stale
35
-
36
- `/mmi` is the dev's hello-to-work — the most common command they run. Three pacing rules before anything else:
37
-
38
- 1. **Resolve login, then greet immediately** (before `board read` or doctor — still the first lines in
39
- the response so the dev never stares at silent tool output). One emoji max in the whole response.
40
- The greeting addresses the dev, never claims to *be* them (not "I'm @<login>"):
41
- - **SessionStart banner** — if context carries `current human: <login>`, use that login.
42
- - **Else** one fast call: `mmi-cli whoami --json` (cached Hub session in `hub-session.json` when
43
- valid — no network; `gh` fallback only when the cache lacks `login`; exit 0 on `unknown`). Do
44
- **not** call `gh api user` separately — `whoami` already covers it. Do **not** wait on `board read`
45
- for identity — `viewer` is for work items only (Step 1).
46
- - Known login → `👋 Welcome back, @<login> — pulling up your board…`
47
- - `source: unknown` → generic `👋 Welcome back — pulling up your board…`
48
- 2. **Keep the board fast: read first, run doctor only when evidence says it can change this render (#2112).**
49
- The normal happy path is identity → board read. Do **not** block the board on a doctor run just to
50
- check freshness. Run doctor synchronously only after a hard signal that the current setup may be broken:
51
- `mmi-cli` is missing, `board read` reports missing auth/project scope, the command surface is absent, or a
52
- cached/session-start health line explicitly says a heal is needed.
53
-
54
- ```bash
55
- mmi-cli oracle board read --json # Step 1 — first useful render on the happy path
56
- mmi-cli doctor --no-repo-writes # only after a hard setup signal — foreground, one at a time
57
- ```
58
-
59
- Since #4199 `--preflight` is **READ-ONLY** (docs/doctor-contract.md § Flag Grammar — the canon
60
- reversal; jerv semantics win estate-wide): it measures and reports with the shared exit code and performs
61
- zero writes. The heal lane for "fix my env before work" is `doctor --no-repo-writes` — the default heal
62
- run minus repo working-tree mutation. Its heals are `npm install -g` and a marketplace remove → add →
63
- install, both machine-global, serialised behind a machine-wide lock (#3489), so two concurrent runs no
64
- longer interleave inside the npm prefix or the marketplace clone — the second waits, and if the first is
65
- still installing after two minutes the second reports the heal as skipped rather than forcing it.
66
-
67
- Still run it in the foreground and wait. The lock stops corruption, not confusion: a backgrounded run
68
- that reports "skipped — lock busy" has healed nothing, and an agent that does not read that line will
69
- carry on believing its tooling was fixed.
70
-
71
- `doctor --no-repo-writes` heals a stale/unresolved plugin install (the **env** half of the interactive
72
- doctor, #3485/#3975) — it never touches the repo working tree. When it prints
73
- `↻ Updating mmi tooling, one moment…`, relay that before waiting; when it prints `↻ MMI tooling
74
- updated — …`, relay the reload/restart guidance.
75
-
76
- What the env half heals:
77
-
78
- - a stale or unresolved Claude plugin → `claude plugin marketplace remove mmi` → `… remove mutmutco` →
79
- `claude plugin marketplace add mutmutco/MMI-Hub` → `claude plugin install mmi@mutmutco`. A fresh
80
- reinstall, never `claude plugin update`, which nests into itself past MAX_PATH on Windows and wipes the
81
- marketplace clone (#1126). Effective after a reload: **restart Claude Code / run `/reload-plugins`**
82
- (native), or **reopen the workspace** (VS Code extension).
83
- - superseded plugin cache versions → the guarded auto-prune (#4199, canon per
84
- docs/doctor-contract.md § Guarded cache prune): never the running/newest/installed version, a cache a
85
- live session holds is named "still held" and never forced.
86
-
87
- What it does **not** do since #4954: converge CLI or host versions. A behind npm global is REPORTED
88
- and the `fleet` row reads MMI Hub's last-run journal evidence. `mmi-hub update` is the single safe
89
- version-convergence writer; plain doctor and `/mmi` never run repository cleanup.
90
-
91
- - **Fast path** → `whoami` then `board read`; no foreground doctor.
92
- - **Hard setup signal** → run `doctor --no-repo-writes`, relay `↻` lines, then retry `board read` when appropriate.
93
- - **`mmi-cli: command not found`** → plugin PATH provisioning has not applied, or the standalone CLI is not installed.
94
- In Claude Code, reopen the session; if it persists, install the MMI plugin:
95
- `/plugin marketplace add mutmutco/MMI-Hub` → `/plugin install mmi@mutmutco` → `/reload-plugins`.
96
- On Codex, install the Hub-shipped plugin: `codex plugin marketplace add mutmutco/MMI-Hub` →
97
- `codex plugin add mmi@mutmutco`, then trust the bundled hooks via `/hooks`. On Kimi Code CLI:
98
- `/plugins install https://github.com/mutmutco/MMI-Hub` → `/reload`. On Cursor, run
99
- `mmi-cli plugin heal`, then reload the Cursor window. On OpenCode and plain shell install the
100
- maintenance package; it provisions the standalone CLI:
101
- ```powershell
102
- npm install -g @mutmutco/hub
103
- mmi-hub install
104
- ```
105
- In PowerShell from an `MMI-Hub` checkout, or when diagnosing a stale plugin cache, use the repo-local fallback:
106
- ```powershell
107
- node cli/dist/index.cjs doctor --json
108
- ```
109
- - **The host-native skill entry is missing** — `/mmi:mmi` is absent in Claude, `$mmi:mmi` is absent in
110
- Codex, or `/skill:mmi` is absent in Kimi (the auto-heal below is Claude-only; Codex and Kimi ship the
111
- same skills but repair is a manual reinstall — see their recipes above) → the plugin is stale,
112
- duplicated, or disabled, so the skill surface is gone and you can't reach this workflow through the
113
- host UI. Recover from the shell with the repo-local doctor, which detects and self-heals it:
114
- ```powershell
115
- node cli/dist/index.cjs doctor # from an MMI-Hub checkout — auto-heals + prints the reload action
116
- ```
117
- If `claude` isn't on PATH for the auto-heal, run the reinstall by hand (never `/plugin` in VS Code — it
118
- isn't an updateable path there):
119
- ```bash
120
- # Claude Code (native or VS Code extension)
121
- claude plugin marketplace remove mmi && claude plugin marketplace remove mutmutco && claude plugin marketplace add mutmutco/MMI-Hub && claude plugin install mmi@mutmutco
122
- # then: restart Claude Code / run /reload-plugins (VS Code: reopen the workspace)
123
- ```
124
- - **A gate is ✗** → walk them through the printed fix; don't just echo it:
125
- - **GitHub auth** (the usual one) — the board uses its `gh` token. Give them the
126
- command to run **in their own terminal** (the browser step is theirs — an agent can't log in as them):
127
- ```bash
128
- gh auth login --hostname github.com --git-protocol https --web --scopes "project"
129
- ```
130
- The `project` scope is what lets `/mmi` read + move the board, granted here once. When they're back,
131
- re-run `mmi-cli doctor --preflight` to confirm green without writes.
132
- - **Hub registry / board META** — `mmi-cli oracle org project get <owner/repo>` or `mmi-cli oracle board read` reports
133
- missing project/board coords → a master-admin registers or backfills the repo's `PROJECT#<slug>` META.
134
- There's no reliable project to read until that is fixed, so stop here.
135
-
136
- A broken setup surfaces from `doctor --preflight` (read-only), a failed `board read`, or a gate that still fails after
137
- heal — handle it then. A `command not found` from **either** command routes into the recovery paths above.
138
- Don't block the all-green path on doctor noise.
139
-
140
- ## Authority (org-wide)
141
-
142
- `/mmi` is the usual session start — agents should know the dev's role before any later train, vault, or
143
- tenant request surfaces. After the board read (Step 1), you already have `viewer` in the JSON; for train
144
- authority on this or another repo, run:
145
-
146
- ```bash
147
- mmi-cli oracle org access role <owner/repo> --json # { role, train } — Hub-verified from registry projectAdmins
148
- ```
149
-
150
- When `role` is `project-admin` and `train` is true on **that** repo, the dev holds D14 authority there —
151
- guide or execute via the matching skill (`/secrets`, `/rcand`, `/release`, `/hotfix`, `runtime tenant control`).
152
- **Do not** redirect them to the master. Hub train is master-only; org-tier vault and access grants stay
153
- master-only. Full matrix: `AGENTS.md` § Authority.
154
-
155
- ## Config
156
-
157
- The project this repo is on lives in the Hub registry (`PROJECT#<slug>`: `projectOwner`, `projectNumber`,
158
- `projectId`, `statusFieldId`, `statusOptions{}`, and optional Priority field ids), set by `/bootstrap`
159
- (repos and projects are not 1:1 — a repo attaches to a chosen project). Refresh the registry META if a
160
- lookup misses; do not read or repair committed repo-local board config.
161
-
162
- ## Step 1 — read the board (one call, caller-scoped)
163
-
164
- SessionStart injects a **bounded board slice** (assigned + top claimable items, max five lines,
165
- 3s timeout, fail-soft) and, when task relevance is high-confidence, up to **two North Star context
166
- cards** (title + compact intent, PRIOR-not-instruction framing — silent when ambiguous). For the
167
- complete partition — secondary repos, taken items, bundle details — run the full command below.
168
-
169
- ```bash
170
- mmi-cli oracle board read --json
171
- ```
172
-
173
- This is the **only foreground call** on the happy path for **work items** (not identity — Step 0 already
174
- resolved login). Its JSON carries `viewer`, `repo`, and the project title — do **not** run separate
175
- `gh api user` / `gh repo view` calls; they just delay the board. If `repo` is missing from the JSON,
176
- keep the board header generic. The CLI resolves the project from the Hub registry; to inspect it
177
- directly, `mmi-cli oracle org project get --json`.
178
-
179
- Use the returned `primary` group for current-repo items and `secondary` for other repos on the same Project.
180
- Within each group, render `userOwned`, `claimable`, and `taken`.
181
-
182
- CLI partition:
183
- - **Yours** — assignee includes the viewer AND `Status ∈ {Todo, In Progress, In Review}`.
184
- - **Free to claim** — `Status == Todo` AND unassigned AND the viewer has repo write permission
185
- (`repos/<owner>/<repo>.permissions.push == true`). Issue filing stays available to any authenticated
186
- org member; claiming work is gated by write access.
187
- - **Taken** — assigned to someone else (any active status). Render id + status + owner ONLY — no title.
188
-
189
- Do not cache claimable state. Every `/mmi` board is a fresh Project v2 read. Partial reads exit nonzero by
190
- default; use `--allow-partial` only when the dev explicitly accepts an incomplete board. If the read fails
191
- for a missing `read:project` scope, surface that verbatim — the dev grants it once at `gh auth login`.
192
-
193
- ## Step 2 — show the board
194
-
195
- This render is the product: welcoming, guiding, clear — and gone in one glance. Plain **markdown**,
196
- never a fenced code block (monospace hard-wraps long titles and the structure is lost). The shape:
197
-
198
- - **Short refs.** `[RepoName#N](issue-url) · short title` — repo name + number only, no `owner/`
199
- prefix, no `[type]` brackets. The ref is the clickable link; the title follows after `·`, trimmed
200
- to its essence (drop boilerplate prefixes, keep it under ~8 words).
201
- - **Flat `-` lists** under bold head lines — never `##` headings (too heavy for a three-section
202
- board), never nested bullet trees, never tables, never a literal `•` glyph (it breaks GFM list
203
- parsing).
204
- - **Three heads, each with one factual clause** appended after an em dash — a fact the dev can act
205
- on ("two train fixes in flight"), not cheerleading. Encouragement lives once, in the close.
206
- - **On your plate** — the dev's items, status noted inline after the title (`· in review`) when
207
- not In Progress. In Review means *awaiting admin review & merge* — caption it that way, never
208
- "ready to move".
209
- - **Up for grabs** — claimable items.
210
- - **Taken** — id · status · owner ONLY, never the title. No commentary clause; it's reference.
211
- - **Skip empty sections silently** — no "nothing here" filler. Empty board entirely → one warm line:
212
- nothing assigned, point at Up for grabs or filing a new item.
213
- - **Close with one grounding line** — no question, no hype, no pressure: `Pick one and claim it
214
- when you're ready.` plus the standing quiet affordance `Or file a new item — say the word.`
215
- - **One screen total.** Greeting + sections + optional Leverage (Step 6) + close.
216
-
217
- Full example (greeting printed earlier, before the read):
218
-
219
- > 👋 Welcome back, @dev — here's your board on **MMI-Hub**.
220
- >
221
- > **On your plate** — two train fixes in flight:
222
- > - [MMI-Hub#834](https://github.com/mutmutco/MMI-Hub/issues/834) · automated hotfix apply path
223
- > - [MMI-Hub#841](https://github.com/mutmutco/MMI-Hub/issues/841) · rcand stuck on required checks
224
- >
225
- > **Up for grabs** — ready when you are:
226
- > - [MMI-Hub#821](https://github.com/mutmutco/MMI-Hub/issues/821) · redesign tenant env-writer
227
- > - [MMI-Hub#839](https://github.com/mutmutco/MMI-Hub/issues/839) · revisit hotfix back-merge policy
228
- >
229
- > **Taken**
230
- > - MMI-Hub#827 · In Progress · @otherdev
231
- >
232
- > **Leverage**
233
- > - #834 and #841 are both train-lane — I can run them side by side, one PR each.
234
- >
235
- > Pick one and claim it when you're ready. Or file a new item — say the word.
236
-
237
- Only an admin merges (a project-admin on their own project, the master-admin everywhere); the dev who
238
- opened the PR waits on that review, they don't move it themselves.
239
-
240
- ## Step 3 — stop (act only on request)
241
-
242
- Render the board and stop. Don't prompt for a choice, don't recommend a next move, don't ask "what now?".
243
- The dev drives: when they say claim / continue / file — or accept a Leverage offer (Step 6) — do it.
244
- Otherwise the board alone is the answer.
245
-
246
- **Status moves happen automatically** as the work flows (claim, PR open, merge, release). The dev never
247
- moves an item by hand, so **never suggest a status move** — not "advance to Test", not "mark this PR",
248
- not "ready to move?". The board reflects state; it doesn't ask the dev to change it.
249
-
250
- The one standing affordance is **filing a new item** — always available, no item needed. The Step 2
251
- close line already carries it (`Or file a new item — say the word.`); never turn it into a status
252
- nudge. If the dev takes it, run the guided flow in Step 5.
253
-
254
- ## Step 4 — load the full item before working it
255
-
256
- The moment the dev commits to an item (continue or claim), read the **whole** work item before planning or
257
- acting — never from the board title alone. Body **and every comment**, end-to-end; treat later comments as
258
- potentially **superseding** the body. Only then greet into the work or propose a plan.
259
-
260
- ```bash
261
- # One shot — status, assignees, type, body, and every comment for one board item:
262
- mmi-cli oracle board show <owner/repo#N> # add --json for machine-readable output
263
- ```
264
- For an item **not on the board**, `mmi-cli oracle issue view <N> --comments` is the board-independent one-shot:
265
- it returns the body **and** every comment as JSON in a single call (add `--context` for `linkedPrs` and, on
266
- an epic, a `children` summary). Prefer it over raw `gh issue view --comments`, which in a non-TTY shell (every
267
- agent/CI context) prints only the comments, hides the body, and prints nothing at all on a zero-comment issue.
268
- ```bash
269
- mmi-cli oracle issue view <N> --repo <owner/repo> --comments # body + every comment, one call
270
- ```
271
-
272
- > **Never reach for standalone `jq`** — it isn't installed on Windows dev machines, so each attempt burns a
273
- > failed call (#230). `mmi-cli oracle board read|show` is already human-readable (drop `--json`); to parse JSON use
274
- > `mmi-cli … --json` piped to `node`, or `gh`'s **built-in** `--jq`. Do not assume the entire captured stdout is
275
- > one JSON document: older `oracle org project get --json` and `oracle board read --json` builds appended a human
276
- > summary after the object (#5173). Extract the first balanced object, then parse it:
277
- >
278
- > ```js
279
- > function firstJsonObject(stdout) {
280
- > const start = stdout.indexOf('{');
281
- > if (start < 0) throw new Error('stdout contains no JSON object');
282
- > let depth = 0;
283
- > let inString = false;
284
- > let escaped = false;
285
- > for (let index = start; index < stdout.length; index += 1) {
286
- > const char = stdout[index];
287
- > if (inString) {
288
- > if (escaped) escaped = false;
289
- > else if (char === '\\') escaped = true;
290
- > else if (char === '"') inString = false;
291
- > continue;
292
- > }
293
- > if (char === '"') inString = true;
294
- > else if (char === '{') depth += 1;
295
- > else if (char === '}' && --depth === 0) return JSON.parse(stdout.slice(start, index + 1));
296
- > }
297
- > throw new Error('stdout contains incomplete JSON');
298
- > }
299
- > ```
300
- >
301
- > Never truncate at the last `}`; trailing prose can contain braces, and malformed/incomplete JSON must fail closed.
302
-
303
- > **Never capture board JSON with a shell redirect on Windows** (#5802). PowerShell 5.1's `> file.json` is
304
- > `Out-File`, which writes **UTF-16LE with a BOM**, so the file starts `FF FE` and the next step —
305
- > `readFileSync(path, 'utf8')` + `JSON.parse` — dies at position 1. Pass `--out <path>` instead: the CLI
306
- > writes the file itself as UTF-8 with no BOM, so the bytes never reach the shell.
307
- >
308
- > ```bash
309
- > mmi-cli oracle board read --json --out .jerv/tmp/board.json # UTF-8, parses everywhere
310
- > ```
311
-
312
- (Triggers only when a dev commits to an existing item — no-op for the *report a bug / request a feature /
313
- something else* paths.)
314
-
315
- ## Step 5 — act
316
-
317
- - **Claim:** when the dev takes an item, assign them + set `In Progress` in one go. This is the only status
318
- write `/mmi` makes, and only as the mechanical side of claiming — never as a standalone "move" the dev
319
- is offered. Every later transition (In Review on PR open, Done on merge) flows automatically from the
320
- work, not from here. **Route (hard):** `oracle board claim` only — never `oracle issue claim` (#5552).
321
- ```bash
322
- mmi-cli oracle board claim <owner/repo#N> --json
323
- ```
324
- The command validates `Todo` + unassigned, assigns the viewer, and moves the Project v2 `Status` to
325
- `In Progress`. A partial claim exits nonzero unless the dev explicitly accepted `--allow-partial`.
326
- Every claim also stamps a lane-identity marker comment on the issue (`<!-- mmi-claim: … -->`,
327
- surface/session@host) so other agents can attribute the hold (#3727): the session is the
328
- host-exported id when the surface provides one, otherwise a per-process `synth-` fallback — a
329
- claim is never anonymous (#5245).
330
- Claiming several items (batch/parallel act-paths) takes them in **one call** — `board claim <ref> <ref> …`
331
- — which shares the setup cost and reports per-item results (any per-item failure → nonzero exit).
332
- - **File a new item (guided by type → template):** don't free-type an issue. Walk the dev through it:
333
- 1. **Pick the type** — `bug` · `feature` · `task` (the repo's three `.github/ISSUE_TEMPLATE/` forms;
334
- each carries its own label). Offer the choice with the structured-question UI, one line each:
335
- bug = something's broken · feature = new capability · task = chore/improvement.
336
- 2. **Fill that type's template.** Read its fields from `.github/ISSUE_TEMPLATE/<type>.yml` and gather
337
- answers from the dev for each — draft where you can, ask where you can't (the template form is
338
- interactive and won't drive in a non-TTY agent shell, so collect the fields, then create directly).
339
- The **surface contract is a repo board rule, not a template field** (#5187): the repo enforces
340
- exactly one `surface:*` label on every open issue even when `<type>.yml` carries no surface
341
- dropdown, so `oracle issue create` rejects a filing that omits it regardless of the template.
342
- Never infer the surface from the template alone — discover the repo's valid values first
343
- (`gh label list --search 'surface:'`, or reuse a known surface for that repo) and always pass
344
- `--surface` in Step 5.3.
345
- 3. **Submit via `mmi-cli oracle issue create`** — the canonical create path. Before filing, read the live
346
- command contract from `mmi-cli explain oracle issue create --json`; flags change, and a missing documented flag means
347
- the installed CLI is stale until a fresh local build proves otherwise. It maps `--type` to the label,
348
- `--priority` sets the board Priority **field** (never a `priority:*` label — #416), and `--surface`
349
- supplies the repository's required single surface label. It always prints `{number,url}` JSON. Never
350
- use `gh issue create`; it bypasses these board contracts:
351
- ```bash
352
- mmi-cli oracle issue create --type <bug|feature|task> --title "<title>" --body "<filled template>" \
353
- --priority <high|medium|low> --surface <surface>
354
- ```
355
- For long markdown, materialize a temporary UTF-8 body file, pass its real path with
356
- `--body-file <path>`, then remove it after the write succeeds. Do not pipe multiline markdown to
357
- `--body-file -` on a guarded host.
358
- A title with backticks needs `--title-file` (#3381). On Windows Git Bash, a title that starts
359
- with `/` (or contains an MSYS-path-shaped token) is rewritten before `mmi-cli` sees it — e.g.
360
- `--title "/update …"` becomes `C:/Program Files/Git/update …`. Prefer `--title-file <path>`, or
361
- prefix the create with `MSYS_NO_PATHCONV=1` (#4373).
362
- The command starts bounded related-issue discovery off-path. It auto-comments only high-confidence,
363
- idempotent links. To inspect candidates manually before writing anything else:
364
- ```bash
365
- mmi-cli oracle issue discover-related --repo <owner/repo> --number <number> --title "<title>" --body "<body>" --json
366
- ```
367
- It lands on the board as Todo automatically — confirm the link from the JSON. (Templates differ per
368
- repo; read the actual `.yml` set rather than assuming bug/feature/task.)
369
- - **File a friction report (org-tooling pain):** `mmi-cli learning report --title "<one-line>" --body "<what hurt>"`
370
- files it on the Hub board via your Hub session and dedups against the open reports (a confident
371
- duplicate becomes a +1 comment, not a new issue). The actual GitHub write runs server-side with the
372
- Hub App's own token (#263), so no MMI-Hub repo access is required to file. Never read Hub coordinates or
373
- keys from a repo-local `.env`, call a repo-local report script, or POST the Hub API directly — the CLI
374
- carries the endpoint and your Hub session intrinsically.
375
- **Learning fire-and-forget (#5552):** the filed issue carries the `learning` label and is owned by
376
- cloud agents. After a successful file (or dedup +1), print the `{number,url}` receipt if useful, then
377
- **return to the current task** — do not `board claim` it, poll it, wait on a PR, force-take it, or open
378
- a second implementation issue for the same friction.
379
- - Surface any `gh`/`mmi-cli` error verbatim.
380
-
381
- ## Step 6 — Leverage (offer where it fits)
382
-
383
- `/mmi` is an agentic coding board — every item is written by an LLM agent, so the board can do more than
384
- hand over one item at a time. Between the Taken section and the close, render an optional **Leverage**
385
- block: **up to two** offers, one line each, under a bold `**Leverage**` head (see the Step 2 example).
386
- **Default to silence:** if nothing below crisply fits, omit the whole block — never pad it. Never use a
387
- question-UI, never pressure — the dev acts or ignores.
388
-
389
- Pick up to two, in priority order:
390
-
391
- 1. **Split + fan out** — a single item plainly too large for one PR (body is multi-part, an umbrella or
392
- epic). Offer to slice it into child issues. (First because it *creates* the items the rest act on.)
393
- 2. **Batch** — 2+ claimable items that are one coherent unit (shared title-prefix family, same subsystem)
394
- **and** touch overlapping/adjacent paths. Coupled → **one PR**.
395
- 3. **Parallel** — 2+ items that are mutually independent and touch **disjoint paths**. Independent → **one PR each**, run concurrently.
396
- 4. **Background** — a single long-running item (broad refactor, large build/sweep). Kick it off in the
397
- background so the dev isn't blocked.
398
-
399
- Disjoint paths is the deciding signal between batch (overlap → one PR) and parallel (disjoint → N PRs).
400
- When unsure which fits, prefer the more conservative offer — a marginal call is worse than a quiet board.
401
- Two offers must not overlap (never the same item in both); a second marginal offer is worse than one
402
- crisp one.
403
-
404
- Bundling detail boundary: start from the metadata board. Only if there are multiple viable
405
- `userOwned`/`claimable` candidates, fetch bodies/comments with:
406
-
407
- ```bash
408
- mmi-cli oracle board read --json --bundle-details
409
- ```
410
-
411
- That detail path may fetch bodies/comments only for `userOwned` and `claimable` issues. `taken` stays
412
- metadata-only, always. Do not fetch Done items, do not cache claimables, and do not pass `--allow-partial`
413
- unless the dev explicitly accepts an incomplete Leverage read. If detail lookup exits nonzero, render
414
- the board without a Leverage block.
415
-
416
- Offer lines — one line each, no UI, no "(Recommended)", phrased as available leverage:
417
-
418
- - **Batch** — `These read like one change — I can take #66–#70 together in a single PR if you'd like.`
419
- - **Parallel** — `#17 and #18 are independent — I can run them side by side, one PR each, if that helps.`
420
- - **Background** — `#22 looks long-running — I can take it in the background so you're not blocked.`
421
- - **Split** — `#60 looks large — I can slice it into child issues and fan them out, if you want.`
422
-
423
- Act-paths run only on the dev's explicit go. MMI coordinates board and PR outcomes, while the host owns
424
- workspace mechanics:
425
-
426
- - **PR metadata:** read `mmi-cli explain devops pr create --json` or `mmi-cli explain devops pr edit --json` before the
427
- write. For multiline Markdown, materialize a temporary UTF-8 body file, pass its real path with
428
- `--body-file <path>`, and remove it after the write succeeds. Do not pipe the body to `--body-file -`;
429
- host prose guards require the materialized-file path.
430
- - **Batch:** claim each item (the Step 5 claim loop), make the coupled edits, and open **one** PR
431
- (`Closes #…, #…`). When an issue must stay open (HOLD/prep), never write `Does not close #N` — GitHub
432
- still closes it; use `Part of #N` / `Refs #N` / `leaves #N open` only (JC#495).
433
- - **Parallel:** run independent work concurrently, **one PR per item**. If two would touch the same file,
434
- serialize them or fold them into a batch instead. On Windows, set `git config core.longpaths true` on the
435
- main checkout before the first `git worktree add` (#5499; see `docs/Architecture/worktrees.md`). Linked
436
- worktrees of one clone still share `.git`: serialize `git branch -m` / other ref renames across those
437
- worktrees, or retry serially when the error names `.git/logs/refs/.tmp-renamed-log` (#5485; see
438
- `docs/Architecture/worktrees.md`).
439
- - **Background:** run off the hot path (a background task or CI job); poll with `/loop` if useful. Bound it
440
- — never block silently.
441
- - **Split:** keep the original as the umbrella; file each child as a **native sub-issue** of it with
442
- `mmi-cli oracle issue create --parent <umbrella-ref> …` (or `mmi-cli oracle issue link-child <umbrella> <child>` for a
443
- child that already exists). The parent then renders a sub-issue checklist with each child's state and the
444
- child renders its parent — no title prefix or body task-list to maintain. Refs are `#NN`, `owner/repo#NN`,
445
- or a URL, and it works cross-repo (a Hub umbrella can track product-repo children). Get the dev's go before
446
- filing the children; each child then becomes a parallel item. **When the last child merges, close the
447
- umbrella** — its `Done` follows automatically.
448
-
449
- ## Host-owned landing and cleanup (#5182)
450
-
451
- MMI owns the PR/CI/merge/board facts; the host agent owns local worktrees and branches. Neither `pr land`
452
- nor `pr merge` deletes a local worktree or local branch, and no MMI command should do so. The distinction:
453
-
454
- **Release-track before branch hygiene (#5244):** before hunting `rc` branches, rc worktrees, or retired rc refs
455
- for cleanup, read the repo's release track (`mmi-cli status`, or `mmi-cli oracle org project get` when
456
- status omits it). Direct-track repos have only `development` and `main` — an old rc promotion PR does not
457
- imply a live `rc` branch or worktree exists.
458
-
459
- - `mmi-cli devops pr land <pr>` is the normal agent path for a `development` PR: train-authority probe →
460
- checks wait → squash auto-merge/poll → board advance. GitHub may delete the **remote** feature branch.
461
- - `mmi-cli devops pr merge <pr>` is the lower-level merge primitive. It is not a shortcut around checks
462
- and it does not own local cleanup either.
463
-
464
- Remote deletion is intentionally immediate and is not the cause of a local Windows lock. Do not delay it
465
- or keep remote branches as cleanup leases. A local squash branch is not an ancestor of `development`, so
466
- `git branch -d` cannot prove delivery even when the PR merged; use the exact merged-PR/head receipt below.
467
-
468
- ### Before `pr land` — release the worktree
469
-
470
- 1. Record the PR number, main-checkout path, task-worktree path, local branch, and local branch OID
471
- (`git rev-parse refs/heads/<branch>`). `git status --porcelain` in the task worktree must be empty;
472
- dirty/untracked means **retain and report**, never clean or overwrite it.
473
- 2. Finish/stop every worker, subagent, monitor, shell, editor terminal, or debugger whose current directory
474
- is inside the task worktree. A completed agent can still leave a Windows directory handle behind.
475
- 3. Change the orchestrating shell/current directory to the main checkout **before** landing. Never invoke
476
- worktree removal while this process or a child still stands inside that tree.
477
- 4. Run `mmi-cli devops pr land <pr> --json` and require a merged status. Enqueued, failed, unknown, or an
478
- unreadable receipt means **no cleanup**.
479
-
480
- ### After a confirmed merge — exact, bounded cleanup
481
-
482
- Read the durable PR receipt and compare it with what is local:
483
-
484
- ```bash
485
- gh pr view <pr> --repo <owner/repo> --json state,headRefName,headRefOid,mergeCommit
486
- git rev-parse refs/heads/<branch>
487
- git -C <task-worktree> status --porcelain
488
- git worktree list --porcelain
489
- ```
490
-
491
- Proceed only when `state` is `MERGED`, `headRefName` equals the local task branch, `headRefOid` equals the
492
- local branch OID, the worktree is registered to that branch, and its status is empty. Branch name, missing
493
- remote ref, patch-id, or PR state **alone** is not proof. Then, from the main checkout:
494
-
495
- A clean `git status --porcelain` is **not** proof the physical directory is empty: gitignored payload such
496
- as `node_modules` (from `npm ci`) and this session's own scratch (e.g. `.jerv/tmp`) is invisible to it,
497
- and `git worktree remove` refuses a non-empty tree with `Directory not empty` (#5239). Once the receipt
498
- above proves delivery, delete `node_modules` and this session's own scratch first, then remove:
499
-
500
- ```bash
501
- rm -rf <task-worktree>/node_modules # gitignored payload — porcelain never shows it
502
- rm -rf <task-worktree>/.jerv/tmp # this session's own scratch, if this run created it
503
- git worktree remove <task-worktree>
504
- git branch -D <branch> # deliberate: squash merge makes -d ancestry proof impossible
505
- git worktree prune
506
- ```
507
-
508
- `-D` is permitted only after the exact receipt above. Never use it for a mismatched OID, an open/unreadable
509
- PR, a dirty tree, another owner's tree, or an ambiguous branch. The pre-removal deletes follow the same
510
- rule: only artifacts this session created inside this task worktree.
511
-
512
- On Windows `Directory not empty` with a clean porcelain, suspect leftover gitignored payload: delete it as
513
- above and retry. On `EBUSY`, `EPERM`, or WinError 32: re-check that every context has left the path and
514
- make **one bounded retry** of `git worktree remove` when it is still registered. If the retry reports
515
- `is not a working tree`, the first failed remove already unregistered the tree; when the exact receipt
516
- above proves the leftover directory is this session's own merged branch, that leftover may be deleted
517
- (`rm -rf <task-worktree>`) — own-session artifacts only, never another session's tree, never on a
518
- mismatched OID or unreadable PR (#5239). Otherwise, or when the retry is still locked, stop: do not kill
519
- unrelated processes, recursively delete the directory, or guess. Report `deferred-lock` with the exact
520
- path, branch, local OID, PR, and whether the tree remains registered. Report any failed proof as
521
- `retained-ambiguous`. Only report `clean` after the path, registration, and local task branch are all gone.
522
- A later host session can drain a deferred lock using the same proof; MMI never owns that sweep.
523
-
524
- ## Notes
525
-
526
- - Reads/moves use **your** `gh` token (needs `read:project`/`project`, granted once at `gh auth login`).
527
- - Promotion (`/rcand`, `/release`, `/hotfix`) and the local test env (`/stage`) are their own skills — `/mmi`
528
- is the board + start-of-work, not the train.
529
- - **Board verbs:** `board read` · `board show <id>` · `board claim <id>` · `board move <status> <id>`.
530
- `move` exists for an agent's own mechanical bookkeeping when **no PR rides the automation** — e.g.
531
- setting `Done` on a no-PR `task` or closed-out item that will not auto-advance. It is a tool, not a
532
- dev-facing offer: the "never suggest a status move" rule (Step 3) still governs the human flow. The verb
533
- hides the `gh project item-edit` + option-id wiring, so reach for it, not raw `gh`.
534
-
535
- ## Retro — one check before you finish
536
- Before your final report, answer one question honestly: did **this skill's own instructions** misfire
537
- this run — ambiguous wording, a misleading message, or an environment failure it should have warned
538
- about? (Process only — never the user's code or task; e.g. a board read that misreported what's
539
- claimable, or a claim that moved the wrong item.) If yes, file **one** lesson and move on; a clean run is
540
- silent (hard cap: one per run). It lands on the Hub board (deduped) and is fixed only via a reviewed PR —
541
- never edit the skill live; the retro is advisory, so if the call fails, note it and continue:
542
- `mmi-cli learning skill-lesson --skill mmi --title "<what misfired>" --body "<what; evidence; proposed amendment>"`
543
- The lesson is `learning`-tagged cloud-agent work (#5552): file it, then finish your current report —
544
- do not claim, poll, or implement that lesson in this session.
@@ -1,66 +0,0 @@
1
- ---
2
- name: mmi-doctor
3
- description: Diagnose hygiene and safely heal tooling; repository cleanup is explicit.
4
- ---
5
-
6
- **Host-native invocation:** Claude `/mmi:mmi-doctor` · Codex `$mmi:mmi-doctor` · jervcode/Kimi `/skill:mmi-doctor` · Kilo `skill` tool. A backticked `/name` in this doc names the matching workflow (this skill or a sibling), not a literal command.
7
-
8
- # /mmi-doctor — one hygiene pass
9
-
10
- Run the safe default when a session opens messy or before a handoff:
11
-
12
- ```bash
13
- mmi-cli doctor
14
- ```
15
-
16
- A plain run may repair machine-global plugin wiring and guarded caches, but **never mutates the
17
- repository** (#5023). It reports managed `.gitignore`, docs-index, board mechanics, and aged scratch.
18
- Local workspace lifecycle is host-owned; doctor does not relocate or delete worktrees. Run
19
- `mmi-cli doctor --apply` only when the operator explicitly wants guarded repository maintenance. Secrets
20
- stay out of doctor; use `mmi-cli vault secrets diff` for a catalog gap check.
21
-
22
- Doctor does **not** converge CLI or host versions (MMI-Hub#4954). `mmi-hub update` is the single
23
- writer of those versions; doctor only reports lag and last-run journal evidence. `mmi-hub status`
24
- reads actual installed locations and versions. Doctor's active-plugin repair pass
25
- covers every surface from any invocation surface — including Cursor's local-checkout row, not only
26
- the active surface.
27
-
28
- ## Flags
29
-
30
- | Flag | Role |
31
- |------|------|
32
- | *(none)* | Safely heal tooling; report repository hygiene without repo writes. |
33
- | `--verbose` | Full checklist + per-row evidence. |
34
- | `--no-repo-writes` | Compatibility spelling for the safe default. |
35
- | `--self` / `--fast` / `--banner` / `--preflight` | Cheap / read-oriented lanes (see `docs/doctor-contract.md`). |
36
- | `--apply` | Explicit advanced lane: also apply guarded repository cleanup. |
37
-
38
- ## Do not run the old multi-step ritual
39
-
40
- Do **not** chain these as a `/mmi-doctor` substitute:
41
-
42
- ```bash
43
- mmi-cli doctor --self
44
- mmi-cli oracle board doctor
45
- mmi-cli vault secrets diff
46
- ```
47
-
48
- Plain `mmi-cli doctor` covers safe tooling repair and diagnosis. Explicit `doctor --apply` covers
49
- repository maintenance; the host owns workspace cleanup. Reach for individual verbs only when you want
50
- one surface alone.
51
-
52
- ## Notes
53
-
54
- - `/mmi-doctor` is the hygiene pass; `/mmi-resume` is the lighter read-only session open.
55
- - Prefer one doctor run over hand-editing board items, gitignore blocks, or marketplace pins.
56
- - The host owns workspace roots, cleanup, and any lease policy. Doctor diagnoses MMI tooling and does
57
- not relocate or delete local worktrees.
58
-
59
- ## Retro — one check before you finish
60
- Before your final report, answer one question honestly: did **this skill's own instructions** misfire
61
- this run — ambiguous wording, a misleading message, or an environment failure it should have warned
62
- about? (Process only — never the user's code or task; e.g. a doctor run that proposed deleting a live
63
- branch.) If yes, file **one** lesson and move on; a clean run is silent (hard cap: one per run). It
64
- lands on the Hub board (deduped) and is fixed only via a reviewed PR — never edit the skill live; the
65
- retro is advisory, so if the call fails, note it and continue:
66
- `mmi-cli learning skill-lesson --skill doctor --title "<what misfired>" --body "<what; evidence; proposed amendment>"`