@muggleai/works 4.13.0 → 4.14.0

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 (74) hide show
  1. package/README.md +3 -3
  2. package/dist/{chunk-QUWM3JQY.js → chunk-5G7WI7IY.js} +2 -2
  3. package/dist/{chunk-TWILR37J.js → chunk-YKR2TQ24.js} +16 -0
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  7. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  8. package/dist/plugin/README.md +1 -1
  9. package/dist/plugin/commands/mprfollowup.md +7 -0
  10. package/dist/plugin/skills/_aliases.json +1 -1
  11. package/dist/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -1
  12. package/dist/plugin/skills/_shared/test-case-chain-readiness.md +41 -0
  13. package/dist/plugin/skills/do/address-reviews.md +1 -1
  14. package/dist/plugin/skills/do/build.md +2 -1
  15. package/dist/plugin/skills/do/open-prs/forward.md +2 -2
  16. package/dist/plugin/skills/do/open-prs/update.md +1 -1
  17. package/dist/plugin/skills/mprfollowup/SKILL.md +8 -0
  18. package/dist/plugin/skills/muggle/SKILL.md +1 -0
  19. package/dist/plugin/skills/muggle-do/SKILL.md +26 -1
  20. package/dist/plugin/skills/muggle-feedback/SKILL.md +1 -1
  21. package/dist/plugin/skills/muggle-pr-followup/SKILL.md +1 -2
  22. package/dist/plugin/skills/muggle-pr-followup/bootstrap.md +5 -3
  23. package/dist/plugin/skills/muggle-pr-followup/contract.md +1 -1
  24. package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +5 -1
  25. package/dist/plugin/skills/muggle-preferences/ops/configure.md +2 -1
  26. package/dist/plugin/skills/muggle-preferences/preference-gates/autoWatchPR.md +13 -0
  27. package/dist/plugin/skills/muggle-preferences/preference-gates/reusePreparePlan.md +11 -0
  28. package/dist/plugin/skills/muggle-status/SKILL.md +1 -1
  29. package/dist/plugin/skills/muggle-test/SKILL.md +16 -3
  30. package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +22 -2
  31. package/dist/plugin/skills/muggle-test-prepare/SKILL.md +5 -1
  32. package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +7 -5
  33. package/dist/plugin/skills/muggle-test-prepare/steps/identify-services.md +2 -0
  34. package/dist/plugin/skills/muggle-test-prepare/steps/readiness-report.md +30 -0
  35. package/dist/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +44 -0
  36. package/dist/release-manifest.json +4 -4
  37. package/dist/{src-BD5AM6OH.js → src-ECRJW2LY.js} +1 -1
  38. package/package.json +7 -6
  39. package/plugin/.claude-plugin/plugin.json +1 -1
  40. package/plugin/.cursor-plugin/plugin.json +1 -1
  41. package/plugin/README.md +1 -1
  42. package/plugin/commands/mprfollowup.md +7 -0
  43. package/plugin/skills/_aliases.json +1 -1
  44. package/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -1
  45. package/plugin/skills/_shared/test-case-chain-readiness.md +41 -0
  46. package/plugin/skills/do/address-reviews.md +1 -1
  47. package/plugin/skills/do/build.md +2 -1
  48. package/plugin/skills/do/open-prs/forward.md +2 -2
  49. package/plugin/skills/do/open-prs/update.md +1 -1
  50. package/plugin/skills/mprfollowup/SKILL.md +8 -0
  51. package/plugin/skills/muggle/SKILL.md +1 -0
  52. package/plugin/skills/muggle-do/SKILL.md +26 -1
  53. package/plugin/skills/muggle-feedback/SKILL.md +1 -1
  54. package/plugin/skills/muggle-pr-followup/SKILL.md +1 -2
  55. package/plugin/skills/muggle-pr-followup/bootstrap.md +5 -3
  56. package/plugin/skills/muggle-pr-followup/contract.md +1 -1
  57. package/plugin/skills/muggle-pr-followup/state-schemas.md +5 -1
  58. package/plugin/skills/muggle-preferences/ops/configure.md +2 -1
  59. package/plugin/skills/muggle-preferences/preference-gates/autoWatchPR.md +13 -0
  60. package/plugin/skills/muggle-preferences/preference-gates/reusePreparePlan.md +11 -0
  61. package/plugin/skills/muggle-status/SKILL.md +1 -1
  62. package/plugin/skills/muggle-test/SKILL.md +16 -3
  63. package/plugin/skills/muggle-test-feature-local/SKILL.md +22 -2
  64. package/plugin/skills/muggle-test-prepare/SKILL.md +5 -1
  65. package/plugin/skills/muggle-test-prepare/steps/check-running.md +7 -5
  66. package/plugin/skills/muggle-test-prepare/steps/identify-services.md +2 -0
  67. package/plugin/skills/muggle-test-prepare/steps/readiness-report.md +30 -0
  68. package/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +44 -0
  69. package/dist/plugin/commands/mrelease.md +0 -7
  70. package/dist/plugin/skills/mrelease/SKILL.md +0 -8
  71. package/dist/plugin/skills/muggle-works-npm-release/SKILL.md +0 -200
  72. package/plugin/commands/mrelease.md +0 -7
  73. package/plugin/skills/mrelease/SKILL.md +0 -8
  74. package/plugin/skills/muggle-works-npm-release/SKILL.md +0 -200
