@muggleai/works 4.8.4 → 4.9.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/dist/{chunk-44I5ROCB.js → chunk-4KQZLF56.js} +219 -7
- package/dist/{chunk-OMLNCNSZ.js → chunk-6N7OIBAS.js} +7 -2
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +8 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/agents/acceptance-tester.md +103 -0
- package/dist/plugin/scripts/ensure-electron-app.sh +37 -1
- package/dist/plugin/skills/muggle/SKILL.md +24 -8
- package/dist/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +17 -0
- package/dist/plugin/skills/muggle-preferences/SKILL.md +82 -0
- package/dist/plugin/skills/muggle-status/SKILL.md +17 -0
- package/dist/plugin/skills/muggle-test/SKILL.md +26 -0
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +50 -19
- package/dist/plugin/skills/muggle-test-import/SKILL.md +20 -0
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +276 -0
- package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +18 -0
- package/dist/plugin/skills/muggle-upgrade/SKILL.md +9 -1
- package/dist/release-manifest.json +4 -4
- package/dist/src-7GB7WIFT.js +1 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +8 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/agents/acceptance-tester.md +103 -0
- package/plugin/scripts/ensure-electron-app.sh +37 -1
- package/plugin/skills/muggle/SKILL.md +24 -8
- package/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +17 -0
- package/plugin/skills/muggle-preferences/SKILL.md +82 -0
- package/plugin/skills/muggle-status/SKILL.md +17 -0
- package/plugin/skills/muggle-test/SKILL.md +26 -0
- package/plugin/skills/muggle-test-feature-local/SKILL.md +50 -19
- package/plugin/skills/muggle-test-import/SKILL.md +20 -0
- package/plugin/skills/muggle-test-prepare/SKILL.md +276 -0
- package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +18 -0
- package/plugin/skills/muggle-upgrade/SKILL.md +9 -1
- package/dist/src-ZRUONWKV.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "4.
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-04-
|
|
2
|
+
"release": "4.9.1",
|
|
3
|
+
"buildId": "run-26-1",
|
|
4
|
+
"commitSha": "cffcf26eaf2b00b3b1e55dcd509db7b9d8854a0d",
|
|
5
|
+
"buildTime": "2026-04-19T08:47:53Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DEFAULT_PREFERENCES, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PreferenceKey, PreferenceValue, buildElectronAppChecksumsUrl, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, calculateFileChecksum, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports as e2e, formatPreferencesOneLiner, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getPlatformKey, getQaTools, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isFirstRun, loadApiKeyData, loadCredentials, local_exports as localQa, mcp_exports as mcp, openBrowserUrl, performLogin, performLogout, pollDeviceCode, e2e_exports as qa, readGlobalPreferences, readProjectPreferences, resetConfig, resetLogger, resetPreference, resolvePreferences, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, toolRequiresAuth, validatePreference, verifyFileChecksum, writePreferences } from './chunk-4KQZLF56.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muggleai/works",
|
|
3
3
|
"mcpName": "io.github.multiplex-ai/muggle",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.9.1",
|
|
5
5
|
"description": "Ship quality products with AI-powered E2E acceptance testing that validates your web app like a real user — from Claude Code and Cursor to PR.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Run real-browser end-to-end (E2E) acceptance tests on your web app from any AI coding agent. Generate test scripts from plain English, replay them on localhost, capture screenshots, and validate user flows like signup, checkout, and dashboards. Works across Claude Code, Cursor, Codex, and Windsurf.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.9.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
"homepage": "https://www.muggletest.com",
|
|
10
10
|
"repository": "https://github.com/multiplex-ai/muggle-ai-works",
|
|
11
11
|
"license": "MIT",
|
|
12
|
+
"agents": [
|
|
13
|
+
{
|
|
14
|
+
"name": "acceptance-tester",
|
|
15
|
+
"path": "agents/acceptance-tester.md",
|
|
16
|
+
"description": "E2E acceptance testing agent — runs real-browser tests, reports structured results with blocking issues and suggested fixes, imports test artifacts, manages preferences, and operates the Muggle AI suite."
|
|
17
|
+
}
|
|
18
|
+
],
|
|
12
19
|
"keywords": [
|
|
13
20
|
"acceptance-testing",
|
|
14
21
|
"testing",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Ship quality products with AI-powered end-to-end (E2E) acceptance testing that validates your web app like a real user — from Claude Code and Cursor to PR.",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.9.1",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acceptance-tester
|
|
3
|
+
description: >-
|
|
4
|
+
E2E acceptance testing agent — runs real-browser tests against web apps and
|
|
5
|
+
reports structured results with blocking issues and suggested fixes. Also
|
|
6
|
+
imports existing test artifacts, manages Muggle preferences, and operates
|
|
7
|
+
the Muggle AI suite (status checks, repairs). Dispatch this agent when the
|
|
8
|
+
team needs acceptance test feedback, test coverage for a feature, or Muggle
|
|
9
|
+
suite operations.
|
|
10
|
+
model: sonnet
|
|
11
|
+
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Acceptance Tester
|
|
15
|
+
|
|
16
|
+
You are the team's acceptance testing specialist. You run real-browser end-to-end tests against web apps using Muggle AI and report structured results that coding agents can act on. You also manage test artifacts, user preferences, and the Muggle installation itself.
|
|
17
|
+
|
|
18
|
+
You operate through skills — never call raw MCP tools directly.
|
|
19
|
+
|
|
20
|
+
## Skills
|
|
21
|
+
|
|
22
|
+
| Skill | When to use |
|
|
23
|
+
|-------|-------------|
|
|
24
|
+
| `muggle-test` | Run acceptance tests. Auto-routes between local (Electron browser on localhost) and remote (cloud execution on preview/staging URL). Handles change detection, test case selection, execution, and result collection. |
|
|
25
|
+
| `muggle-test-import` | Import existing test artifacts into Muggle Test — Playwright specs, Cypress tests, PRDs, Gherkin feature files, test plan documents. |
|
|
26
|
+
| `muggle-preferences` | View, set, or reset the 12 preference knobs that control Muggle behavior. |
|
|
27
|
+
| `muggle-repair` | Diagnose and fix broken Muggle installation components. |
|
|
28
|
+
| `muggle-status` | Check health of the Muggle installation — Electron app, MCP server, auth, CLI version. |
|
|
29
|
+
|
|
30
|
+
Select the skill based on what the orchestrator asks you to do. If the task doesn't clearly map to one skill, ask for clarification.
|
|
31
|
+
|
|
32
|
+
## Input Contract
|
|
33
|
+
|
|
34
|
+
The orchestrator provides a dispatch prompt with:
|
|
35
|
+
|
|
36
|
+
- **What to do:** Run tests, import tests, manage preferences, check status, or repair.
|
|
37
|
+
- **For testing:** Target URL and what to test — a feature description, acceptance criteria, or "run regression on recent changes."
|
|
38
|
+
- **For import:** Path to test files or documents to import.
|
|
39
|
+
- **For preferences:** Which preference to view or change, or "show all."
|
|
40
|
+
- **For status/repair:** No additional input needed.
|
|
41
|
+
|
|
42
|
+
## Output Contract
|
|
43
|
+
|
|
44
|
+
### When Running Tests
|
|
45
|
+
|
|
46
|
+
Always return two sections:
|
|
47
|
+
|
|
48
|
+
**Section 1 — Test Summary**
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
## Test Summary
|
|
52
|
+
- **Tests:** {total} total — {passed} passed, {failed} failed
|
|
53
|
+
- **Verdict:** PASS | FAIL
|
|
54
|
+
- **Dashboard:** {link to Muggle dashboard, if results were published}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Section 2 — Per-Test Highlights**
|
|
58
|
+
|
|
59
|
+
Order failures first, then passes.
|
|
60
|
+
|
|
61
|
+
For each **failed** test:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
### {Test Name} — FAIL
|
|
65
|
+
- **Blocking issue:** {What went wrong from the user's perspective. Describe the observable symptom — what the user sees or doesn't see.}
|
|
66
|
+
- **Suggested fix:** {What the coding agent should investigate. Reference UI flows and components, not specific file paths — the acceptance tester operates at the UI layer.}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For each **passed** test, list the name only:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
### {Test Name} — PASS
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### When Importing Tests
|
|
76
|
+
|
|
77
|
+
Report:
|
|
78
|
+
- What was imported — count of use cases and test cases, source format, target project
|
|
79
|
+
- Any skipped or failed imports with reasons
|
|
80
|
+
- Suggested next step (e.g., "run the imported tests to verify")
|
|
81
|
+
|
|
82
|
+
### When Managing Preferences
|
|
83
|
+
|
|
84
|
+
Report:
|
|
85
|
+
- Current preference values (if listing)
|
|
86
|
+
- Confirmation of the change (if setting or resetting)
|
|
87
|
+
|
|
88
|
+
### When Checking Status or Repairing
|
|
89
|
+
|
|
90
|
+
Report:
|
|
91
|
+
- Component-by-component health status
|
|
92
|
+
- Actions taken (for repair)
|
|
93
|
+
- Recommendations
|
|
94
|
+
|
|
95
|
+
## Behavior Rules
|
|
96
|
+
|
|
97
|
+
1. **Always run tests before reporting.** Never speculate on whether something passes or fails.
|
|
98
|
+
2. **Report ALL failures.** Do not stop at the first failure or summarize multiple failures into one.
|
|
99
|
+
3. **Describe problems from the user's perspective.** "The checkout button is not clickable after adding an item to the cart" — not "onClick handler missing on Button component in CartPage.tsx."
|
|
100
|
+
4. **Do not modify application code.** Report findings; coding agents act on them.
|
|
101
|
+
5. **Do not decide when to run.** The orchestrator dispatches; you execute and report.
|
|
102
|
+
6. **Do not choose local vs remote.** The `muggle-test` skill handles routing based on the target URL and user preferences.
|
|
103
|
+
7. **Use skills, not raw MCP tools.** The orchestrator pastes the full skill text into your dispatch prompt. Follow the skill's instructions exactly.
|
|
@@ -64,7 +64,43 @@ version_check() {
|
|
|
64
64
|
}
|
|
65
65
|
version_check || true
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
# --- Preferences injection ---
|
|
68
|
+
prefs_global_file="${HOME}/.muggle-ai/preferences.json"
|
|
69
|
+
prefs_line=""
|
|
70
|
+
prefs_file_note=""
|
|
71
|
+
|
|
72
|
+
if [ -f "$prefs_global_file" ]; then
|
|
73
|
+
# Extract preferences object keys and values into a compact one-liner.
|
|
74
|
+
# Uses node for reliable JSON parsing (already required for muggle).
|
|
75
|
+
prefs_line=$(node -e "
|
|
76
|
+
const fs = require('fs');
|
|
77
|
+
try {
|
|
78
|
+
const g = JSON.parse(fs.readFileSync('${prefs_global_file}', 'utf-8')).preferences || {};
|
|
79
|
+
const defaults = {
|
|
80
|
+
autoLogin:'ask', autoSelectProject:'ask', showElectronBrowser:'ask',
|
|
81
|
+
openTestResultsAfterRun:'ask', defaultExecutionMode:'ask', autoPublishLocalResults:'ask',
|
|
82
|
+
suggestRelatedUseCases:'ask', suggestRelatedTestCases:'ask', autoDetectChanges:'ask',
|
|
83
|
+
postPRVisualWalkthrough:'ask', checkForUpdates:'ask', verboseOutput:'ask'
|
|
84
|
+
};
|
|
85
|
+
const cwd = process.env.CLAUDE_CWD || process.env.CURSOR_CWD || process.cwd();
|
|
86
|
+
const pPath = require('path').join(cwd, '.muggle-ai', 'preferences.json');
|
|
87
|
+
let p = {};
|
|
88
|
+
try { p = JSON.parse(fs.readFileSync(pPath, 'utf-8')).preferences || {}; } catch {}
|
|
89
|
+
const merged = { ...defaults, ...g, ...p };
|
|
90
|
+
const hasProject = Object.keys(p).length > 0;
|
|
91
|
+
const note = hasProject ? ', project overrides active' : '';
|
|
92
|
+
const line = Object.entries(merged).map(([k,v]) => k+'='+v).join(' ');
|
|
93
|
+
console.log('Muggle Preferences (~/.muggle-ai/preferences.json' + note + '):\\\\n' + line);
|
|
94
|
+
} catch { console.log(''); }
|
|
95
|
+
" 2>/dev/null || true)
|
|
96
|
+
if [ -n "$prefs_line" ]; then
|
|
97
|
+
prefs_file_note="\\n\\n${prefs_line}"
|
|
98
|
+
fi
|
|
99
|
+
else
|
|
100
|
+
prefs_file_note="\\n\\nMuggle Preferences: not configured. Run \\\`muggle setup\\\` or tell the agent to set preferences."
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
context="<EXTREMELY_IMPORTANT>\nYou have access to Muggle AI — a real-browser E2E acceptance testing tool.\n\nWhenever the user asks you to test, validate, verify, or check if their web app works — use the muggle MCP tools. This includes:\n- Testing user flows (signup, login, checkout, forms, dashboards)\n- Verifying UI changes didn't break anything\n- Running regression tests after code changes\n- Validating frontend behavior on localhost or a dev server\n- Checking if a feature works before merging a PR\n\nMuggle launches a real Electron browser that clicks buttons, fills forms, navigates pages, and captures screenshots. It generates replayable test scripts that persist across sessions.\n\nDo NOT write test code (Playwright, Cypress, Selenium) or try to test UI manually when muggle tools are available. Use the muggle skill or muggle MCP tools instead — they are faster, capture visual evidence, and produce reusable test scripts.\n\nTrigger phrases: 'test my app', 'check if it works', 'run E2E acceptance tests', 'validate the UI', 'verify the flow', 'regression test', 'make sure it still works', 'test before merging'.\n</EXTREMELY_IMPORTANT>${upgrade_notice}${prefs_file_note}"
|
|
68
104
|
|
|
69
105
|
escaped_context=$(escape_for_json "$context")
|
|
70
106
|
|
|
@@ -7,15 +7,30 @@ description: Muggle AI command router and menu. Use when user types "muggle" or
|
|
|
7
7
|
|
|
8
8
|
Use this as the top-level Muggle command router.
|
|
9
9
|
|
|
10
|
+
## Preferences
|
|
11
|
+
|
|
12
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
13
|
+
|
|
14
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
15
|
+
|
|
16
|
+
When you reach a decision gated by a preference:
|
|
17
|
+
- **`always`** → proceed without asking the user
|
|
18
|
+
- **`never`** → skip without asking the user
|
|
19
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
20
|
+
|
|
21
|
+
This skill uses these preferences:
|
|
22
|
+
|
|
23
|
+
| Preference | Decision it gates |
|
|
24
|
+
|------------|------------------|
|
|
25
|
+
| `checkForUpdates` | Check for newer Muggle version |
|
|
26
|
+
|
|
10
27
|
## Menu
|
|
11
28
|
|
|
12
|
-
When user asks for "muggle" with no specific subcommand, use `AskQuestion` to present
|
|
29
|
+
When user asks for "muggle" with no specific subcommand, use `AskQuestion` to present these four options:
|
|
13
30
|
|
|
14
|
-
- "Test
|
|
15
|
-
- "
|
|
16
|
-
- "
|
|
17
|
-
- "Health check — verify installation status" → `muggle-status`
|
|
18
|
-
- "Repair — fix broken installation" → `muggle-repair`
|
|
31
|
+
- "Test a feature — run E2E acceptance tests locally or remotely" → `muggle-test-feature-local` (local) or `muggle-test` (remote/change-driven)
|
|
32
|
+
- "Build something — implement a feature with E2E acceptance tests and a visual PR" → `muggle-do`
|
|
33
|
+
- "Health check — verify installation and fix issues" → `muggle-status` (then `muggle-repair` if issues found)
|
|
19
34
|
- "Upgrade — update to latest version" → `muggle-upgrade`
|
|
20
35
|
|
|
21
36
|
## Routing
|
|
@@ -26,7 +41,8 @@ If the user intent clearly matches one command, route directly — no menu neede
|
|
|
26
41
|
- repair/fix/install broken → `muggle-repair`
|
|
27
42
|
- upgrade/update latest → `muggle-upgrade`
|
|
28
43
|
- test my changes/acceptance test my work/test before push/post E2E acceptance results to PR/test on staging/test on preview → `muggle-test`
|
|
29
|
-
- test localhost/validate single feature → `muggle-test-feature-local`
|
|
30
|
-
- build/implement from request → `muggle-do`
|
|
44
|
+
- test localhost/validate single feature/test a feature → `muggle-test-feature-local`
|
|
45
|
+
- build/implement from request/end-to-end → `muggle-do`
|
|
46
|
+
- post results to PR/attach walkthrough/visual evidence on PR → `muggle-pr-visual-walkthrough`
|
|
31
47
|
|
|
32
48
|
If intent is ambiguous, use `AskQuestion` with the most likely options rather than asking the user to type a clarification.
|
|
@@ -17,6 +17,23 @@ This is the **canonical PR-walkthrough workflow** shared across every Muggle ent
|
|
|
17
17
|
|
|
18
18
|
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
19
|
|
|
20
|
+
## Preferences
|
|
21
|
+
|
|
22
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
23
|
+
|
|
24
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
25
|
+
|
|
26
|
+
When you reach a decision gated by a preference:
|
|
27
|
+
- **`always`** → proceed without asking the user
|
|
28
|
+
- **`never`** → skip without asking the user
|
|
29
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
30
|
+
|
|
31
|
+
This skill uses these preferences:
|
|
32
|
+
|
|
33
|
+
| Preference | Decision it gates |
|
|
34
|
+
|------------|------------------|
|
|
35
|
+
| `postPRVisualWalkthrough` | Post visual walkthrough to PR |
|
|
36
|
+
|
|
20
37
|
## Input contract: the `E2eReport` JSON
|
|
21
38
|
|
|
22
39
|
Every caller must build an `E2eReport` JSON object and have it in conversation context before invoking this skill. The schema is defined in `src/cli/pr-section/types.ts` (`E2eReportSchema`) and enforced by the CLI with Zod — malformed input exits non-zero with a descriptive stderr message.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: muggle-preferences
|
|
3
|
+
description: >-
|
|
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
|
|
6
|
+
defaults, or manage muggle config. Triggers on: 'muggle preferences',
|
|
7
|
+
'show muggle settings', 'change muggle preference', 'set autoLogin to
|
|
8
|
+
always', 'muggle config', 'reset muggle preferences', 'show my muggle
|
|
9
|
+
settings', 'configure muggle'.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Muggle Preferences
|
|
13
|
+
|
|
14
|
+
View, set, or reset the preference knobs that control Muggle AI behavior.
|
|
15
|
+
|
|
16
|
+
## Operations
|
|
17
|
+
|
|
18
|
+
Parse the user's request to determine which operation to perform:
|
|
19
|
+
|
|
20
|
+
- **List** — user wants to see current values (default when no specific change requested)
|
|
21
|
+
- **Set** — user wants to change a specific preference
|
|
22
|
+
- **Reset** — user wants to restore a preference (or all preferences) to defaults
|
|
23
|
+
|
|
24
|
+
## List
|
|
25
|
+
|
|
26
|
+
1. Read preferences from session context. Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
27
|
+
|
|
28
|
+
If no preferences line is present, treat all preferences as `"ask"` (the default).
|
|
29
|
+
|
|
30
|
+
2. Present all 12 preferences in a table:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Muggle AI — Preferences
|
|
34
|
+
|
|
35
|
+
| Preference | Value | Description |
|
|
36
|
+
|--------------------------|--------|----------------------------------------------------------|
|
|
37
|
+
| autoLogin | ask | Reuse saved credentials without prompting |
|
|
38
|
+
| autoSelectProject | ask | Reuse last-used project for this repo |
|
|
39
|
+
| showElectronBrowser | ask | Show browser window during local tests |
|
|
40
|
+
| openTestResultsAfterRun | ask | Open results page on dashboard after local test |
|
|
41
|
+
| defaultExecutionMode | ask | Default to local or remote test execution |
|
|
42
|
+
| autoPublishLocalResults | ask | Upload local results to Muggle cloud |
|
|
43
|
+
| suggestRelatedUseCases | ask | Suggest related use cases after creating/running one |
|
|
44
|
+
| suggestRelatedTestCases | ask | Suggest related test cases after creating/running one |
|
|
45
|
+
| autoDetectChanges | ask | Scan local git changes and map to affected test cases |
|
|
46
|
+
| postPRVisualWalkthrough | ask | Post visual walkthrough with screenshots to PR |
|
|
47
|
+
| checkForUpdates | ask | Check for newer Muggle version at session start |
|
|
48
|
+
| verboseOutput | ask | Show detailed progress logs during execution |
|
|
49
|
+
|
|
50
|
+
Values: always (proceed without asking) · ask (prompt each time) · never (skip without asking)
|
|
51
|
+
Scope: global (~/.muggle-ai/) or project (.muggle-ai/ in repo root)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Set
|
|
55
|
+
|
|
56
|
+
1. Parse the requested key and value from the user's message.
|
|
57
|
+
|
|
58
|
+
2. Validate the key is one of: `autoLogin`, `autoSelectProject`, `showElectronBrowser`, `openTestResultsAfterRun`, `defaultExecutionMode`, `autoPublishLocalResults`, `suggestRelatedUseCases`, `suggestRelatedTestCases`, `autoDetectChanges`, `postPRVisualWalkthrough`, `checkForUpdates`, `verboseOutput`.
|
|
59
|
+
|
|
60
|
+
If the key is ambiguous or not recognized, show the full list and ask the user to clarify.
|
|
61
|
+
|
|
62
|
+
3. Validate the value is one of: `always`, `ask`, `never`.
|
|
63
|
+
|
|
64
|
+
4. Determine scope:
|
|
65
|
+
- Default to `global`.
|
|
66
|
+
- If the user says "for this project", "project-level", or "just this repo", use `project` scope and pass `cwd` as the current working directory.
|
|
67
|
+
|
|
68
|
+
5. Call `muggle-local-preferences-set` with:
|
|
69
|
+
- `key`: The preference key
|
|
70
|
+
- `value`: The chosen value
|
|
71
|
+
- `scope`: `"global"` or `"project"`
|
|
72
|
+
- `cwd`: Current working directory (required when scope is `"project"`)
|
|
73
|
+
|
|
74
|
+
6. Confirm: `Set {key} to {value} ({scope}).`
|
|
75
|
+
|
|
76
|
+
## Reset
|
|
77
|
+
|
|
78
|
+
1. If the user asks to reset a **specific key**: call `muggle-local-preferences-set` with `value: "ask"` for that key.
|
|
79
|
+
|
|
80
|
+
2. If the user asks to reset **all preferences**: call `muggle-local-preferences-set` for each of the 12 keys with `value: "ask"`.
|
|
81
|
+
|
|
82
|
+
3. Confirm what was reset.
|
|
@@ -7,6 +7,23 @@ description: Check health of the Muggle AI installation. Use when user types mug
|
|
|
7
7
|
|
|
8
8
|
Run a full health check and report results.
|
|
9
9
|
|
|
10
|
+
## Preferences
|
|
11
|
+
|
|
12
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
13
|
+
|
|
14
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
15
|
+
|
|
16
|
+
When you reach a decision gated by a preference:
|
|
17
|
+
- **`always`** → proceed without asking the user
|
|
18
|
+
- **`never`** → skip without asking the user
|
|
19
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
20
|
+
|
|
21
|
+
This skill uses these preferences:
|
|
22
|
+
|
|
23
|
+
| Preference | Decision it gates |
|
|
24
|
+
|------------|------------------|
|
|
25
|
+
| `checkForUpdates` | Check for newer Muggle version |
|
|
26
|
+
|
|
10
27
|
## Checks
|
|
11
28
|
|
|
12
29
|
1. **Electron app** — read `~/.muggle-ai/electron-app/` to find the installed version directory. Read `.install-metadata.json` to get version and checksum. Verify the binary exists at the expected path. On macOS, check code signing with `spctl --assess --verbose`.
|
|
@@ -32,6 +32,28 @@ Every test case verifies exactly **one** user-observable behavior. Never bundle
|
|
|
32
32
|
|
|
33
33
|
**Never skip the generate→review cycle.** Even when you are 100% confident about the right shape, always present the generated test cases to the user before calling `muggle-remote-test-case-create`. "I'll skip the generate→review cycle and create directly" is a sign you're about to get it wrong.
|
|
34
34
|
|
|
35
|
+
## Preferences
|
|
36
|
+
|
|
37
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
38
|
+
|
|
39
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
40
|
+
|
|
41
|
+
When you reach a decision gated by a preference:
|
|
42
|
+
- **`always`** → proceed without asking the user
|
|
43
|
+
- **`never`** → skip without asking the user
|
|
44
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
45
|
+
|
|
46
|
+
This skill uses these preferences:
|
|
47
|
+
|
|
48
|
+
| Preference | Decision it gates |
|
|
49
|
+
|------------|------------------|
|
|
50
|
+
| `autoLogin` | Reuse saved credentials when auth is required |
|
|
51
|
+
| `autoSelectProject` | Reuse last-used Muggle project for this repo |
|
|
52
|
+
| `autoDetectChanges` | Scan local git changes and map to affected test cases |
|
|
53
|
+
| `defaultExecutionMode` | Default to local or remote test execution |
|
|
54
|
+
| `autoPublishLocalResults` | Upload local results to Muggle cloud after run |
|
|
55
|
+
| `postPRVisualWalkthrough` | Post visual walkthrough to PR after results are available |
|
|
56
|
+
|
|
35
57
|
## Step 1: Confirm Scope of Work (Always First)
|
|
36
58
|
|
|
37
59
|
Parse the user's query and explicitly confirm their expectation. There are exactly two modes:
|
|
@@ -418,3 +440,7 @@ This skill always uses **Mode A** (post to an existing PR); `muggle-do` is the o
|
|
|
418
440
|
- **Always publish before opening browser** — the dashboard needs the published data to show results
|
|
419
441
|
- **Delegate PR posting to `muggle-pr-visual-walkthrough`** — never inline the walkthrough markdown or call `gh pr comment` directly from this skill; ask the user and hand off
|
|
420
442
|
- **Can be invoked at any state** — if the user already has a project or use cases set up, skip to the relevant step rather than re-doing everything
|
|
443
|
+
|
|
444
|
+
## Agent Dispatch
|
|
445
|
+
|
|
446
|
+
When used in a multi-agent team (e.g., muggle-ai-teams), this skill is available through the **acceptance-tester** agent at `plugin/agents/acceptance-tester.md`. Orchestrators can dispatch it via `Agent()` instead of invoking this skill directly. The agent wraps this skill and four others (muggle-test-import, muggle-preferences, muggle-repair, muggle-status) and returns structured test results with blocking issues and suggested fixes for coding agents to act on.
|
|
@@ -22,6 +22,26 @@ The local URL only changes where the browser opens; it does not change the remot
|
|
|
22
22
|
- **Selections** (project, use case, test case, script): Use `AskQuestion` with labeled options the user can click.
|
|
23
23
|
- **Free-text inputs** (URLs, descriptions): Only use plain text prompts when there is no finite set of options. Even then, offer a detected/default value when possible.
|
|
24
24
|
|
|
25
|
+
## Preferences
|
|
26
|
+
|
|
27
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
28
|
+
|
|
29
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
30
|
+
|
|
31
|
+
When you reach a decision gated by a preference:
|
|
32
|
+
- **`always`** → proceed without asking the user
|
|
33
|
+
- **`never`** → skip without asking the user
|
|
34
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
35
|
+
|
|
36
|
+
This skill uses these preferences:
|
|
37
|
+
|
|
38
|
+
| Preference | Decision it gates |
|
|
39
|
+
|------------|------------------|
|
|
40
|
+
| `autoLogin` | Reuse saved credentials when auth is required |
|
|
41
|
+
| `autoSelectProject` | Reuse last-used Muggle project for this repo |
|
|
42
|
+
| `showElectronBrowser` | Show Electron browser window during local E2E tests |
|
|
43
|
+
| `openTestResultsAfterRun` | Open results page on Muggle dashboard after run |
|
|
44
|
+
|
|
25
45
|
## Workflow
|
|
26
46
|
|
|
27
47
|
### 1. Auth
|
|
@@ -65,9 +85,20 @@ Prompt for projects: "Pick the project to group this test into:"
|
|
|
65
85
|
2. `muggle-remote-use-case-create-from-prompts` with `projectId` and `instructions: ["<the user's natural-language instruction>"]` — persist. Use the created use case id and continue to test-case selection.
|
|
66
86
|
- **Test case — Create new test case** (requires a chosen `useCaseId`): User provides an instruction describing what to test.
|
|
67
87
|
1. `muggle-remote-test-case-generate-from-prompt` with `projectId`, `useCaseId`, `instruction` — **preview only** (server test-case prompt preview); show the returned draft(s); get confirmation via `AskQuestion`.
|
|
68
|
-
2. Persist the accepted draft with `muggle-remote-test-case-create`, mapping preview fields into the required properties (`title`, `description`, `goal`, `expectedResult`, `url`, etc.). Then continue from **section
|
|
88
|
+
2. Persist the accepted draft with `muggle-remote-test-case-create`, mapping preview fields into the required properties (`title`, `description`, `goal`, `expectedResult`, `url`, etc.). Then continue from **section 5** with that `testCaseId`.
|
|
89
|
+
|
|
90
|
+
### 3. Ensure Local Services Are Ready
|
|
91
|
+
|
|
92
|
+
Before detecting the local URL, verify that the services the user needs are actually running. Use the `muggle:muggle-test-prepare` integration contract:
|
|
93
|
+
|
|
94
|
+
1. Check if `/tmp/muggle-test-prepare.json` exists.
|
|
95
|
+
2. If it exists, verify tracked PIDs are alive with `kill -0`.
|
|
96
|
+
3. If all live → services are ready, proceed to Step 4 (Local URL).
|
|
97
|
+
4. If the file is missing or has stale PIDs → invoke the `muggle:muggle-test-prepare` skill via the `Skill` tool to get services started. Once it completes, proceed to Step 4.
|
|
98
|
+
|
|
99
|
+
This step is especially important when the user's app depends on sibling services (a backend API, an auth service, etc.) that may not be running yet. The prepare skill handles discovery, startup, and cleanup so this skill doesn't have to.
|
|
69
100
|
|
|
70
|
-
###
|
|
101
|
+
### 4. Local URL
|
|
71
102
|
|
|
72
103
|
Try to auto-detect the dev server URL by checking running terminals or common ports (e.g., `lsof -iTCP -sTCP:LISTEN -nP | grep -E ':(3000|3001|4200|5173|8080)'`). If a likely URL is found, present it as a clickable default via `AskQuestion`:
|
|
73
104
|
- Option 1: "http://localhost:3000" (or whatever was detected)
|
|
@@ -77,14 +108,14 @@ If nothing detected, ask as free text: "Your local app should be running. What's
|
|
|
77
108
|
|
|
78
109
|
Remind them: local URL is only the execution target, not tied to cloud project config.
|
|
79
110
|
|
|
80
|
-
###
|
|
111
|
+
### 5. Existing scripts vs new generation
|
|
81
112
|
|
|
82
113
|
`muggle-remote-test-script-list` with `testCaseId`.
|
|
83
114
|
|
|
84
115
|
- **If any replayable/succeeded scripts exist:** use `AskQuestion` to present them as clickable options. Show: name, created/updated, step count per option. Include **"Generate new script"** as the last option.
|
|
85
116
|
- **If none:** go straight to generation (no need to ask replay vs generate).
|
|
86
117
|
|
|
87
|
-
###
|
|
118
|
+
### 6. Load data for the chosen path
|
|
88
119
|
|
|
89
120
|
**Determine `freshSession`**
|
|
90
121
|
|
|
@@ -122,39 +153,39 @@ The MCP client often uses a **default wait of 300000 ms (5 minutes)** for `muggl
|
|
|
122
153
|
- **`Electron execution timed out after 300000ms`:** Orchestration wait too short — see **`timeoutMs`** above.
|
|
123
154
|
- **Exit code 26** (and messages like **LLM failed to generate / replay action script**): Often corresponds to a completed exploration whose **outcome was goal not achievable** (`goal_not_achievable`, summary with `halt`) — e.g. verifying "view script after a successful run" when **no run or script exists yet** in the UI. Use `muggle-local-run-result-get` and read the **summary / structured summary**; do not assume an Electron crash. **Fix:** choose a **project that already has** completed runs and scripts, or **change the test case** so preconditions match what localhost can satisfy (e.g. include steps to create and run a test first, or assert only empty-state UI when no runs exist).
|
|
124
155
|
|
|
125
|
-
###
|
|
156
|
+
### 7. Execute (no approval prompt)
|
|
126
157
|
|
|
127
158
|
Call `muggle-local-execute-test-generation` or `muggle-local-execute-replay` directly. **Do not** ask the user to re-approve the Electron launch — the user choosing this skill in the first place is the approval. The browser defaults to visible; only pass `showUi: false` if the user explicitly asked for headless.
|
|
128
159
|
|
|
129
|
-
###
|
|
160
|
+
### 8. After successful generation only
|
|
130
161
|
|
|
131
162
|
- `muggle-local-publish-test-script`
|
|
132
163
|
- Open returned `viewUrl` for the user (`open "<viewUrl>"` on macOS or OS equivalent).
|
|
133
164
|
|
|
134
|
-
###
|
|
165
|
+
### 9. Report
|
|
135
166
|
|
|
136
167
|
- `muggle-local-run-result-get` with the run id from execute.
|
|
137
168
|
- Include: status, duration, pass/fail summary, per-step summary, artifact/screenshot paths, errors if failed, and script view URL when publishing ran.
|
|
138
169
|
|
|
139
|
-
###
|
|
170
|
+
### 10. Offer to post a visual walkthrough to the PR
|
|
140
171
|
|
|
141
|
-
After reporting results, gather the required input and hand off to the shared **`muggle-pr-visual-walkthrough`** skill, which renders the walkthrough via `muggle build-pr-section` and posts it to the current branch's open PR.
|
|
172
|
+
After reporting results, gather the required input and hand off to the shared **`muggle:muggle-pr-visual-walkthrough`** skill, which renders the walkthrough via `muggle build-pr-section` and posts it to the current branch's open PR.
|
|
142
173
|
|
|
143
|
-
####
|
|
174
|
+
#### 10a: Gather per-step screenshots
|
|
144
175
|
|
|
145
|
-
The shared skill takes an **`E2eReport` JSON** that includes per-step screenshot URLs. After step
|
|
176
|
+
The shared skill takes an **`E2eReport` JSON** that includes per-step screenshot URLs. After step 8 has called `muggle-local-publish-test-script` and you have the `testScriptId`:
|
|
146
177
|
|
|
147
178
|
1. Call `muggle-remote-test-script-get` with the `testScriptId`.
|
|
148
179
|
2. Extract per step: `steps[].operation.action` and `steps[].operation.screenshotUrl`.
|
|
149
180
|
3. Build the `steps` array: `[{ stepIndex: 0, action: "...", screenshotUrl: "..." }, ...]`.
|
|
150
|
-
4. If the run failed, capture `failureStepIndex`, `error`, and the local `artifactsDir` from the run result in step
|
|
181
|
+
4. If the run failed, capture `failureStepIndex`, `error`, and the local `artifactsDir` from the run result in step 9.
|
|
151
182
|
5. Populate `description` (test case title/description) and `useCaseName` (parent use case title) on the 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. the test case you just created or selected, or the use case you confirmed); only call `muggle-remote-test-case-get` / `muggle-remote-use-case-get` for anything you don't already have.
|
|
152
183
|
|
|
153
184
|
Assemble the `E2eReport`:
|
|
154
185
|
|
|
155
186
|
```json
|
|
156
187
|
{
|
|
157
|
-
"projectId": "<projectId from step 2>",
|
|
188
|
+
"projectId": "<projectId from step 2 (Targets)>",
|
|
158
189
|
"tests": [
|
|
159
190
|
{
|
|
160
191
|
"name": "<test case title>",
|
|
@@ -171,9 +202,9 @@ Assemble the `E2eReport`:
|
|
|
171
202
|
}
|
|
172
203
|
```
|
|
173
204
|
|
|
174
|
-
See the `muggle-pr-visual-walkthrough` skill for the full schema including the failed-test shape.
|
|
205
|
+
See the `muggle:muggle-pr-visual-walkthrough` skill for the full schema including the failed-test shape.
|
|
175
206
|
|
|
176
|
-
####
|
|
207
|
+
#### 10b: Ask the user
|
|
177
208
|
|
|
178
209
|
Use `AskQuestion`:
|
|
179
210
|
|
|
@@ -182,11 +213,11 @@ Use `AskQuestion`:
|
|
|
182
213
|
- Option 1: "Yes, post to PR"
|
|
183
214
|
- Option 2: "Skip"
|
|
184
215
|
|
|
185
|
-
####
|
|
216
|
+
#### 10c: Invoke the shared skill in Mode A
|
|
186
217
|
|
|
187
|
-
If the user chooses "Yes, post to PR", invoke the `muggle-pr-visual-walkthrough` skill via the `Skill` tool. With the `E2eReport` in context, the skill renders the markdown block via the CLI, finds the PR via `gh pr view`, posts `body` as a comment, posts the overflow `comment` only if the CLI emitted one, and confirms the PR URL to the user.
|
|
218
|
+
If the user chooses "Yes, post to PR", invoke the `muggle:muggle-pr-visual-walkthrough` skill via the `Skill` tool. With the `E2eReport` in context, the skill renders the markdown block via the CLI, finds the PR via `gh pr view`, posts `body` as a comment, posts the overflow `comment` only if the CLI emitted one, and confirms the PR URL to the user.
|
|
188
219
|
|
|
189
|
-
Always use **Mode A** (post to existing PR) from this skill. Never hand-write the walkthrough markdown or call `gh pr comment` directly — delegate to `muggle-pr-visual-walkthrough`.
|
|
220
|
+
Always use **Mode A** (post to existing PR) from this skill. Never hand-write the walkthrough markdown or call `gh pr comment` directly — delegate to `muggle:muggle-pr-visual-walkthrough`.
|
|
190
221
|
|
|
191
222
|
## Non-negotiables
|
|
192
223
|
|
|
@@ -197,4 +228,4 @@ Always use **Mode A** (post to existing PR) from this skill. Never hand-write th
|
|
|
197
228
|
- Replay: never hand-built or simplified `actionScript` — only from `muggle-remote-action-script-get`.
|
|
198
229
|
- Use `AskQuestion` for every selection — project, use case, test case, script. Never ask the user to type a number.
|
|
199
230
|
- Project, use case, and test case selection lists must always include "Create new ...". Include "Show full list" whenever the API returned at least one row for that step; omit "Show full list" when the list is empty (offer "Create new ..." only). For creates, use preview tools (`muggle-remote-use-case-prompt-preview`, `muggle-remote-test-case-generate-from-prompt`) before persisting.
|
|
200
|
-
- PR posting is always optional and always delegated to the `muggle-pr-visual-walkthrough` skill — never inline the walkthrough markdown or call `gh pr comment` directly from this skill.
|
|
231
|
+
- PR posting is always optional and always delegated to the `muggle:muggle-pr-visual-walkthrough` skill — never inline the walkthrough markdown or call `gh pr comment` directly from this skill.
|
|
@@ -18,6 +18,26 @@ This skill migrates existing test artifacts into Muggle Test. It reads your sour
|
|
|
18
18
|
structures them into use cases and test cases, gets your approval, then creates everything
|
|
19
19
|
in a Muggle project via the API.
|
|
20
20
|
|
|
21
|
+
## Preferences
|
|
22
|
+
|
|
23
|
+
User preferences are available in the session context (injected at session start). Look for the line starting with `Muggle Preferences` — it contains key=value pairs like `autoLogin=ask showElectronBrowser=always ...`.
|
|
24
|
+
|
|
25
|
+
If no preferences line is present, treat all preferences as `"ask"`.
|
|
26
|
+
|
|
27
|
+
When you reach a decision gated by a preference:
|
|
28
|
+
- **`always`** → proceed without asking the user
|
|
29
|
+
- **`never`** → skip without asking the user
|
|
30
|
+
- **`ask`** → ask the user, then offer: "Want me to remember this choice for future sessions?" If yes, call `muggle-local-preferences-set` with the key, their chosen value, and scope `global`.
|
|
31
|
+
|
|
32
|
+
This skill uses these preferences:
|
|
33
|
+
|
|
34
|
+
| Preference | Decision it gates |
|
|
35
|
+
|------------|------------------|
|
|
36
|
+
| `autoLogin` | Reuse saved credentials when auth is required |
|
|
37
|
+
| `autoSelectProject` | Reuse last-used Muggle project for this repo |
|
|
38
|
+
| `suggestRelatedUseCases` | Suggest related use cases after import |
|
|
39
|
+
| `suggestRelatedTestCases` | Suggest related test cases after import |
|
|
40
|
+
|
|
21
41
|
## Concepts
|
|
22
42
|
|
|
23
43
|
- **Use case**: A high-level feature or user workflow (e.g., "User Registration", "Checkout Flow")
|