@muggleai/works 4.10.0 → 4.10.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.
- package/README.md +3 -3
- package/dist/{chunk-RK6XKSZK.js → chunk-Q7WNEMN4.js} +109 -43
- package/dist/{chunk-UVXOHXY2.js → chunk-ZKRHFTIC.js} +832 -89
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/README.md +4 -2
- package/dist/plugin/agents/acceptance-tester.md +24 -10
- package/dist/plugin/commands/m.md +7 -0
- package/dist/plugin/commands/mdo.md +7 -0
- package/dist/plugin/commands/mfeedback.md +7 -0
- package/dist/plugin/commands/mimport.md +7 -0
- package/dist/plugin/commands/mpr.md +7 -0
- package/dist/plugin/commands/mprefs.md +7 -0
- package/dist/plugin/commands/mregen.md +7 -0
- package/dist/plugin/commands/mrelease.md +7 -0
- package/dist/plugin/commands/mrepair.md +7 -0
- package/dist/plugin/commands/mstatus.md +7 -0
- package/dist/plugin/commands/mtest.md +7 -0
- package/dist/plugin/commands/mtestlocal.md +7 -0
- package/dist/plugin/commands/mtestprep.md +7 -0
- package/dist/plugin/commands/mupgrade.md +7 -0
- package/dist/plugin/scripts/ensure-electron-app.sh +35 -8
- package/dist/plugin/skills/_aliases.json +18 -0
- package/dist/plugin/skills/_shared/dev-server-readiness.md +231 -0
- package/dist/plugin/skills/_shared/failure-mode-handling.md +244 -0
- package/dist/plugin/skills/_shared/post-merge-cleanup.md +10 -0
- package/dist/plugin/skills/_shared/rebase-before-e2e.md +15 -0
- package/dist/plugin/skills/_shared/telemetry-emit.md +15 -0
- package/dist/plugin/skills/_shared/use-worktrees.md +53 -0
- package/dist/plugin/skills/do/e2e-acceptance.md +63 -18
- package/dist/plugin/skills/do/impact-analysis.md +45 -5
- package/dist/plugin/skills/do/open-prs.md +13 -4
- package/dist/plugin/skills/do/pr-followup.md +225 -0
- package/dist/plugin/skills/do/pre-flight.md +18 -11
- package/dist/plugin/skills/m/SKILL.md +8 -0
- package/dist/plugin/skills/mdo/SKILL.md +8 -0
- package/dist/plugin/skills/mfeedback/SKILL.md +8 -0
- package/dist/plugin/skills/mimport/SKILL.md +8 -0
- package/dist/plugin/skills/mpr/SKILL.md +8 -0
- package/dist/plugin/skills/mprefs/SKILL.md +8 -0
- package/dist/plugin/skills/mregen/SKILL.md +8 -0
- package/dist/plugin/skills/mrelease/SKILL.md +8 -0
- package/dist/plugin/skills/mrepair/SKILL.md +8 -0
- package/dist/plugin/skills/mstatus/SKILL.md +8 -0
- package/dist/plugin/skills/mtest/SKILL.md +8 -0
- package/dist/plugin/skills/mtestlocal/SKILL.md +8 -0
- package/dist/plugin/skills/mtestprep/SKILL.md +8 -0
- package/dist/plugin/skills/muggle/SKILL.md +9 -6
- package/dist/plugin/skills/muggle-do/SKILL.md +22 -4
- package/dist/plugin/skills/muggle-do-pr-followup/SKILL.md +37 -0
- package/dist/plugin/skills/muggle-do-task/SKILL.md +134 -0
- package/dist/plugin/skills/muggle-feedback/SKILL.md +38 -0
- package/dist/plugin/skills/muggle-feedback/ops/delete.md +49 -0
- package/dist/plugin/skills/muggle-feedback/ops/list.md +65 -0
- package/dist/plugin/skills/muggle-feedback/ops/submit.md +117 -0
- package/dist/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +68 -43
- package/dist/plugin/skills/muggle-pr-visual-walkthrough/e2e-report-assembly.md +86 -0
- package/dist/plugin/skills/muggle-preferences/SKILL.md +16 -108
- package/dist/plugin/skills/muggle-preferences/ops/change-one.md +10 -0
- package/dist/plugin/skills/muggle-preferences/ops/configure.md +49 -0
- package/dist/plugin/skills/muggle-preferences/ops/list.md +9 -0
- package/dist/plugin/skills/muggle-preferences/ops/reset.md +6 -0
- package/dist/plugin/skills/muggle-preferences/ops/set.md +10 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/README.md +1 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoCleanup.md +11 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoCreatePR.md +13 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoDetectChanges.md +3 -3
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoE2ETest.md +11 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoLogin.md +1 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoPublishLocalResults.md +2 -2
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoRebase.md +11 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoSelectLocalHost.md +19 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoSelectProject.md +1 -2
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoUseWorktree.md +11 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/checkForUpdates.md +4 -4
- package/dist/plugin/skills/muggle-preferences/preference-gates/defaultExecutionMode.md +1 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/openTestResultsAfterRun.md +1 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/postPRVisualWalkthrough.md +8 -25
- package/dist/plugin/skills/muggle-preferences/preference-gates/showElectronBrowser.md +1 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/suggestRelatedTestCases.md +4 -4
- package/dist/plugin/skills/muggle-preferences/preference-gates/suggestRelatedUseCases.md +4 -4
- package/dist/plugin/skills/muggle-repair/SKILL.md +4 -2
- package/dist/plugin/skills/muggle-status/SKILL.md +8 -5
- package/dist/plugin/skills/muggle-test/SKILL.md +110 -86
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +73 -66
- package/dist/plugin/skills/muggle-test-import/SKILL.md +28 -23
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +79 -18
- package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +34 -18
- package/dist/plugin/skills/muggle-test-regenerate-missing/evals/evals.json +9 -9
- package/dist/plugin/skills/muggle-upgrade/SKILL.md +4 -2
- package/dist/plugin/skills/muggle-works-npm-release/SKILL.md +6 -4
- package/dist/plugin/skills/mupgrade/SKILL.md +8 -0
- package/dist/release-manifest.json +4 -4
- package/dist/{src-GD3YFCCW.js → src-2G7ENRGI.js} +1 -1
- package/package.json +9 -7
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/README.md +4 -2
- package/plugin/agents/acceptance-tester.md +24 -10
- package/plugin/commands/m.md +7 -0
- package/plugin/commands/mdo.md +7 -0
- package/plugin/commands/mfeedback.md +7 -0
- package/plugin/commands/mimport.md +7 -0
- package/plugin/commands/mpr.md +7 -0
- package/plugin/commands/mprefs.md +7 -0
- package/plugin/commands/mregen.md +7 -0
- package/plugin/commands/mrelease.md +7 -0
- package/plugin/commands/mrepair.md +7 -0
- package/plugin/commands/mstatus.md +7 -0
- package/plugin/commands/mtest.md +7 -0
- package/plugin/commands/mtestlocal.md +7 -0
- package/plugin/commands/mtestprep.md +7 -0
- package/plugin/commands/mupgrade.md +7 -0
- package/plugin/scripts/ensure-electron-app.sh +35 -8
- package/plugin/skills/_aliases.json +18 -0
- package/plugin/skills/_shared/dev-server-readiness.md +231 -0
- package/plugin/skills/_shared/failure-mode-handling.md +244 -0
- package/plugin/skills/_shared/post-merge-cleanup.md +10 -0
- package/plugin/skills/_shared/rebase-before-e2e.md +15 -0
- package/plugin/skills/_shared/telemetry-emit.md +15 -0
- package/plugin/skills/_shared/use-worktrees.md +53 -0
- package/plugin/skills/do/e2e-acceptance.md +63 -18
- package/plugin/skills/do/impact-analysis.md +45 -5
- package/plugin/skills/do/open-prs.md +13 -4
- package/plugin/skills/do/pr-followup.md +225 -0
- package/plugin/skills/do/pre-flight.md +18 -11
- package/plugin/skills/m/SKILL.md +8 -0
- package/plugin/skills/mdo/SKILL.md +8 -0
- package/plugin/skills/mfeedback/SKILL.md +8 -0
- package/plugin/skills/mimport/SKILL.md +8 -0
- package/plugin/skills/mpr/SKILL.md +8 -0
- package/plugin/skills/mprefs/SKILL.md +8 -0
- package/plugin/skills/mregen/SKILL.md +8 -0
- package/plugin/skills/mrelease/SKILL.md +8 -0
- package/plugin/skills/mrepair/SKILL.md +8 -0
- package/plugin/skills/mstatus/SKILL.md +8 -0
- package/plugin/skills/mtest/SKILL.md +8 -0
- package/plugin/skills/mtestlocal/SKILL.md +8 -0
- package/plugin/skills/mtestprep/SKILL.md +8 -0
- package/plugin/skills/muggle/SKILL.md +9 -6
- package/plugin/skills/muggle-do/SKILL.md +22 -4
- package/plugin/skills/muggle-do-pr-followup/SKILL.md +37 -0
- package/plugin/skills/muggle-do-task/SKILL.md +134 -0
- package/plugin/skills/muggle-feedback/SKILL.md +38 -0
- package/plugin/skills/muggle-feedback/ops/delete.md +49 -0
- package/plugin/skills/muggle-feedback/ops/list.md +65 -0
- package/plugin/skills/muggle-feedback/ops/submit.md +117 -0
- package/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +68 -43
- package/plugin/skills/muggle-pr-visual-walkthrough/e2e-report-assembly.md +86 -0
- package/plugin/skills/muggle-preferences/SKILL.md +16 -108
- package/plugin/skills/muggle-preferences/ops/change-one.md +10 -0
- package/plugin/skills/muggle-preferences/ops/configure.md +49 -0
- package/plugin/skills/muggle-preferences/ops/list.md +9 -0
- package/plugin/skills/muggle-preferences/ops/reset.md +6 -0
- package/plugin/skills/muggle-preferences/ops/set.md +10 -0
- package/plugin/skills/muggle-preferences/preference-gates/README.md +1 -1
- package/plugin/skills/muggle-preferences/preference-gates/autoCleanup.md +11 -0
- package/plugin/skills/muggle-preferences/preference-gates/autoCreatePR.md +13 -0
- package/plugin/skills/muggle-preferences/preference-gates/autoDetectChanges.md +3 -3
- package/plugin/skills/muggle-preferences/preference-gates/autoE2ETest.md +11 -0
- package/plugin/skills/muggle-preferences/preference-gates/autoLogin.md +1 -1
- package/plugin/skills/muggle-preferences/preference-gates/autoPublishLocalResults.md +2 -2
- package/plugin/skills/muggle-preferences/preference-gates/autoRebase.md +11 -0
- package/plugin/skills/muggle-preferences/preference-gates/autoSelectLocalHost.md +19 -0
- package/plugin/skills/muggle-preferences/preference-gates/autoSelectProject.md +1 -2
- package/plugin/skills/muggle-preferences/preference-gates/autoUseWorktree.md +11 -0
- package/plugin/skills/muggle-preferences/preference-gates/checkForUpdates.md +4 -4
- package/plugin/skills/muggle-preferences/preference-gates/defaultExecutionMode.md +1 -1
- package/plugin/skills/muggle-preferences/preference-gates/openTestResultsAfterRun.md +1 -1
- package/plugin/skills/muggle-preferences/preference-gates/postPRVisualWalkthrough.md +8 -25
- package/plugin/skills/muggle-preferences/preference-gates/showElectronBrowser.md +1 -1
- package/plugin/skills/muggle-preferences/preference-gates/suggestRelatedTestCases.md +4 -4
- package/plugin/skills/muggle-preferences/preference-gates/suggestRelatedUseCases.md +4 -4
- package/plugin/skills/muggle-repair/SKILL.md +4 -2
- package/plugin/skills/muggle-status/SKILL.md +8 -5
- package/plugin/skills/muggle-test/SKILL.md +110 -86
- package/plugin/skills/muggle-test-feature-local/SKILL.md +73 -66
- package/plugin/skills/muggle-test-import/SKILL.md +28 -23
- package/plugin/skills/muggle-test-prepare/SKILL.md +79 -18
- package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +34 -18
- package/plugin/skills/muggle-test-regenerate-missing/evals/evals.json +9 -9
- package/plugin/skills/muggle-upgrade/SKILL.md +4 -2
- package/plugin/skills/muggle-works-npm-release/SKILL.md +6 -4
- package/plugin/skills/mupgrade/SKILL.md +8 -0
- package/scripts/postinstall.mjs +11 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-pr-visual-walkthrough
|
|
3
|
-
description: Renders and posts a visual walkthrough of Muggle AI E2E acceptance test results to a PR — per-test-case dashboard links, step-by-step screenshots, and pass/fail summary — using the `muggle build-pr-section` CLI for deterministic formatting with automatic fit-vs-overflow. Use at the end of any Muggle test run (local or remote) to give PR reviewers clickable visual evidence that user flows work. Triggers on 'post results to PR', 'attach walkthrough to PR', 'share E2E screenshots on the PR', 'add visual walkthrough to PR'.
|
|
3
|
+
description: Renders and posts a visual walkthrough of Muggle AI E2E acceptance test results to a PR — per-test-case dashboard links, step-by-step screenshots, and pass/fail summary — using the `muggle build-pr-section` CLI for deterministic formatting with automatic fit-vs-overflow. Use at the end of any Muggle Test test run (local or remote) to give PR reviewers clickable visual evidence that user flows work. Triggers on 'post results to PR', 'attach walkthrough to PR', 'share E2E screenshots on the PR', 'add visual walkthrough to PR'.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Muggle PR Visual Walkthrough
|
|
6
|
+
# Muggle Test PR Visual Walkthrough
|
|
7
|
+
|
|
8
|
+
> Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-pr-visual-walkthrough"`.
|
|
7
9
|
|
|
8
10
|
Renders a visual walkthrough of Muggle AI E2E acceptance test results and posts it to a PR. Each test case is linked to its detail page on the Muggle AI dashboard, so PR reviewers can click through to see step-by-step screenshots and action scripts — not just a pass/fail flag.
|
|
9
11
|
|
|
10
|
-
This is the **canonical PR-walkthrough workflow** shared across every Muggle entry point:
|
|
12
|
+
This is the **canonical PR-walkthrough workflow** shared across every Muggle Test entry point:
|
|
11
13
|
|
|
12
14
|
| Caller | Mode | When to invoke |
|
|
13
15
|
| :--- | :--- | :--- |
|
|
14
|
-
| `muggle-test` | **Mode A** (post to existing PR) | After publishing results, user opts in via `
|
|
15
|
-
| `muggle-test-feature-local` | **Mode A** (post to existing PR) | After publishing the run, user opts in via `
|
|
16
|
+
| `muggle-test` | **Mode A** (post to existing PR) | After publishing results, user opts in via `AskUserQuestion` |
|
|
17
|
+
| `muggle-test-feature-local` | **Mode A** (post to existing PR) | After publishing the run, user opts in via `AskUserQuestion` |
|
|
16
18
|
| `muggle-do` / `open-prs.md` | **Mode B** (render-only for embedding) | During PR creation — caller embeds `body` in `gh pr create` and posts `comment` as follow-up |
|
|
19
|
+
| `muggle-test` Mode C / `acceptance-tester` agent | **Mode C** (embed in verdict comment) | Inside a open-PR sweep orchestrator — caller folds the rendered body into a single per-PR verdict comment instead of posting separately |
|
|
17
20
|
|
|
18
21
|
Rendering is always done by `muggle build-pr-section`, a battle-tested CLI that handles deterministic markdown layout, per-step screenshots, and automatic fit-vs-overflow (oversized content spills into a follow-up comment). Never hand-write the walkthrough markdown.
|
|
19
22
|
|
|
@@ -64,42 +67,48 @@ Every caller must build an `E2eReport` JSON object and have it in conversation c
|
|
|
64
67
|
"failureStepIndex": 2,
|
|
65
68
|
"error": "Element not found: Click checkout button",
|
|
66
69
|
"artifactsDir": "/Users/.../~/.muggle-ai/sessions/<runId>"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "Clear search input restores full list",
|
|
73
|
+
"description": "Verify clearing the search input restores all options.",
|
|
74
|
+
"useCaseName": "Filter Dropdowns",
|
|
75
|
+
"testCaseId": "<UUID>",
|
|
76
|
+
"runId": "<UUID>",
|
|
77
|
+
"viewUrl": "https://www.muggle-ai.com/...",
|
|
78
|
+
"status": "inconclusive",
|
|
79
|
+
"steps": [],
|
|
80
|
+
"reason": "No replayable script exists yet — needs first generation run."
|
|
67
81
|
}
|
|
68
82
|
]
|
|
69
83
|
}
|
|
70
84
|
```
|
|
71
85
|
|
|
72
|
-
Required fields per test: `name`, `testCaseId`, `runId`, `viewUrl`, `status`, `steps[]` with `{stepIndex, action, screenshotUrl}`.
|
|
86
|
+
Required fields per test: `name`, `testCaseId`, `runId`, `viewUrl`, `status`, `steps[]` with `{stepIndex, action, screenshotUrl}`.
|
|
73
87
|
|
|
74
|
-
**
|
|
75
|
-
- `
|
|
76
|
-
- `useCaseName` — the parent use case title. When present on any test, the overview list is grouped by use case; otherwise it is rendered as a flat list. Pull from `muggle-remote-use-case-get` using the test case's parent use-case id.
|
|
77
|
-
- `testScriptId` and `artifactsDir` are also optional.
|
|
78
|
-
|
|
79
|
-
If any required field is missing, stop and tell the caller exactly what's missing. Never fabricate data.
|
|
88
|
+
- **Failed** tests additionally require `failureStepIndex` and `error`.
|
|
89
|
+
- **Inconclusive** tests additionally require `reason` (one short sentence on why the result is neither pass nor fail). `steps[]` may be empty — that's fine. Inconclusive is for runs that couldn't be classified pass/fail (no replayable script, environment precondition unmet, infra error blocked execution, agent stalled before reaching the assertion). **Never silently drop these — always emit them as `inconclusive`.** The CLI counts them in the overview and renders an `⚠️` row with the dashboard link so reviewers can click through. If you find yourself wanting to skip a test or hand-write a comment because the schema "doesn't fit," that is the schema fitting — use `inconclusive`.
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
### Verdict
|
|
82
92
|
|
|
83
|
-
|
|
93
|
+
The renderer computes a verdict from the tests and emits a `**Verdict:** ✅ PASS | ❌ FAIL | ⚠️ INCONCLUSIVE` line at the top of the overview. The policy is strict:
|
|
84
94
|
|
|
85
|
-
|
|
95
|
+
- Any failed test → **FAIL** (regardless of how many passed or are inconclusive).
|
|
96
|
+
- No failures but any inconclusive → **INCONCLUSIVE**.
|
|
97
|
+
- All passed → **PASS**.
|
|
98
|
+
- Empty report → no verdict line.
|
|
86
99
|
|
|
87
|
-
|
|
100
|
+
You do not compute or render the verdict yourself — the CLI does. Never write a "Verdict: PASS" line into a hand-edited summary; it will conflict with the CLI's computed verdict.
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
5. Assemble the `E2eReport` with `projectId` from the test run.
|
|
94
|
-
6. Populate `description` (test case title/description) and `useCaseName` (parent use case title) on each report entry — optional but strongly recommended; they drive the grouped overview and the per-test collapsible headers. Prefer values already in your conversation context from earlier steps (e.g. a test case you just created or selected, or a use case you confirmed); only call `muggle-remote-test-case-get` / `muggle-remote-use-case-get` for anything you don't already have.
|
|
95
|
-
|
|
96
|
-
### From `muggle-do` (`open-prs.md`)
|
|
102
|
+
**Optional but recommended** per test:
|
|
103
|
+
- `description` — a one-line summary of what the test case verifies. Shown in the collapsible header for each test and helps reviewers understand the test without expanding it. Pull from the test case's `title`/`description` via `muggle-remote-test-case-get`.
|
|
104
|
+
- `useCaseName` — the parent use case title. When present on any test, the overview list is grouped by use case; otherwise it is rendered as a flat list. Pull from `muggle-remote-use-case-get` using the test case's parent use-case id.
|
|
105
|
+
- `testScriptId` and `artifactsDir` are also optional.
|
|
97
106
|
|
|
98
|
-
|
|
107
|
+
If any required field is missing, stop and tell the caller exactly what's missing. Never fabricate data.
|
|
99
108
|
|
|
100
|
-
|
|
109
|
+
## Step 1: Assemble the `E2eReport`
|
|
101
110
|
|
|
102
|
-
|
|
111
|
+
Read `plugin/skills/muggle-pr-visual-walkthrough/e2e-report-assembly.md` for the full assembly guide.
|
|
103
112
|
|
|
104
113
|
## Step 2: Render via `muggle build-pr-section`
|
|
105
114
|
|
|
@@ -126,7 +135,7 @@ gh pr view --json number,url,title 2>/dev/null
|
|
|
126
135
|
```
|
|
127
136
|
|
|
128
137
|
- **PR exists** → continue to 3A.2
|
|
129
|
-
- **No PR exists** → use `
|
|
138
|
+
- **No PR exists** → use `AskUserQuestion`:
|
|
130
139
|
- "Create a new PR with the visual walkthrough in the body"
|
|
131
140
|
- "Skip posting"
|
|
132
141
|
- If the user chooses to create a new PR, switch to Mode B and return the rendered `body`/`comment` to the caller for embedding in `gh pr create`. Do not create the PR directly from this skill unless the caller has no better way to do it.
|
|
@@ -134,20 +143,16 @@ gh pr view --json number,url,title 2>/dev/null
|
|
|
134
143
|
|
|
135
144
|
### 3A.2: Post the body as a PR comment
|
|
136
145
|
|
|
146
|
+
Extract the `body` field with `jq -r` (not `sed`) so JSON escape sequences are properly decoded, then pipe to `--body-file -`:
|
|
147
|
+
|
|
137
148
|
```bash
|
|
138
|
-
gh pr comment <pr-number> --body
|
|
139
|
-
<contents of body field from CLI output>
|
|
140
|
-
EOF
|
|
141
|
-
)"
|
|
149
|
+
jq -r '.body' /tmp/muggle-pr-section.json | gh pr comment <pr-number> --body-file -
|
|
142
150
|
```
|
|
143
151
|
|
|
144
152
|
### 3A.3: Post the overflow comment only if the CLI emitted one
|
|
145
153
|
|
|
146
154
|
```bash
|
|
147
|
-
gh pr comment <pr-number> --body
|
|
148
|
-
<contents of comment field from CLI output>
|
|
149
|
-
EOF
|
|
150
|
-
)"
|
|
155
|
+
jq -r '.comment' /tmp/muggle-pr-section.json | gh pr comment <pr-number> --body-file -
|
|
151
156
|
```
|
|
152
157
|
|
|
153
158
|
**Skip this step entirely if `comment` is `null`** — do not post a placeholder. The CLI decides fit-vs-overflow; never post the overflow comment speculatively.
|
|
@@ -169,16 +174,35 @@ Instead of posting, **return** the CLI output to the caller's context so they ca
|
|
|
169
174
|
3. **Post `comment` as a follow-up only if the CLI emitted one:**
|
|
170
175
|
|
|
171
176
|
```bash
|
|
172
|
-
gh pr comment <new-pr-number> --body
|
|
173
|
-
<contents of comment field>
|
|
174
|
-
EOF
|
|
175
|
-
)"
|
|
177
|
+
jq -r '.comment' /tmp/muggle-pr-section.json | gh pr comment <new-pr-number> --body-file -
|
|
176
178
|
```
|
|
177
179
|
|
|
178
180
|
Skip if `comment` is `null`.
|
|
179
181
|
|
|
180
182
|
In Mode B, this skill does not call `gh pr comment` or `gh pr create` itself — the caller owns PR creation because it also owns branch pushing, title building (including `[E2E FAILING]` prefix on failures), and multi-repo orchestration.
|
|
181
183
|
|
|
184
|
+
## Step 3 — Mode C: Embed mode for open-PR sweep orchestrators
|
|
185
|
+
|
|
186
|
+
Used when invoked as a sub-step of a open-PR sweep orchestrator (see `plugin/skills/muggle-test/SKILL.md` Mode C) rather than as a top-level user invocation. The orchestrator's `acceptance-tester` subagent (see `plugin/agents/acceptance-tester.md`) composes a **single per-PR verdict comment** and folds the walkthrough into it — posting separately would create 2–3 disparate comments per test cycle and clutter the PR.
|
|
187
|
+
|
|
188
|
+
### 3C.1: Detect embed mode
|
|
189
|
+
|
|
190
|
+
The caller passes `mode: "embed"` as a skill argument. Default behavior (no `mode` passed, or `mode: "post"`) is Mode A — unchanged.
|
|
191
|
+
|
|
192
|
+
### 3C.2: Render but do not post
|
|
193
|
+
|
|
194
|
+
Run `muggle build-pr-section` exactly as in Step 2. Then, **instead of calling `gh pr comment`**:
|
|
195
|
+
|
|
196
|
+
1. **Return** the CLI output (`{ body, comment }`) to the caller as this skill's result.
|
|
197
|
+
2. Do **not** find a PR, do **not** post a standalone comment, do **not** prompt the user.
|
|
198
|
+
3. If `comment` is non-null (overflow case), return it alongside `body` — the orchestrator decides how to handle overflow (typically: inline `body` in the verdict comment, post `comment` as a follow-up).
|
|
199
|
+
|
|
200
|
+
### 3C.3: Hand off
|
|
201
|
+
|
|
202
|
+
The orchestrator (`acceptance-tester`) concatenates the returned `body` into its verdict comment template alongside the verdict summary, change-list, and any other sections it owns, then posts a single `gh pr comment` itself. This skill's job ends at returning the rendered markdown.
|
|
203
|
+
|
|
204
|
+
In Mode C, the same fit-vs-overflow contract from Step 2 applies — never modify the CLI's output, never fabricate fields, never post anything. The caller owns posting.
|
|
205
|
+
|
|
182
206
|
## Tool Reference
|
|
183
207
|
|
|
184
208
|
| Phase | Tool |
|
|
@@ -188,14 +212,15 @@ In Mode B, this skill does not call `gh pr comment` or `gh pr create` itself —
|
|
|
188
212
|
| Find existing PR (Mode A) | `gh pr view` |
|
|
189
213
|
| Post comment(s) (Mode A) | `gh pr comment` |
|
|
190
214
|
| Create new PR (Mode B, caller handles) | `gh pr create` |
|
|
191
|
-
| User confirmation (Mode A no-PR branch) | `
|
|
215
|
+
| User confirmation (Mode A no-PR branch) | `AskUserQuestion` |
|
|
192
216
|
|
|
193
217
|
## Guardrails
|
|
194
218
|
|
|
195
|
-
- **Never hand-write the walkthrough markdown** — always call `muggle build-pr-section`. The CLI is the single source of truth for formatting.
|
|
219
|
+
- **Never hand-write the walkthrough markdown** — always call `muggle build-pr-section`. The CLI is the single source of truth for formatting. If a test outcome doesn't fit `passed | failed`, that's what `inconclusive` is for — never fall back to a hand-written summary, a custom table, a "Verdict: PASS" header, a `Tested on:`/`Project:` footer, or any other freeform text. The CLI already emits per-test-case dashboard links (no project-level link), uses `https://www.muggle-ai.com/...` URLs (never the test target's `localhost` URL), and computes the verdict — anything you would manually add is wrong by construction.
|
|
196
220
|
- **Never modify the CLI's output** — post `body` and (if present) `comment` verbatim. Any reformatting defeats the fit-vs-overflow budget math.
|
|
197
221
|
- **Never invent report fields** — if `projectId`, a per-test `viewUrl`, or per-step `screenshotUrl` is missing, stop and report what's missing. Do not fabricate URLs or fill in placeholders.
|
|
198
222
|
- **Never post the overflow comment when `comment` is `null`** — the CLI decides fit-vs-overflow.
|
|
199
223
|
- **Never create a PR without confirmation in Mode A** — if no PR exists, ask the user or switch to Mode B and hand back to the caller.
|
|
200
224
|
- **Don't run tests** — this skill only renders and posts existing results. If the `E2eReport` is not in context, redirect the caller to `muggle-test`, `muggle-test-feature-local`, or `muggle-do`.
|
|
201
|
-
- **Mode
|
|
225
|
+
- **Mode is chosen by the caller, not the user** — `muggle-test` top-level uses Mode A; `muggle-do` uses Mode B; open-PR sweep orchestrators (`muggle-test` Mode C / `acceptance-tester`) pass `mode: "embed"` for Mode C. Don't ask the user which mode to use.
|
|
226
|
+
- **Never post in Mode C** — when `mode: "embed"` is passed, return the rendered body to the caller and stop. The orchestrator owns the single verdict comment.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# E2eReport Assembly Guide
|
|
2
|
+
|
|
3
|
+
Include **all** runs — passed, failed, **and inconclusive**. Never drop a run. Always best-effort to upload so the dashboard has a record reviewers can open from the PR — even when the local run produced zero action steps.
|
|
4
|
+
|
|
5
|
+
## Picking a status
|
|
6
|
+
|
|
7
|
+
| Status | Use when | Required extras |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `passed` | Run completed and the assertion held. | — |
|
|
10
|
+
| `failed` | Run completed and the assertion failed, or the product itself broke before the assertion could be made (server error, 500, broken page). | `failureStepIndex`, `error` |
|
|
11
|
+
| `inconclusive` | Run could not yield a pass/fail signal for reasons **outside the product**: no replayable script existed, environment precondition unmet, infra/Electron error, agent stalled on a cookie banner or login wall, missing secrets, agent went off-course. | `reason` (one short sentence; `steps[]` may be empty) |
|
|
12
|
+
|
|
13
|
+
If a test should be inconclusive but you don't have a real `runId` / `viewUrl` (e.g., generation never ran), use the same project-level dashboard fallback as the "last-resort" failed branch below: emit a stub run via `muggle-remote-local-run-upload` if at all possible; otherwise synthesize a UUID-shaped runId and use `https://www.muggle-ai.com/muggleTestV0/dashboard/projects/{projectId}/runs` as `viewUrl`. The schema requires both fields — but a working dashboard link is better than nothing.
|
|
14
|
+
|
|
15
|
+
## Uploaded run (passed or failed; the common path)
|
|
16
|
+
|
|
17
|
+
Every run that completed locally — pass or fail, with or without action steps — should reach the cloud via Step 8 of the caller skill. The upload response carries `actionScriptId` and `viewUrl`; `testScriptId` is **only present for passing runs and replays** (failed generations skip the test script wrapper to avoid clobbering the canonical replay target).
|
|
18
|
+
|
|
19
|
+
Fetch step screenshots in parallel — pick the right tool per upload:
|
|
20
|
+
|
|
21
|
+
- **`testScriptId` present** → `muggle-remote-test-script-get` with that id.
|
|
22
|
+
- **`testScriptId` missing** (failed generation, or zero-step fallback via `muggle-remote-local-run-upload`) → `muggle-remote-action-script-get` with `actionScriptId` from the upload response. Same `steps[]` + `summaryStep` shape; just one less hop.
|
|
23
|
+
|
|
24
|
+
For each result:
|
|
25
|
+
|
|
26
|
+
1. Build `steps[]`: `[{ stepIndex: <index>, action: steps[i].operation.action, screenshotUrl: steps[i].operation.screenshotUrl }, ...]`. Empty array is fine — zero-step runs still render the failure summary header in the walkthrough.
|
|
27
|
+
2. `viewUrl` — from upload response (deep-links to the specific run via `actionScriptId`).
|
|
28
|
+
3. `status` — from `muggle-local-run-result-get`.
|
|
29
|
+
4. If failed: also capture `failureStepIndex`, `error`, `artifactsDir` from the run result.
|
|
30
|
+
|
|
31
|
+
## Last-resort: upload genuinely failed
|
|
32
|
+
|
|
33
|
+
Reach this branch only when **both** `muggle-local-publish-test-script` AND the `muggle-remote-local-run-upload` fallback errored (network failure, auth issue, etc.) — not for ordinary zero-step runs, which the fallback handles. Don't drop the run; render a stub entry so reviewers still see something happened.
|
|
34
|
+
|
|
35
|
+
1. `steps: []`.
|
|
36
|
+
2. `viewUrl`: `https://www.muggle-ai.com/muggleTestV0/dashboard/projects/{projectId}/runs` (generic dashboard).
|
|
37
|
+
3. `status: "failed"`, `failureStepIndex: 0`, `error` from run result.
|
|
38
|
+
4. `testCaseId` — from execution step selection. `runId` — from `muggle-local-execute-test-generation` (always present even on failure).
|
|
39
|
+
|
|
40
|
+
On every entry: `description` (test case title/description — drives the collapsible header) and `useCaseName` (parent use case title — when present, the overview groups by use case) are optional but recommended. Prefer values already in context; only call `muggle-remote-test-case-get` / `muggle-remote-use-case-get` if missing.
|
|
41
|
+
|
|
42
|
+
If called from `muggle-do`: `e2e-acceptance.md` already produces this shape — pass it through unchanged.
|
|
43
|
+
|
|
44
|
+
## Shape
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"projectId": "<projectId>",
|
|
49
|
+
"tests": [
|
|
50
|
+
{
|
|
51
|
+
"name": "<test case title>",
|
|
52
|
+
"description": "<one-line description (recommended)>",
|
|
53
|
+
"useCaseName": "<parent use case title (recommended)>",
|
|
54
|
+
"testCaseId": "<testCaseId from execution step>",
|
|
55
|
+
"testScriptId": "<testScriptId from publish>",
|
|
56
|
+
"runId": "<runId from muggle-local-execute-test-generation>",
|
|
57
|
+
"viewUrl": "<viewUrl from publish>",
|
|
58
|
+
"status": "passed",
|
|
59
|
+
"steps": [{ "stepIndex": 0, "action": "...", "screenshotUrl": "..." }]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "<failed test case title>",
|
|
63
|
+
"description": "<one-line description (recommended)>",
|
|
64
|
+
"useCaseName": "<parent use case title (recommended)>",
|
|
65
|
+
"testCaseId": "<testCaseId from execution step>",
|
|
66
|
+
"runId": "<runId from muggle-local-execute-test-generation>",
|
|
67
|
+
"viewUrl": "<viewUrl from upload response, deep-linked via actionScriptId>",
|
|
68
|
+
"status": "failed",
|
|
69
|
+
"steps": [],
|
|
70
|
+
"failureStepIndex": 0,
|
|
71
|
+
"error": "<error message from run result>"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "<inconclusive test case title>",
|
|
75
|
+
"description": "<one-line description (recommended)>",
|
|
76
|
+
"useCaseName": "<parent use case title (recommended)>",
|
|
77
|
+
"testCaseId": "<testCaseId from execution step>",
|
|
78
|
+
"runId": "<runId from execute, or synthesized UUID if no run started>",
|
|
79
|
+
"viewUrl": "<viewUrl from upload response, or project-level fallback URL>",
|
|
80
|
+
"status": "inconclusive",
|
|
81
|
+
"steps": [],
|
|
82
|
+
"reason": "<one short sentence: why neither pass nor fail applies>"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
```
|
|
@@ -2,122 +2,30 @@
|
|
|
2
2
|
name: muggle-preferences
|
|
3
3
|
description: >-
|
|
4
4
|
View, set, or reset Muggle AI preferences that control testing behavior.
|
|
5
|
-
Use when user asks to see preferences, change a setting, configure Muggle
|
|
5
|
+
Use when user asks to see preferences, change a setting, configure Muggle Test
|
|
6
6
|
defaults, or manage muggle config. Triggers on: 'muggle preferences',
|
|
7
7
|
'show muggle settings', 'change muggle preference', 'set autoLogin to
|
|
8
8
|
always', 'muggle config', 'reset muggle preferences', 'show my muggle
|
|
9
9
|
settings', 'configure muggle', 'muggle setup'.
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
# Muggle Preferences
|
|
12
|
+
# Muggle Test Preferences
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
> Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-preferences"`.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Pick the operation, then read its op file for the procedure.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
| Intent | Op file |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `/muggle-preferences <key>` or "change my `<key>` preference" | `ops/change-one.md` |
|
|
21
|
+
| User names key + value (e.g. "set autoLogin to always") | `ops/set.md` |
|
|
22
|
+
| "show preferences" / no args | `ops/list.md` |
|
|
23
|
+
| "configure muggle" / "muggle setup" / change without naming a key | `ops/configure.md` |
|
|
24
|
+
| "reset preferences" | `ops/reset.md` |
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
- **Change one** — re-run the gate's picker for a single key. Use this when the user invokes `/muggle-preferences <key>` or says "change my <key> preference".
|
|
22
|
-
- **Configure** — interactive picker covering all keys at once. Default when the user wants to change preferences but hasn't named a specific one (e.g. "muggle setup", "configure muggle", "change my preferences").
|
|
23
|
-
- **Set** — direct set when the user names a key+value (e.g. "set autoLogin to always").
|
|
24
|
-
- **Reset** — restore preferences to default (`ask`).
|
|
26
|
+
## Shared context (all ops)
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Read preferences from session context. Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
31
|
-
|
|
32
|
-
If no preferences line is present, treat all preferences as `"ask"` (the default).
|
|
33
|
-
|
|
34
|
-
## List
|
|
35
|
-
|
|
36
|
-
Render a `Preference | Value | Description` table titled `Muggle AI — Preferences`.
|
|
37
|
-
- Keys: every `preference-gates/<key>.md` (excluding `README.md`).
|
|
38
|
-
- Values: from session context (default `ask`).
|
|
39
|
-
- Description: each gate file's first paragraph.
|
|
40
|
-
|
|
41
|
-
Footer:
|
|
42
|
-
```
|
|
43
|
-
Values: always · ask · never (defaultExecutionMode: local/remote/ask)
|
|
44
|
-
Scope: global (~/.muggle-ai/) or project (.muggle-ai/ in repo root)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Change one (single-key picker)
|
|
48
|
-
|
|
49
|
-
Use this when the user invokes `/muggle-preferences <key>` or says "change my <key> preference" / "show me the <key> options". Behavior:
|
|
50
|
-
|
|
51
|
-
1. Check that `preference-gates/<key>.md` exists. If not, list `preference-gates/*.md` and ask.
|
|
52
|
-
2. Open it, run **Picker 1 only**.
|
|
53
|
-
3. Call `muggle-local-preferences-set` with the mapped value, `scope: "global"`. **Skip Picker 2** (user explicitly asked to change).
|
|
54
|
-
4. Confirm: `Set <key> to <value>.`
|
|
55
|
-
|
|
56
|
-
This is the entry point that silent-mode footers point at, so its UX must mirror the per-key gate exactly — same question, same options, same mappings.
|
|
57
|
-
|
|
58
|
-
## Configure (interactive picker)
|
|
59
|
-
|
|
60
|
-
Use this whenever the user wants to change preferences without naming a specific key. The flow runs in a single `AskUserQuestion` call so the user can toggle preferences with the keyboard instead of typing key names.
|
|
61
|
-
|
|
62
|
-
### Step 1 — show current state
|
|
63
|
-
|
|
64
|
-
Print the preference table from the **List** section so the user sees what's set today.
|
|
65
|
-
|
|
66
|
-
### Step 2 — tell the user how to drive the picker
|
|
67
|
-
|
|
68
|
-
Print this instruction block verbatim before calling `AskUserQuestion`:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
How to use this picker:
|
|
72
|
-
↑/↓ move between options
|
|
73
|
-
space toggle a preference (selected = set to `always`)
|
|
74
|
-
tab move to the next question
|
|
75
|
-
enter confirm
|
|
76
|
-
|
|
77
|
-
Anything you don't toggle keeps its current value. After this picker
|
|
78
|
-
you can tell me which (if any) should instead be set to `never`.
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Step 3 — call AskUserQuestion
|
|
82
|
-
|
|
83
|
-
Group keys into categories below (only place this UX grouping lives — not in the gate dir). For each option: label = key name, description = first paragraph of `preference-gates/<key>.md`.
|
|
84
|
-
|
|
85
|
-
- `multiSelect: true`, `header: "Auth & session"` — `autoLogin`, `autoSelectProject`, `checkForUpdates`, `verboseOutput`
|
|
86
|
-
- `multiSelect: true`, `header: "Test run"` — `showElectronBrowser`, `openTestResultsAfterRun`, `autoPublishLocalResults`, `autoDetectChanges`
|
|
87
|
-
- `multiSelect: true`, `header: "Suggestions & PR"` — `suggestRelatedUseCases`, `suggestRelatedTestCases`, `postPRVisualWalkthrough`
|
|
88
|
-
- `multiSelect: false`, `header: "Default mode"` — `defaultExecutionMode`. Options: `Local — run on my computer` (`local`), `Remote — run in the Muggle cloud` (`remote`), `Ask each time` (don't change).
|
|
89
|
-
- `multiSelect: false`, `header: "Scope"` — final scope question. Options: `Global (all repos)` (~/.muggle-ai/), `This project only` (.muggle-ai/ in repo).
|
|
90
|
-
|
|
91
|
-
For the multi-select questions: text = `Which of these should auto-proceed (set to "always")?`; selected = `always`.
|
|
92
|
-
|
|
93
|
-
`AskUserQuestion` accepts up to 4 questions per call — split into two calls if needed (categories first, scope second).
|
|
94
|
-
|
|
95
|
-
### Step 4 — apply selections
|
|
96
|
-
|
|
97
|
-
For each toggled key (multi-select questions): `muggle-local-preferences-set` with `value: "always"`. For `defaultExecutionMode`: only set if user picked Local/Remote (skip "Ask each time"). Pass `scope` from the scope question; pass `cwd` when scope is `project`.
|
|
98
|
-
|
|
99
|
-
### Step 5 — offer the `never` follow-up
|
|
100
|
-
|
|
101
|
-
Ask: `Want any of these set to "never" (auto-skip without asking)? Name them, e.g. "never on autoPublishLocalResults", or say "no".`. For named keys, call `muggle-local-preferences-set` with `value: "never"`, same scope.
|
|
102
|
-
|
|
103
|
-
### Step 6 — confirm
|
|
104
|
-
|
|
105
|
-
Print a one-liner summary: `Set autoLogin=always, openTestResultsAfterRun=always (global).`
|
|
106
|
-
|
|
107
|
-
## Set (direct)
|
|
108
|
-
|
|
109
|
-
When the user names both key and value (e.g. "set autoLogin to always", "make showElectronBrowser never for this project"):
|
|
110
|
-
|
|
111
|
-
1. Parse `key` and `value` from the user's message.
|
|
112
|
-
2. Validate `key`: `preference-gates/<key>.md` must exist. If not, list `preference-gates/*.md` and ask.
|
|
113
|
-
3. Validate `value`: must be `always`/`never`/`ask` for all keys; `defaultExecutionMode` accepts `local`/`remote`/`ask` instead.
|
|
114
|
-
4. Scope defaults to `global`. If user says "for this project" / "just this repo", use `project` and pass `cwd`.
|
|
115
|
-
5. Call `muggle-local-preferences-set`.
|
|
116
|
-
6. Confirm: `Set {key} to {value} ({scope}).`
|
|
117
|
-
|
|
118
|
-
## Reset
|
|
119
|
-
|
|
120
|
-
- Specific key: `muggle-local-preferences-set` with `value: "ask"` for that key.
|
|
121
|
-
- All preferences: same call for every `preference-gates/<key>.md`.
|
|
122
|
-
|
|
123
|
-
Confirm what was reset.
|
|
28
|
+
- **Current values**: session-context line `Muggle Test Preferences key=value …`. Default `ask`.
|
|
29
|
+
- **Per-key files**: `preference-gates/<key>.md`. Key list = `ls preference-gates/*.md` minus `README.md`.
|
|
30
|
+
- **Allowed values**: `always`/`never`/`ask` (or `local`/`remote`/`ask` for `defaultExecutionMode`).
|
|
31
|
+
- **Scope**: `global` default; `project` if user says "for this project" / "just this repo" (pass `cwd`).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Change one — `/muggle-preferences <key>`
|
|
2
|
+
|
|
3
|
+
1. Verify `preference-gates/<key>.md` exists. If not, list `preference-gates/*.md` and ask.
|
|
4
|
+
2. Read it. Run **Picker 1** with the options defined in the gate file, plus an additional `Ask me each time` (sub: `Prompt me at decision time.`) → `ask`.
|
|
5
|
+
3. `muggle-local-preferences-set` with the mapped value, `scope: "global"`.
|
|
6
|
+
4. Confirm: `Set <key> to <value>.`
|
|
7
|
+
|
|
8
|
+
Skip Picker 2 — user explicitly asked to change.
|
|
9
|
+
|
|
10
|
+
**Gates whose Picker 1 isn't a static yes/no** (e.g. `autoSelectProject`, where the picker is the project list rendered by the calling skill): present a generic 3-option picker using the gate's silent-action wording for the `always`/`never` labels, plus `Ask me each time` → `ask`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Configure (interactive picker)
|
|
2
|
+
|
|
3
|
+
Use whenever the user wants to change preferences without naming a specific key. Drives selections through `AskUserQuestion` so they toggle with the keyboard instead of typing key names.
|
|
4
|
+
|
|
5
|
+
## Step 1 — show current state
|
|
6
|
+
|
|
7
|
+
Print the preference table per `ops/list.md` so the user sees what's set today.
|
|
8
|
+
|
|
9
|
+
## Step 2 — usage instructions
|
|
10
|
+
|
|
11
|
+
Print verbatim before calling `AskUserQuestion`:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
How to use this picker:
|
|
15
|
+
↑/↓ move between options
|
|
16
|
+
space toggle a preference (selected = set to `always`)
|
|
17
|
+
tab move to the next question
|
|
18
|
+
enter confirm
|
|
19
|
+
|
|
20
|
+
Anything you don't toggle keeps its current value. After this picker
|
|
21
|
+
you can tell me which (if any) should instead be set to `never`.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Step 3 — call AskUserQuestion
|
|
25
|
+
|
|
26
|
+
For each option: label = key name, description = first paragraph of `preference-gates/<key>.md`. Multi-select question text = `Which of these should auto-proceed (set to "always")?`; selected = `always`.
|
|
27
|
+
|
|
28
|
+
- `multiSelect: true`, `header: "Auth & session"` — `autoLogin`, `autoSelectProject`, `checkForUpdates`, `verboseOutput`
|
|
29
|
+
- `multiSelect: true`, `header: "Test setup"` — `autoSelectLocalHost`, `autoDetectChanges`
|
|
30
|
+
- `multiSelect: true`, `header: "Test run"` — `showElectronBrowser`, `openTestResultsAfterRun`, `autoPublishLocalResults`
|
|
31
|
+
- `multiSelect: true`, `header: "Suggestions & PR"` — `suggestRelatedUseCases`, `suggestRelatedTestCases`, `postPRVisualWalkthrough`, `autoCreatePR`
|
|
32
|
+
- `multiSelect: true`, `header: "Branch hygiene"` — `autoUseWorktree`, `autoRebase`, `autoCleanup`
|
|
33
|
+
- `multiSelect: false`, `header: "E2E acceptance"` — `autoE2ETest`. Options: `Always run Stage 6 at the end` (`always` — default), `Ask each cycle` (`ask`). No `never` option.
|
|
34
|
+
- `multiSelect: false`, `header: "Default mode"` — `defaultExecutionMode`. Options: `Local — run on my computer` (`local`), `Remote — run in the Muggle Test cloud` (`remote`), `Ask each time` (don't change).
|
|
35
|
+
- `multiSelect: false`, `header: "Scope"` — final scope question. Options: `Global (all repos)` (~/.muggle-ai/), `This project only` (.muggle-ai/ in repo).
|
|
36
|
+
|
|
37
|
+
`AskUserQuestion` accepts up to 4 questions per call — split into two calls if needed (categories first, scope second).
|
|
38
|
+
|
|
39
|
+
## Step 4 — apply selections
|
|
40
|
+
|
|
41
|
+
For each toggled key (multi-select questions): `muggle-local-preferences-set` with `value: "always"`. For `defaultExecutionMode`: only set if user picked Local/Remote (skip "Ask each time"). Pass `scope` from the scope question; pass `cwd` when scope is `project`.
|
|
42
|
+
|
|
43
|
+
## Step 5 — `never` follow-up
|
|
44
|
+
|
|
45
|
+
Ask: `Want any of these set to "never" (auto-skip without asking)? Name them, e.g. "never on autoPublishLocalResults", or say "no".`. For named keys, call `muggle-local-preferences-set` with `value: "never"`, same scope.
|
|
46
|
+
|
|
47
|
+
## Step 6 — confirm
|
|
48
|
+
|
|
49
|
+
One-liner summary: `Set autoLogin=always, openTestResultsAfterRun=always (global).`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# List
|
|
2
|
+
|
|
3
|
+
1. Read each `preference-gates/<key>.md` (skip `README.md`). First paragraph of each = description.
|
|
4
|
+
2. Render `Preference | Value | Description` table titled `Muggle AI — Preferences`. Values from session context.
|
|
5
|
+
3. Footer:
|
|
6
|
+
```
|
|
7
|
+
Values: always · ask · never (defaultExecutionMode: local/remote/ask)
|
|
8
|
+
Scope: global (~/.muggle-ai/) or project (.muggle-ai/ in repo root)
|
|
9
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Set — direct (key + value)
|
|
2
|
+
|
|
3
|
+
Trigger: user names both key and value (e.g. "set autoLogin to always", "make showElectronBrowser never for this project").
|
|
4
|
+
|
|
5
|
+
1. Parse `key` and `value`.
|
|
6
|
+
2. Verify `preference-gates/<key>.md` exists. If not, list `preference-gates/*.md` and ask.
|
|
7
|
+
3. Validate `value` per Shared context.
|
|
8
|
+
4. Resolve scope per Shared context.
|
|
9
|
+
5. `muggle-local-preferences-set`.
|
|
10
|
+
6. Confirm: `Set {key} to {value} ({scope}).`
|
|
@@ -10,7 +10,7 @@ which uses `local` / `remote` / `ask`).
|
|
|
10
10
|
|
|
11
11
|
## Resolution
|
|
12
12
|
|
|
13
|
-
`SessionStart` injects a `Muggle Preferences` line (`key=value` pairs) from
|
|
13
|
+
`SessionStart` injects a `Muggle Test Preferences` line (`key=value` pairs) from
|
|
14
14
|
`~/.muggle-ai/preferences.json` (global) overlaid by
|
|
15
15
|
`<repo>/.muggle-ai/preferences.json` (project). Absent → treat as `ask`.
|
|
16
16
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `autoCleanup`
|
|
2
|
+
|
|
3
|
+
After a PR is merged, run the full cleanup sequence (worktree, branch, artifacts, `clean_gone`) — or skip. `always` runs all steps with no per-step prompts. Substitute `{branch}`.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Cleanup after merge`, question `"PR for {branch} is merged — run cleanup now?"`
|
|
6
|
+
- `Run cleanup` — `Remove worktree, delete branch local+remote, clear local artifacts, prune [gone] branches.` → `always`
|
|
7
|
+
- `Skip cleanup` — `Leave everything in place.` → `never`
|
|
8
|
+
|
|
9
|
+
**Silent action**
|
|
10
|
+
- `always` → `Running post-merge cleanup for {branch}`
|
|
11
|
+
- `never` → `Skipping post-merge cleanup for {branch}`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# `autoCreatePR`
|
|
2
|
+
|
|
3
|
+
Controls whether the cycle pushes the working branch to remote and opens a pull request after local commits land, or stops at "commits made locally". Fires when the agent has buildable commits and no PR exists yet for the branch. Substitute `{branch}`.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Open PR?`, question `"Push '{branch}' and open a pull request?"`
|
|
6
|
+
- `Open the PR` — `Push branch and run gh pr create.` → `always`
|
|
7
|
+
- `Ask me next time` — `Decide per cycle.` → `ask`
|
|
8
|
+
- `Skip — I'll open it myself` — `Stop after the local commits.` → `never`
|
|
9
|
+
|
|
10
|
+
**Silent action**
|
|
11
|
+
- `always` → `Opening PR for {branch}`
|
|
12
|
+
- `ask` → `Asking about PR creation`
|
|
13
|
+
- `never` → `Skipping PR creation`
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Scan local git changes to scope the test run, or skip the scan.
|
|
4
4
|
|
|
5
|
-
**Picker 1** — header `
|
|
6
|
-
- `
|
|
7
|
-
- `
|
|
5
|
+
**Picker 1** — header `Scan changes?`, question `"Scan git changes to scope what to test?"`
|
|
6
|
+
- `Scan changes` — `Test cases that match recent diffs get prioritized.` → `always`
|
|
7
|
+
- `Skip scan` — `Skip — you'll tell me what to test.` → `never`
|
|
8
8
|
|
|
9
9
|
**Silent action**
|
|
10
10
|
- `always` → `Scanning git changes to scope the run`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `autoE2ETest`
|
|
2
|
+
|
|
3
|
+
Run Stage 6 (E2E acceptance) at the end of every `/muggle-do` cycle, or fold the decision into pre-flight each time. Default `always` — running E2E every cycle is the point of `muggle-do`, so `never` is not offered.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Run E2E acceptance?`, question `"Run Stage 6 every cycle, or decide each time?"`
|
|
6
|
+
- `Always run` — `Run Stage 6 every cycle; no further prompts.` → `always`
|
|
7
|
+
- `Decide each cycle` — `Surface the question in pre-flight each run.` → `ask`
|
|
8
|
+
|
|
9
|
+
**Silent action**
|
|
10
|
+
- `always` → `Running Stage 6`
|
|
11
|
+
- `ask` → `Asking each cycle whether to run Stage 6`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# `autoPublishLocalResults`
|
|
2
2
|
|
|
3
|
-
Upload local run artifacts to the Muggle cloud, or keep them local.
|
|
3
|
+
Upload local run artifacts to the Muggle Test cloud, or keep them local.
|
|
4
4
|
|
|
5
|
-
**Picker 1** — header `Share results?`, question `"Upload these results to the Muggle dashboard?"`
|
|
5
|
+
**Picker 1** — header `Share results?`, question `"Upload these results to the Muggle Test dashboard?"`
|
|
6
6
|
- `Upload them` — `Needed for the dashboard view, PR walkthrough, and team visibility.` → `always`
|
|
7
7
|
- `Keep local-only` — `Stay on this machine — no dashboard view or PR walkthrough.` → `never`
|
|
8
8
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `autoRebase`
|
|
2
|
+
|
|
3
|
+
Rebase onto `origin/{default}` before dev servers / E2E, or run as-is. Substitute `{behind}` and `{default}`.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Rebase first`, question `"Branch is {behind} commits behind origin/{default} — rebase first?"`
|
|
6
|
+
- `Rebase first` — `Pull in default-branch changes so the run reflects the merged main line.` → `always`
|
|
7
|
+
- `Run as-is` — `Skip the rebase.` → `never`
|
|
8
|
+
|
|
9
|
+
**Silent action**
|
|
10
|
+
- `always` → `Rebasing onto origin/{default} ({behind} behind)`
|
|
11
|
+
- `never` → `Running as-is ({behind} behind origin/{default})`
|