@@ -51,6 +51,7 @@ Gates run per `preference-gates/README.md`.
51
51
  | `openTestResultsAfterRun` | 8 | Open results page on Muggle Test dashboard after run |
52
52
  | `postPRVisualWalkthrough` | 10 | Post visual walkthrough to PR after results |
53
53
  | `autoCreatePR` | 10 (if no PR) | Auto-create the PR when posting the walkthrough has no PR to target |
54
+ | `autoWatchPR` | 10.5 (if a PR exists) | Start a `muggle-pr-followup` watcher on the PR after the run |
54
55
  | `autoCleanup` | post-merge | Run cleanup after the PR for this work is merged (see [`_shared/post-merge-cleanup.md`](../_shared/post-merge-cleanup.md)) |
55
56
 
56
57
  ## Workflow
@@ -127,6 +128,12 @@ Gate `autoSelectLocalHost` per `preference-gates/README.md` + `preference-gates/
127
128
 
128
129
  Remind them: local URL is only the execution target, not tied to cloud project config.
129
130
 
131
+ ### 4a. Satisfy the test case chain (prerequisite parents)
132
+
133
+ Before deciding the target's script, resolve its prerequisite chain from the backend test-plan graph and ensure every ancestor already has a ready script — generating any that don't, **test-generation only**, root-first. Follow [`_shared/test-case-chain-readiness.md`](../_shared/test-case-chain-readiness.md).
134
+
135
+ `muggle-remote-test-case-ancestors-get` returns the chain; an `orphan` test case has no prerequisites — skip straight to Step 5. Do **not** infer parents from `precondition` text; the graph is authoritative.
136
+
130
137
  ### 5. Existing scripts vs new generation
131
138
 
132
139
  `muggle-remote-test-script-list` with `testCaseId`.
@@ -236,17 +243,30 @@ Non-blocking — one click to dismiss. Do not re-ask for the same `runId` within
236
243
 
237
244
  After reporting results:
238
245
 
239
- 1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip → end.
246
+ 1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip → 10.5.
240
247
  2. `gh pr view --json number,title,url 2>/dev/null` — find the PR.
241
- 3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip → end.
248
+ 3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip → 10.5.
242
249
  4. Assemble the `E2eReport` — see [`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md).
243
250
  5. Invoke [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A with the `E2eReport`.
244
251
 
252
+ ### 10.5. Offer to watch the PR for review follow-ups
253
+
254
+ Once a PR exists for this work, offer to keep watching its review thread.
255
+
256
+ 1. Identify the PR — reuse the `gh pr view --json number,title,url` result from section 10 if available, else run it now. No PR (none exists, none created) → end.
257
+ 2. Fire [`autoWatchPR`](../muggle-preferences/preference-gates/autoWatchPR.md) with `{pr}` = `<owner>/<repo>#<number>`. On skip → end.
258
+ 3. On proceed: start the watcher reusing this run's context so it never re-prompts —
259
+ - Seed the `muggle-pr-followup` session slot and dispatch its loop per the stage-8 seeding in [`../do/open-prs/forward.md`](../do/open-prs/forward.md) (default slug `<repo>-pr<number>`).
260
+ - Additionally write `state.md`'s `## Pre-flight answers` block from the context resolved this run — validation strategy, local URL, project, credentials, auth, working tree — per [`../_shared/resolve-e2e-validation-context.md`](../_shared/resolve-e2e-validation-context.md#persisted-fields). Strategy = `local-e2e` for this local E2E run.
261
+
262
+ The `/mprfollowup` shortcut starts the same watcher manually at any time.
263
+
245
264
  ## Non-negotiables
246
265
 
247
266
  - No silent auth skip.
248
267
  - **Never prompt for Electron launch approval** before execution — invoking this skill is the approval. Just run.
249
268
  - **Never diagnose a failed run from `execute`'s response stdout tail.** Always call `muggle-local-run-result-get` first; classify only from its structured fields and (when present) the artifacts it names. The execute tail is an excerpt and routinely truncates the failure cause.
269
+ - Satisfy the prerequisite chain (Step 4a) before generating or replaying the target. Read it from `muggle-remote-test-case-ancestors-get` — never infer parents from `precondition` text. Generate any not-ready ancestor test-generation-only, root-first.
250
270
  - If replayable scripts exist, do not default to generation without user choice.
251
271
  - No hiding failures: surface errors and artifact paths.
252
272
  - **Always offer the agent-guidance reminder after every Electron run** (Step 9b) — pass or fail — unless 9a already routed the user into `muggle-feedback`. Never silently end a run without giving the user a one-click path to flag what was wrong.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: muggle-test-prepare
3
- description: "Make sure dev servers and sibling services are ready on the user's machine before running E2E acceptance tests. Checks which services need to be running, discovers sibling directories by folder name, verifies what's already listening, and offers to start anything that's missing — with the user's approval at every step. Use this skill whenever the user needs to prepare their local environment for E2E testing, verify their services are up, get their local dev stack ready, or when other muggle skills detect that required services are not listening on common ports. Triggers on: 'prepare for testing', 'make sure my services are running', 'check my local env', 'get ready for tests', 'are my services up', 'prepare local environment', 'spin up services', 'set up for E2E', 'verify my setup'. Also use when muggle-test, muggle-do, or muggle-test-feature-local need services running."
3
+ description: "Use this skill to get a user's local environment ready before running E2E acceptance tests — verifying that the dev servers, APIs, and sibling services they need are actually up and responding, and offering to start whatever is missing (with approval at each step). Trigger whenever the user wants to confirm that specific ports or localhost URLs are listening/up before testing (e.g. 'check if localhost:3000 and the api on 8080 are listening', 'are my services up?'), make sure required services are running, spin up or prepare their local dev stack, or verify their setup — and whenever another muggle skill (muggle-test, muggle-do, muggle-test-feature-local) needs services running but they're not listening on the expected ports. This is environment readiness and service startup, not running the tests themselves."
4
4
  ---
5
5
 
6
6
  # Muggle Test Prepare
@@ -45,6 +45,8 @@ All launched processes are tracked in `/tmp/muggle-test-prepare.json`:
45
45
 
46
46
  `testing_scope` records what the user is testing (from [scope](./steps/scope.md)). `excluded_services` records services the user said can't run locally (from [viability-check](./steps/viability-check.md)).
47
47
 
48
+ This file is **ephemeral runtime state**, not the saved recipe. The durable plan lives at `<repo>/.muggle-ai/prepare-plan.json` (or the parent-dir-keyed entry in `~/.muggle-ai/prepare-plans.json`) and is consulted in [reuse-plan](./steps/reuse-plan.md) before any other stage. The two files never merge.
49
+
48
50
  **On every invocation**, check this file first. If it exists with live PIDs (verify with `kill -0`), `AskUserQuestion`:
49
51
  - Option 1: "Keep them running — skip to testing"
50
52
  - Option 2: "Tear down and start fresh"
@@ -59,6 +61,7 @@ Gates run per [`preference-gates/README.md`](../muggle-preferences/preference-ga
59
61
  | Preference | Gates |
60
62
  |------------|-------|
61
63
  | `autoRebase` | [rebase-check](./steps/rebase-check.md) — rebase onto `origin/<default>` before starting dev servers |
64
+ | `reusePreparePlan` | [reuse-plan](./steps/reuse-plan.md) — reuse the saved prepare plan for this stack, or rediscover |
62
65
 
63
66
  ## Workflow
64
67
 
@@ -66,6 +69,7 @@ Run the stages in this order. The sequence number is display-only — it lives o
66
69
 
67
70
  | # | Stage | Summary |
68
71
  |:--|:------|:--------|
72
+ | 0 | [reuse-plan](./steps/reuse-plan.md) | Reuse saved prepare plan (gated); short-circuits to check-running on reuse |
69
73
  | 1 | [rebase-check](./steps/rebase-check.md) | Rebase onto default branch (gated) |
70
74
  | 2 | [scope](./steps/scope.md) | Frontend / backend / full stack |
71
75
  | 3 | [viability-check](./steps/viability-check.md) | Exclude services that can't run locally |
@@ -6,7 +6,7 @@ Run port detection and (when an app declares a backend URL) backend-health probe
6
6
 
7
7
  If **all** required services are running, skip straight to [smoke-test](./smoke-test.md) — don't trust port-listening alone.
8
8
 
9
- If some are running, acknowledge and continue to [start-commands](./start-commands.md) only for the missing ones. For already-running services:
9
+ If some are running, acknowledge and continue to [start-commands](./start-commands.md) only for the missing ones. **Exception:** when this stage is entered via the [reuse-plan](./reuse-plan.md) short-circuit, the missing entries already have their `command` populated in `/tmp/muggle-test-prepare.json` from the reused plan — skip `start-commands` and go straight to [env-file](./env-file.md). For already-running services:
10
10
  - Option 1: "It's fine, keep it"
11
11
  - Option 2: "Restart it"
12
12
 
@@ -16,11 +16,13 @@ Mark kept services as `external: true` in the tracking file so cleanup leaves th
16
16
 
17
17
  When the user wants a port held by a process they did **not** select (typically a stale dev server from a sibling worktree):
18
18
 
19
- > "Port 3999 is held by PID 87421 (you didn't select this process). How do you want to proceed?"
19
+ The held process is likely something the user is still using — a current test or dev server they value more than this prepare run. Don't auto-decide; leave the kill-vs-pause call to them.
20
20
 
21
- - Option 1: "Use the next available port" (recommended — non-destructive)
22
- - Option 2: "Force-kill PID 87421 and claim port 3999"
23
- - Option 3: "Abort"
21
+ > "Port 3999 is held by PID 87421 (you didn't select this process — it may be a test or dev server you're still using). How do you want to proceed?"
22
+
23
+ - Option 1: "Use the next available port" (recommended — non-destructive, leaves the existing process running)
24
+ - Option 2: "Force-kill PID 87421 and claim port 3999" (kill-switch — only if you don't need that process)
25
+ - Option 3: "Pause — leave it running, I'll finish up and re-run prepare later"
24
26
 
25
27
  **Option 1**: probe `3999 + N` for `N = 1, 2, …` until nothing listens. Record the new port and any env file edit (`PORT=` in `.env.local` etc.). Dev server may need restart to pick up.
26
28
 
@@ -1,5 +1,7 @@
1
1
  # Identify required services & startup mode
2
2
 
3
+ > Skipped when [reuse-plan](./reuse-plan.md) short-circuits — a reused plan supplies the service list and startup mode.
4
+
3
5
  List folder names in the **parent directory** of the current working directory:
4
6
 
5
7
  ```bash
@@ -24,3 +24,33 @@ If you launched the services:
24
24
  Logs: /tmp/muggle-prepare-*.log
25
25
  Cleanup: say "stop services" or re-invoke this skill.
26
26
  ```
27
+
28
+ ## Save the plan
29
+
30
+ If this run came through discovery (i.e. Stage 0 [reuse-plan](./reuse-plan.md) did **not** short-circuit), persist the plan so the next run can skip the questions.
31
+
32
+ Build the JSON from the in-memory tracking file, dropping runtime fields:
33
+
34
+ ```bash
35
+ jq '{
36
+ version: 1,
37
+ updated: now | todate,
38
+ testing_scope: .testing_scope,
39
+ excluded_services: .excluded_services,
40
+ services: [.services[] | {name, dir, command, port}]
41
+ }' /tmp/muggle-test-prepare.json
42
+ ```
43
+
44
+ Resolve the write location:
45
+
46
+ - If `git rev-parse --show-toplevel` succeeds (call the result `$REPO`) → write `$REPO/.muggle-ai/prepare-plan.json`. Create `$REPO/.muggle-ai/` if missing.
47
+ - Else → upsert the entry under key `$(dirname "$PWD")` (absolute) in `~/.muggle-ai/prepare-plans.json`. Create the file as `{}` if missing.
48
+
49
+ Then print, once:
50
+
51
+ ```
52
+ ✓ Saved this stack as your prepare plan — next run can skip the questions.
53
+ (Disable with `/muggle-preferences reusePreparePlan`.)
54
+ ```
55
+
56
+ If this run short-circuited via [reuse-plan](./reuse-plan.md), don't rewrite — but **do** refresh `updated` and any `command` that was re-derived during validation. Skip the announcement on the refresh path.
@@ -0,0 +1,44 @@
1
+ # Stage 0 — reuse saved plan (or fall through)
2
+
3
+ A previously saved **prepare plan** is the durable recipe for this stack. Distinct from the ephemeral `/tmp/muggle-test-prepare.json` tracker — that file holds live PIDs/logs and is rebuilt every run.
4
+
5
+ ## Resolve
6
+
7
+ In order; first hit wins.
8
+
9
+ 1. **Project plan.** If `git rev-parse --show-toplevel` succeeds (call the result `$REPO`) and `$REPO/.muggle-ai/prepare-plan.json` exists → load it.
10
+ 2. **Global plan.** Else if `~/.muggle-ai/prepare-plans.json` exists, read the entry keyed by `$(dirname "$PWD")` (absolute path). If present → load that entry's value.
11
+ 3. **No plan found** → exit this step; the workflow continues at [rebase-check](./rebase-check.md).
12
+
13
+ A loaded plan is a JSON object with `version`, `updated`, `testing_scope`, `excluded_services`, `services`. Reject and treat as "no plan" if `version != 1` or `services` is empty.
14
+
15
+ ## Gate `reusePreparePlan`
16
+
17
+ Per [`muggle-preferences/preference-gates/README.md`](../../muggle-preferences/preference-gates/README.md). Read the current value from the `Muggle Test Preferences` session-context line; absent → `ask`.
18
+
19
+ - `always` → silently take the **reuse path** (below). Print the silent footer (substitute `{services}` with the comma-separated names from the loaded plan).
20
+ - `never` → take the **rediscover path**: exit this step; continue at [rebase-check](./rebase-check.md).
21
+ - `ask` → print the loaded plan as a table:
22
+
23
+ ```
24
+ Service Directory Command Port
25
+ ──────────────────────────────────────────────────────────────────────────────
26
+ backend-api ~/Github/backend-api npm run dev 3001
27
+ …
28
+ ──────────────────────────────────────────────────────────────────────────────
29
+ ```
30
+
31
+ Run Picker 1 from the gate file (substitute `{services}`). Then Picker 2 ("Remember this choice?") per the shared template. Branch by Picker 1.
32
+
33
+ ## Reuse path
34
+
35
+ 1. **Validate per service entry.** For each `{name, dir, command, port}`:
36
+ - `dir` exists → keep. Else drop the entry and log `"Dropped <name>: directory <dir> no longer exists"`.
37
+ - The indicator file that produced `command` still exists in `dir` (e.g. `package.json` for an `npm`/`node` command; see the indicator table in [start-commands](./start-commands.md)) → keep. Else re-derive **just that one entry** by running the indicator-detection from [start-commands](./start-commands.md) against `dir`, and replace its `command`. Log `"Re-derived <name>: <old> → <new>"`.
38
+ 2. **All entries dropped** → discard the plan; continue at [rebase-check](./rebase-check.md). Otherwise proceed with surviving + re-derived entries.
39
+ 3. **Hydrate** `/tmp/muggle-test-prepare.json` with the surviving entries (no PIDs yet, `testing_scope` from the plan, `excluded_services` from the plan).
40
+ 4. **Short-circuit** to [check-running](./check-running.md). The skipped stages are [scope](./scope.md), [viability-check](./viability-check.md), [identify-services](./identify-services.md), [start-commands](./start-commands.md) — the reused plan supplies their answers. The remaining stages run normally: [env-file](./env-file.md), [fresh-install](./fresh-install.md), [start-services](./start-services.md) (only for entries not already listening), [smoke-test](./smoke-test.md), [readiness-report](./readiness-report.md).
41
+
42
+ ## Rediscover path
43
+
44
+ Continue at [rebase-check](./rebase-check.md). The full normal flow runs.
@@ -1,7 +0,0 @@
1
- ---
2
- description: Cut a @muggleai/works npm release (alias for /muggle-works-npm-release)
3
- argument-hint: [major|minor|patch]
4
- allowed-tools: [Skill]
5
- ---
6
-
7
- Invoke the `muggle-works-npm-release` skill via the Skill tool. Forward `$ARGUMENTS` as the skill's `args`.
@@ -1,8 +0,0 @@
1
- ---
2
- name: mrelease
3
- description: Explicit short alias for the `muggle-works-npm-release` skill. ONLY invoke when the user explicitly types `mrelease` or `/mrelease` — never auto-trigger from any other phrasing.
4
- ---
5
-
6
- # mrelease — alias for muggle-works-npm-release
7
-
8
- Invoke the `muggle-works-npm-release` skill via the Skill tool. Forward any user-provided arguments unchanged.
@@ -1,200 +0,0 @@
1
- ---
2
- name: muggle-works-npm-release
3
- description: >-
4
- Cut @muggleai/works release: AskUserQuestion (major/minor/patch), sync master, stop if
5
- nothing ships, semver baseline + Electron from GitHub, confirm plan, bump
6
- package.json + sync:versions, full local verify, chore(release) PR, merge via gh,
7
- dispatch publish-works-to-npm.yml—no local npm publish.
8
- ---
9
-
10
- # Muggle Test Works — npm release (single playbook)
11
-
12
- > Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-works-npm-release"`.
13
-
14
- Repo: **`multiplex-ai/muggle-ai-works`**. Workflow: **`.github/workflows/publish-works-to-npm.yml`** (“Publish Works to npm”). **Never** run local **`npm publish`** (OIDC trusted publishing in CI).
15
-
16
- ---
17
-
18
- ## Phase 1 — Ask bump type (do this first)
19
-
20
- **Stop until the user answers.**
21
-
22
- **Prefer `AskUserQuestion`** with exactly these three options: **major**, **minor**, **patch** (fix). If the environment has no structured question tool, ask the same in plain text:
23
-
24
- > Is this release a **major**, **minor**, or **patch** (fix)?
25
-
26
- You may **recommend** a bump from commit subjects (e.g. `feat!` / breaking → major, `feat` → minor, `fix` / `chore` → patch) but **do not** choose for them. **Do not** edit files yet.
27
-
28
- ---
29
-
30
- ## Phase 2 — Sync, surface state, empty-release gate
31
-
32
- Run from **`muggle-ai-works`**:
33
-
34
- ```bash
35
- git checkout master && git pull --ff-only && git fetch --tags
36
- ```
37
-
38
- Show what is shipping:
39
-
40
- ```bash
41
- node -e 'console.log("master package.json:", require("./package.json").version)'
42
- npm view @muggleai/works version 2>&1 | sed 's/^/npm latest: /'
43
- ```
44
-
45
- **Commits since the last release commit** (stop if there is nothing to ship):
46
-
47
- ```bash
48
- LAST_RELEASE_SHA=$(git log --grep='chore(release)' --format='%H' -1)
49
- git log --oneline "$LAST_RELEASE_SHA..HEAD"
50
- ```
51
-
52
- - If the log is **empty**, tell the user there is **nothing to ship** and **stop** (no branch, no bump, no PR).
53
- - If non-empty, present commits as a short table (subject; PR number from title/body if present).
54
-
55
- ---
56
-
57
- ## Phase 3 — Version baseline, Electron, print summary, confirm
58
-
59
- ### npm version (`nextNpmVersion`)
60
-
61
- 1. **`npm view @muggleai/works version`** — last published on npm.
62
- 2. Root **`package.json` → `version`** on current **`master`** checkout.
63
- 3. **Baseline** = **semver-higher** of those two (never target below repo or npm).
64
- 4. Apply the user’s **major / minor / patch** to that baseline → **`nextNpmVersion`** (semver-correct).
65
-
66
- ### Electron (`muggleConfig`)
67
-
68
- 1. Read **`package.json` → `muggleConfig.electronAppVersion`**.
69
- 2. **Latest desktop on GitHub:**
70
- `https://api.github.com/repos/multiplex-ai/muggle-ai-works/releases?per_page=30`
71
- → newest **`tag_name`** matching **`electron-app-v*`** → strip prefix → **`latestElectronVersion`** (semver only).
72
-
73
- ### Print (always)
74
-
75
- | Item | Value |
76
- | :--- | :---- |
77
- | Last **@muggleai/works** on npm | … |
78
- | **Baseline** for bump | … |
79
- | **`nextNpmVersion`** (to publish) | … |
80
- | Current **`electronAppVersion`** | … |
81
- | Latest **`electron-app-v…`** on GitHub | … |
82
-
83
- ### Electron bump decision
84
-
85
- If **`latestElectronVersion`** ≠ current **`electronAppVersion`**, ask: **bump** Electron + all four **`muggleConfig.checksums`** to **`latestElectronVersion`**, or **keep** current.
86
-
87
- If bumping, checksums from:
88
-
89
- `https://github.com/multiplex-ai/muggle-ai-works/releases/download/electron-app-vVERSION/checksums.txt`
90
-
91
- Map zip artifacts → **`darwin-arm64`**, **`darwin-x64`**, **`win32-x64`**, **`linux-x64`** (same mapping rules as today).
92
-
93
- **Stop again:** user must **confirm** the full plan (**`nextNpmVersion`** + Electron choice). If they cancel, **do not** branch, merge, or dispatch CI.
94
-
95
- ---
96
-
97
- ## Phase 4 — After explicit confirmation only
98
-
99
- ### 1. Branch and bump
100
-
101
- ```bash
102
- git checkout -b "chore/release-<VERSION>"
103
- npm version "<VERSION>" --no-git-tag-version
104
- ```
105
-
106
- Replace **`<VERSION>`** with **`nextNpmVersion`** (dots in the branch name are fine, e.g. `chore/release-4.8.0`).
107
-
108
- - If Electron bump agreed: set **`muggleConfig.electronAppVersion`** and all four **`muggleConfig.checksums`** in **`package.json`**.
109
-
110
- ### 2. Propagate versions (do not hand-edit manifests)
111
-
112
- ```bash
113
- pnpm run sync:versions
114
- ```
115
-
116
- Never hand-edit **`.claude-plugin/marketplace.json`**, **`.cursor-plugin/marketplace.json`**, **`plugin/.claude-plugin/plugin.json`**, **`plugin/.cursor-plugin/plugin.json`**, or **`server.json`** — **`sync-versions`** (and **`build`**) owns them.
117
-
118
- If you changed Electron after the first sync, run **`pnpm run sync:versions`** again.
119
-
120
- ### 3. Full local verify (before push)
121
-
122
- ```bash
123
- pnpm run lint:check && pnpm run typecheck && pnpm test && pnpm run build && pnpm run verify:plugin && pnpm run verify:contracts && pnpm run verify:electron-release-checksums
124
- ```
125
-
126
- - **`pnpm run build`** is required before **`verify:plugin`** — the verifier reads the **built** plugin under **`dist/plugin/`**, not source under **`plugin/`**.
127
- - If **anything** fails, **stop** and surface the error; **do not** push a broken release.
128
-
129
- ### 4. Commit (**`chore(release)`**)
130
-
131
- Stage version-touched files (at minimum **`package.json`** plus whatever **`sync:versions`** changed — typically the marketplace/plugin **`server.json`** paths above).
132
-
133
- **Subject:** `chore(release): @muggleai/works <VERSION>`
134
-
135
- **Body:** one bullet per shipping PR / theme, note **Electron** bump or unchanged, and any coordinated follow-ups in sibling repos (e.g. teaching-service, UI). Use a **heredoc** for `git commit` so newlines are preserved.
136
-
137
- ### 5. PR, merge, update local **`master`**
138
-
139
- ```bash
140
- git push -u origin HEAD
141
- gh pr create --repo multiplex-ai/muggle-ai-works --base master --head <branch> \
142
- --title "chore(release): @muggleai/works <VERSION>" \
143
- --body "<PR body: version delta, bump rationale, shipping list, Electron status, manifests touched by sync:versions, short test plan checklist>"
144
- ```
145
-
146
- **Merge:** when the human has approved the release in this session, run **`gh pr merge`** (squash is fine unless the repo prefers merge commits), then:
147
-
148
- ```bash
149
- git checkout master && git pull --ff-only
150
- node -e 'console.log("master now:", require("./package.json").version)'
151
- ```
152
-
153
- Confirm **`package.json`** on **`master`** matches **`nextNpmVersion`** before publishing.
154
-
155
- ---
156
-
157
- ## Phase 5 — Trigger publish (CI only)
158
-
159
- Prefer **explicit version** (not “auto bump”):
160
-
161
- ```bash
162
- gh workflow run publish-works-to-npm.yml --repo multiplex-ai/muggle-ai-works --ref master \
163
- --field "version=<VERSION>" --field "bump=patch"
164
- ```
165
-
166
- The `bump=patch` field is a harmless placeholder when `version` is set; the workflow prefers the explicit `version` input.
167
-
168
- **Or** **`git tag "v<VERSION>"`** && **`git push origin "v<VERSION>"`** only if that tag **does not** already exist on the remote; if the tag exists, use **`workflow_dispatch`** with **`version`**.
169
-
170
- Watch the run and confirm jobs succeed:
171
-
172
- ```bash
173
- gh run list --repo multiplex-ai/muggle-ai-works --workflow=publish-works-to-npm.yml --limit 1
174
- gh run watch <RUN_ID> --repo multiplex-ai/muggle-ai-works --exit-status
175
- ```
176
-
177
- Verify the registry:
178
-
179
- ```bash
180
- npm view @muggleai/works version
181
- ```
182
-
183
- Give the user the **Actions run URL**. If npm lags, wait ~60s and retry.
184
-
185
- ---
186
-
187
- ## Rules
188
-
189
- - **No local `npm publish`.**
190
- - **Phase 1:** use **`AskUserQuestion`** for major / minor / patch when available (see Phase 1).
191
- - Phases 1–3: keep chat concise; Phase 4–5 can be terse status lines.
192
- - If the user cancels after Phase 3, **do not** merge or dispatch CI.
193
- - **Tag vs npm:** **`v*`** tags are for the **npm** package; **`electron-app-v*`** is separate — **`electronAppVersion`** can move independently of **`version`**.
194
-
195
- ---
196
-
197
- ## Notes (troubleshooting)
198
-
199
- - Workflow **`name:`** / filename is tied to npm **Trusted Publishing** — see the comment block at the top of **`publish-works-to-npm.yml`** if auth fails.
200
- - If commits land on **`master`** between opening the PR and merging, re-check **`git log`** vs the last **`chore(release)`** before merging; rebasing the release branch may be needed so **`master`** still matches what you intend to ship.
@@ -1,7 +0,0 @@
1
- ---
2
- description: Cut a @muggleai/works npm release (alias for /muggle-works-npm-release)
3
- argument-hint: [major|minor|patch]
4
- allowed-tools: [Skill]
5
- ---
6
-
7
- Invoke the `muggle-works-npm-release` skill via the Skill tool. Forward `$ARGUMENTS` as the skill's `args`.
@@ -1,8 +0,0 @@
1
- ---
2
- name: mrelease
3
- description: Explicit short alias for the `muggle-works-npm-release` skill. ONLY invoke when the user explicitly types `mrelease` or `/mrelease` — never auto-trigger from any other phrasing.
4
- ---
5
-
6
- # mrelease — alias for muggle-works-npm-release
7
-
8
- Invoke the `muggle-works-npm-release` skill via the Skill tool. Forward any user-provided arguments unchanged.
@@ -1,200 +0,0 @@
1
- ---
2
- name: muggle-works-npm-release
3
- description: >-
4
- Cut @muggleai/works release: AskUserQuestion (major/minor/patch), sync master, stop if
5
- nothing ships, semver baseline + Electron from GitHub, confirm plan, bump
6
- package.json + sync:versions, full local verify, chore(release) PR, merge via gh,
7
- dispatch publish-works-to-npm.yml—no local npm publish.
8
- ---
9
-
10
- # Muggle Test Works — npm release (single playbook)
11
-
12
- > Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-works-npm-release"`.
13
-
14
- Repo: **`multiplex-ai/muggle-ai-works`**. Workflow: **`.github/workflows/publish-works-to-npm.yml`** (“Publish Works to npm”). **Never** run local **`npm publish`** (OIDC trusted publishing in CI).
15
-
16
- ---
17
-
18
- ## Phase 1 — Ask bump type (do this first)
19
-
20
- **Stop until the user answers.**
21
-
22
- **Prefer `AskUserQuestion`** with exactly these three options: **major**, **minor**, **patch** (fix). If the environment has no structured question tool, ask the same in plain text:
23
-
24
- > Is this release a **major**, **minor**, or **patch** (fix)?
25
-
26
- You may **recommend** a bump from commit subjects (e.g. `feat!` / breaking → major, `feat` → minor, `fix` / `chore` → patch) but **do not** choose for them. **Do not** edit files yet.
27
-
28
- ---
29
-
30
- ## Phase 2 — Sync, surface state, empty-release gate
31
-
32
- Run from **`muggle-ai-works`**:
33
-
34
- ```bash
35
- git checkout master && git pull --ff-only && git fetch --tags
36
- ```
37
-
38
- Show what is shipping:
39
-
40
- ```bash
41
- node -e 'console.log("master package.json:", require("./package.json").version)'
42
- npm view @muggleai/works version 2>&1 | sed 's/^/npm latest: /'
43
- ```
44
-
45
- **Commits since the last release commit** (stop if there is nothing to ship):
46
-
47
- ```bash
48
- LAST_RELEASE_SHA=$(git log --grep='chore(release)' --format='%H' -1)
49
- git log --oneline "$LAST_RELEASE_SHA..HEAD"
50
- ```
51
-
52
- - If the log is **empty**, tell the user there is **nothing to ship** and **stop** (no branch, no bump, no PR).
53
- - If non-empty, present commits as a short table (subject; PR number from title/body if present).
54
-
55
- ---
56
-
57
- ## Phase 3 — Version baseline, Electron, print summary, confirm
58
-
59
- ### npm version (`nextNpmVersion`)
60
-
61
- 1. **`npm view @muggleai/works version`** — last published on npm.
62
- 2. Root **`package.json` → `version`** on current **`master`** checkout.
63
- 3. **Baseline** = **semver-higher** of those two (never target below repo or npm).
64
- 4. Apply the user’s **major / minor / patch** to that baseline → **`nextNpmVersion`** (semver-correct).
65
-
66
- ### Electron (`muggleConfig`)
67
-
68
- 1. Read **`package.json` → `muggleConfig.electronAppVersion`**.
69
- 2. **Latest desktop on GitHub:**
70
- `https://api.github.com/repos/multiplex-ai/muggle-ai-works/releases?per_page=30`
71
- → newest **`tag_name`** matching **`electron-app-v*`** → strip prefix → **`latestElectronVersion`** (semver only).
72
-
73
- ### Print (always)
74
-
75
- | Item | Value |
76
- | :--- | :---- |
77
- | Last **@muggleai/works** on npm | … |
78
- | **Baseline** for bump | … |
79
- | **`nextNpmVersion`** (to publish) | … |
80
- | Current **`electronAppVersion`** | … |
81
- | Latest **`electron-app-v…`** on GitHub | … |
82
-
83
- ### Electron bump decision
84
-
85
- If **`latestElectronVersion`** ≠ current **`electronAppVersion`**, ask: **bump** Electron + all four **`muggleConfig.checksums`** to **`latestElectronVersion`**, or **keep** current.
86
-
87
- If bumping, checksums from:
88
-
89
- `https://github.com/multiplex-ai/muggle-ai-works/releases/download/electron-app-vVERSION/checksums.txt`
90
-
91
- Map zip artifacts → **`darwin-arm64`**, **`darwin-x64`**, **`win32-x64`**, **`linux-x64`** (same mapping rules as today).
92
-
93
- **Stop again:** user must **confirm** the full plan (**`nextNpmVersion`** + Electron choice). If they cancel, **do not** branch, merge, or dispatch CI.
94
-
95
- ---
96
-
97
- ## Phase 4 — After explicit confirmation only
98
-
99
- ### 1. Branch and bump
100
-
101
- ```bash
102
- git checkout -b "chore/release-<VERSION>"
103
- npm version "<VERSION>" --no-git-tag-version
104
- ```
105
-
106
- Replace **`<VERSION>`** with **`nextNpmVersion`** (dots in the branch name are fine, e.g. `chore/release-4.8.0`).
107
-
108
- - If Electron bump agreed: set **`muggleConfig.electronAppVersion`** and all four **`muggleConfig.checksums`** in **`package.json`**.
109
-
110
- ### 2. Propagate versions (do not hand-edit manifests)
111
-
112
- ```bash
113
- pnpm run sync:versions
114
- ```
115
-
116
- Never hand-edit **`.claude-plugin/marketplace.json`**, **`.cursor-plugin/marketplace.json`**, **`plugin/.claude-plugin/plugin.json`**, **`plugin/.cursor-plugin/plugin.json`**, or **`server.json`** — **`sync-versions`** (and **`build`**) owns them.
117
-
118
- If you changed Electron after the first sync, run **`pnpm run sync:versions`** again.
119
-
120
- ### 3. Full local verify (before push)
121
-
122
- ```bash
123
- pnpm run lint:check && pnpm run typecheck && pnpm test && pnpm run build && pnpm run verify:plugin && pnpm run verify:contracts && pnpm run verify:electron-release-checksums
124
- ```
125
-
126
- - **`pnpm run build`** is required before **`verify:plugin`** — the verifier reads the **built** plugin under **`dist/plugin/`**, not source under **`plugin/`**.
127
- - If **anything** fails, **stop** and surface the error; **do not** push a broken release.
128
-
129
- ### 4. Commit (**`chore(release)`**)
130
-
131
- Stage version-touched files (at minimum **`package.json`** plus whatever **`sync:versions`** changed — typically the marketplace/plugin **`server.json`** paths above).
132
-
133
- **Subject:** `chore(release): @muggleai/works <VERSION>`
134
-
135
- **Body:** one bullet per shipping PR / theme, note **Electron** bump or unchanged, and any coordinated follow-ups in sibling repos (e.g. teaching-service, UI). Use a **heredoc** for `git commit` so newlines are preserved.
136
-
137
- ### 5. PR, merge, update local **`master`**
138
-
139
- ```bash
140
- git push -u origin HEAD
141
- gh pr create --repo multiplex-ai/muggle-ai-works --base master --head <branch> \
142
- --title "chore(release): @muggleai/works <VERSION>" \
143
- --body "<PR body: version delta, bump rationale, shipping list, Electron status, manifests touched by sync:versions, short test plan checklist>"
144
- ```
145
-
146
- **Merge:** when the human has approved the release in this session, run **`gh pr merge`** (squash is fine unless the repo prefers merge commits), then:
147
-
148
- ```bash
149
- git checkout master && git pull --ff-only
150
- node -e 'console.log("master now:", require("./package.json").version)'
151
- ```
152
-
153
- Confirm **`package.json`** on **`master`** matches **`nextNpmVersion`** before publishing.
154
-
155
- ---
156
-
157
- ## Phase 5 — Trigger publish (CI only)
158
-
159
- Prefer **explicit version** (not “auto bump”):
160
-
161
- ```bash
162
- gh workflow run publish-works-to-npm.yml --repo multiplex-ai/muggle-ai-works --ref master \
163
- --field "version=<VERSION>" --field "bump=patch"
164
- ```
165
-
166
- The `bump=patch` field is a harmless placeholder when `version` is set; the workflow prefers the explicit `version` input.
167
-
168
- **Or** **`git tag "v<VERSION>"`** && **`git push origin "v<VERSION>"`** only if that tag **does not** already exist on the remote; if the tag exists, use **`workflow_dispatch`** with **`version`**.
169
-
170
- Watch the run and confirm jobs succeed:
171
-
172
- ```bash
173
- gh run list --repo multiplex-ai/muggle-ai-works --workflow=publish-works-to-npm.yml --limit 1
174
- gh run watch <RUN_ID> --repo multiplex-ai/muggle-ai-works --exit-status
175
- ```
176
-
177
- Verify the registry:
178
-
179
- ```bash
180
- npm view @muggleai/works version
181
- ```
182
-
183
- Give the user the **Actions run URL**. If npm lags, wait ~60s and retry.
184
-
185
- ---
186
-
187
- ## Rules
188
-
189
- - **No local `npm publish`.**
190
- - **Phase 1:** use **`AskUserQuestion`** for major / minor / patch when available (see Phase 1).
191
- - Phases 1–3: keep chat concise; Phase 4–5 can be terse status lines.
192
- - If the user cancels after Phase 3, **do not** merge or dispatch CI.
193
- - **Tag vs npm:** **`v*`** tags are for the **npm** package; **`electron-app-v*`** is separate — **`electronAppVersion`** can move independently of **`version`**.
194
-
195
- ---
196
-
197
- ## Notes (troubleshooting)
198
-
199
- - Workflow **`name:`** / filename is tied to npm **Trusted Publishing** — see the comment block at the top of **`publish-works-to-npm.yml`** if auth fails.
200
- - If commits land on **`master`** between opening the PR and merging, re-check **`git log`** vs the last **`chore(release)`** before merging; rebasing the release branch may be needed so **`master`** still matches what you intend to ship.