@muggleai/works 2.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +276 -241
  2. package/dist/{chunk-O6JAG3WQ.js → chunk-YPRFUVHP.js} +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/plugin/.claude-plugin/plugin.json +20 -0
  6. package/dist/plugin/.cursor-plugin/plugin.json +21 -0
  7. package/dist/plugin/.mcp.json +12 -0
  8. package/dist/plugin/README.md +53 -0
  9. package/dist/plugin/hooks/hooks.json +14 -0
  10. package/dist/plugin/scripts/ensure-electron-app.sh +12 -0
  11. package/dist/plugin/skills/do/SKILL.md +49 -0
  12. package/dist/plugin/skills/do/impact-analysis.md +34 -0
  13. package/dist/plugin/skills/do/open-prs.md +52 -0
  14. package/dist/plugin/skills/do/qa.md +89 -0
  15. package/dist/plugin/skills/do/requirements.md +33 -0
  16. package/dist/plugin/skills/do/unit-tests.md +31 -0
  17. package/dist/plugin/skills/do/validate-code.md +30 -0
  18. package/dist/plugin/skills/repair/SKILL.md +23 -0
  19. package/dist/plugin/skills/status/SKILL.md +30 -0
  20. package/dist/plugin/skills/test-feature-local/SKILL.md +91 -0
  21. package/dist/plugin/skills/upgrade/SKILL.md +21 -0
  22. package/package.json +10 -6
  23. package/plugin/.claude-plugin/plugin.json +20 -0
  24. package/plugin/.cursor-plugin/plugin.json +21 -0
  25. package/plugin/.mcp.json +12 -0
  26. package/plugin/README.md +53 -0
  27. package/plugin/hooks/hooks.json +14 -0
  28. package/plugin/scripts/ensure-electron-app.sh +12 -0
  29. package/plugin/skills/do/SKILL.md +49 -0
  30. package/plugin/skills/do/impact-analysis.md +34 -0
  31. package/plugin/skills/do/open-prs.md +52 -0
  32. package/plugin/skills/do/qa.md +89 -0
  33. package/plugin/skills/do/requirements.md +33 -0
  34. package/plugin/skills/do/unit-tests.md +31 -0
  35. package/plugin/skills/do/validate-code.md +30 -0
  36. package/plugin/skills/repair/SKILL.md +23 -0
  37. package/plugin/skills/status/SKILL.md +30 -0
  38. package/plugin/skills/test-feature-local/SKILL.md +91 -0
  39. package/plugin/skills/upgrade/SKILL.md +21 -0
  40. package/scripts/postinstall.mjs +0 -267
  41. package/skills-dist/muggle-do.md +0 -589
  42. package/skills-dist/publish-test-to-cloud.md +0 -43
  43. package/skills-dist/test-feature-local.md +0 -344
@@ -5090,7 +5090,7 @@ var testScriptGetTool = {
5090
5090
  };
5091
5091
  var executeTestGenerationTool = {
5092
5092
  name: "muggle-local-execute-test-generation",
5093
- description: "Execute test script generation for a test case. First call qa_test_case_get to get test case details, then pass them here along with the localhost URL. Requires explicit approval before launching electron-app in explore mode. By default runs headless; set showUi: true to display the electron-app UI.",
5093
+ description: "Execute test script generation for a test case. First call qa_test_case_get to get test case details, then pass them here along with the localhost URL. Requires explicit approval before launching electron-app in explore mode. By default runs headless unless user explicitly asks for UI.",
5094
5094
  inputSchema: ExecuteTestGenerationInputSchema,
5095
5095
  execute: async (ctx) => {
5096
5096
  const logger14 = createChildLogger2(ctx.correlationId);
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-O6JAG3WQ.js';
2
+ import { runCli } from './chunk-YPRFUVHP.js';
3
3
 
4
4
  // src/cli/main.ts
5
5
  runCli().catch((error) => {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { src_exports2 as commands, createChildLogger, createUnifiedMcpServer, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, qa_exports as qa, server_exports as server, src_exports as shared } from './chunk-O6JAG3WQ.js';
1
+ export { src_exports2 as commands, createChildLogger, createUnifiedMcpServer, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, qa_exports as qa, server_exports as server, src_exports as shared } from './chunk-YPRFUVHP.js';
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "muggle",
3
+ "description": "Ship quality products with AI-powered QA that validates your app's user experience — from Claude Code and Cursor to PR.",
4
+ "version": "3.0.0",
5
+ "author": {
6
+ "name": "Muggle AI",
7
+ "email": "support@muggle-ai.com"
8
+ },
9
+ "homepage": "https://www.muggletest.com",
10
+ "repository": "https://github.com/multiplex-ai/muggle-ai-works",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "qa",
14
+ "testing",
15
+ "mcp",
16
+ "browser-automation",
17
+ "ai-coding",
18
+ "muggle-ai"
19
+ ]
20
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "muggle",
3
+ "displayName": "Muggle AI",
4
+ "description": "Ship quality products with AI-powered QA that validates your app's user experience — from Claude Code and Cursor to PR.",
5
+ "version": "3.0.0",
6
+ "author": {
7
+ "name": "Muggle AI",
8
+ "email": "support@muggle-ai.com"
9
+ },
10
+ "homepage": "https://www.muggletest.com",
11
+ "repository": "https://github.com/multiplex-ai/muggle-ai-works",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "qa",
15
+ "testing",
16
+ "mcp",
17
+ "browser-automation",
18
+ "ai-coding",
19
+ "muggle-ai"
20
+ ]
21
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "muggle": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@muggleai/works",
8
+ "serve"
9
+ ]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,53 @@
1
+ # Muggle AI Plugin for Claude Code
2
+
3
+ Ship quality products with AI-powered QA that validates your app's user experience -- from Claude Code and Cursor to PR.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ /plugin marketplace add https://github.com/multiplex-ai/muggle-ai-works
9
+ /plugin install muggleai@muggle-works
10
+ ```
11
+
12
+ ## Skills
13
+
14
+ | Skill | What it does |
15
+ |:---|:---|
16
+ | `/muggle:do` | Autonomous dev pipeline: requirements, code, unit tests, QA, PR. |
17
+ | `/muggle:test-feature-local` | Test a feature on localhost with AI-driven browser automation. Offers publish to cloud after each run. |
18
+ | `/muggle:status` | Health check for Electron QA engine, MCP server, and authentication. |
19
+ | `/muggle:repair` | Diagnose and fix broken installation automatically. |
20
+ | `/muggle:upgrade` | Update Electron QA engine and MCP server to latest version. |
21
+
22
+ ## MCP Tools
23
+
24
+ The plugin ships an MCP server with 70+ tools for project management, test case generation, browser automation, and reporting. The server starts automatically when the plugin is enabled.
25
+
26
+ ## Hooks
27
+
28
+ A `SessionStart` hook ensures the Electron QA engine is downloaded and up to date.
29
+
30
+ ## Requirements
31
+
32
+ - Claude Code 1.0.33 or later
33
+ - Node.js 22+
34
+
35
+ ## Upgrade
36
+
37
+ ```
38
+ /plugin update muggleai@muggle-works
39
+ ```
40
+
41
+ ## Uninstall
42
+
43
+ ```
44
+ /plugin uninstall muggleai@muggle-works
45
+ ```
46
+
47
+ ## Links
48
+
49
+ - [MuggleTest](https://www.muggletest.com)
50
+ - [GitHub](https://github.com/multiplex-ai/muggle-ai-works)
51
+ ## License
52
+
53
+ MIT
@@ -0,0 +1,14 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/ensure-electron-app.sh\""
9
+ }
10
+ ]
11
+ }
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ # Ensure the Electron QA runtime is installed/up to date.
6
+ # This is intentionally best-effort so plugin startup is resilient.
7
+ if command -v muggle >/dev/null 2>&1; then
8
+ muggle setup >/dev/null 2>&1 || true
9
+ exit 0
10
+ fi
11
+
12
+ npx -y @muggleai/works setup >/dev/null 2>&1 || true
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: do
3
+ description: Unified Muggle AI workflow entry point. Routes to autonomous dev cycle, status, repair, or upgrade.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Muggle Do
8
+
9
+ Muggle Do is the top-level command for the Muggle AI development workflow.
10
+
11
+ It runs the autonomous dev cycle: requirements -> impact analysis -> validate code -> coding -> unit tests -> QA -> open PRs.
12
+
13
+ For maintenance tasks, use the dedicated skills: `/muggle:status`, `/muggle:repair`, `/muggle:upgrade`.
14
+
15
+ ## Input routing
16
+
17
+ Treat `$ARGUMENTS` as the user command:
18
+
19
+ - Empty / `help` / `menu` / `?` -> show menu and session selector.
20
+ - Anything else -> treat as a new task description and start/resume a dev-cycle session.
21
+
22
+ ## Session model
23
+
24
+ Use `.muggle-do/sessions/<slug>/` with these files:
25
+
26
+ - `state.md`
27
+ - `requirements.md`
28
+ - `iterations/<NNN>.md`
29
+ - `result.md`
30
+
31
+ On each stage transition, update `state.md` and append stage output to the active iteration file.
32
+
33
+ ## Dev cycle agents
34
+
35
+ Use the supporting files in this directory as stage-specific instructions:
36
+
37
+ - [requirements.md](requirements.md)
38
+ - [impact-analysis.md](impact-analysis.md)
39
+ - [validate-code.md](validate-code.md)
40
+ - [unit-tests.md](unit-tests.md)
41
+ - [qa.md](qa.md)
42
+ - [open-prs.md](open-prs.md)
43
+
44
+ ## Guardrails
45
+
46
+ - Do not skip unit tests before QA.
47
+ - Do not skip QA due to missing scripts; generate when needed.
48
+ - If the same stage fails 3 times in a row, escalate with details.
49
+ - If total iterations reach 3 and QA still fails, continue to PR creation with `[QA FAILING]`.
@@ -0,0 +1,34 @@
1
+ # Impact Analysis Agent
2
+
3
+ You are analyzing git repositories to determine which ones have actual code changes that need to go through the dev cycle pipeline.
4
+
5
+ ## Input
6
+
7
+ You receive:
8
+ - A list of repos with their local filesystem paths
9
+ - The requirements goal and affected repos from the requirements stage
10
+
11
+ ## Your Job
12
+
13
+ For each repo path provided:
14
+
15
+ 1. **Check the current branch:** Run `git branch --show-current` in the repo. If it returns empty (detached HEAD), report an error for that repo.
16
+ 2. **Detect the default branch:** Run `git symbolic-ref refs/remotes/origin/HEAD --short` to find the default branch (e.g., `origin/main`). Strip the `origin/` prefix. If this fails, check if `main` or `master` exist locally via `git rev-parse --verify`.
17
+ 3. **Verify it's a feature branch:** The current branch must NOT be the default branch. If it is, report an error.
18
+ 4. **List changed files:** Run `git diff --name-only <default-branch>...HEAD` to find files changed on this branch relative to the default branch. If no merge base exists, fall back to `git diff --name-only HEAD`.
19
+ 5. **Get the diff:** Run `git diff <default-branch>...HEAD` for the full diff.
20
+
21
+ ## Output
22
+
23
+ Report per repo:
24
+
25
+ **Repo: (name)**
26
+ - Branch: (current branch name)
27
+ - Default branch: (detected default branch)
28
+ - Changed files: (list)
29
+ - Diff summary: (brief description of what changed)
30
+ - Status: OK | ERROR (with reason)
31
+
32
+ **Summary:** (which repos have changes, which don't, any errors)
33
+
34
+ If NO repos have any changes, clearly state: "No changes detected in any repo."
@@ -0,0 +1,52 @@
1
+ # PR Creation Agent
2
+
3
+ You are creating pull requests for each repository that has changes after a successful dev cycle run.
4
+
5
+ ## Input
6
+
7
+ You receive:
8
+ - Per-repo: repo name, path, branch name
9
+ - Requirements: goal, acceptance criteria
10
+ - QA report: passed/failed test cases, each with testCaseId, testScriptId, runId, artifactsDir, and projectId
11
+
12
+ ## Your Job
13
+
14
+ For each repo with changes:
15
+
16
+ 1. **Push the branch** to origin: `git push -u origin <branch-name>` in the repo directory.
17
+ 2. **Build the PR title:**
18
+ - If QA has failures: `[QA FAILING] <goal>`
19
+ - Otherwise: `<goal>`
20
+ - Keep under 70 characters
21
+ 3. **Build the PR body** with these sections:
22
+ - `## Goal` — the requirements goal
23
+ - `## Acceptance Criteria` — bulleted list (omit section if empty)
24
+ - `## Changes` — summary of what changed in this repo
25
+ - `## QA Results` — full test case breakdown (see format below)
26
+ 4. **Create the PR** using `gh pr create --title "..." --body "..." --head <branch>` in the repo directory.
27
+ 5. **Capture the PR URL** from the output.
28
+
29
+ ## QA Results Section Format
30
+
31
+ ```
32
+ ## QA Results
33
+
34
+ **X passed / Y failed**
35
+
36
+ | Test Case | Status | Details |
37
+ |-----------|--------|---------|
38
+ | [Name](https://www.muggle-ai.com/muggleTestV0/dashboard/projects/{projectId}/scripts?modal=details&testCaseId={testCaseId}) | ✅ PASSED | — |
39
+ | [Name](https://www.muggle-ai.com/muggleTestV0/dashboard/projects/{projectId}/scripts?modal=details&testCaseId={testCaseId}) | ❌ FAILED | {error} — artifacts: `{artifactsDir}` |
40
+ ```
41
+
42
+ Rules:
43
+ - Link each test case name to its details page on www.muggle-ai.com using the URL pattern above (requires `testCaseId` and `projectId` from the QA report).
44
+ - For failed tests, include the error message and the local `artifactsDir` path so the developer can inspect screenshots.
45
+ - Screenshots are in `{artifactsDir}/screenshots/` and viewable locally.
46
+
47
+ ## Output
48
+
49
+ **PRs Created:**
50
+ - (repo name): (PR URL)
51
+
52
+ **Errors:** (any repos where PR creation failed, with the error message)
@@ -0,0 +1,89 @@
1
+ # QA Agent
2
+
3
+ You are running QA test cases against code changes using Muggle AI's local testing infrastructure.
4
+
5
+ ## Design
6
+
7
+ QA runs **locally** using the `test-feature-local` approach:
8
+ - `muggle-remote-*` tools manage cloud entities (auth, projects, test cases, scripts)
9
+ - `muggle-local-*` tools execute tests against the running local dev server
10
+
11
+ This guarantees QA always runs — no dependency on cloud replay service availability.
12
+
13
+ ## Input
14
+
15
+ You receive:
16
+ - The Muggle project ID
17
+ - The list of changed repos, files, and a summary of changes
18
+ - The requirements goal
19
+ - `localUrl` per repo (from `muggle-repos.json`) — the locally running dev server URL
20
+
21
+ ## Your Job
22
+
23
+ ### Step 0: Resolve Local URL
24
+
25
+ Read `localUrl` for each repo from the context. If it is not provided, ask the user:
26
+ > "QA requires a running local server. What URL is the `<repo>` app running on? (e.g. `http://localhost:3000`)"
27
+
28
+ **Do not skip QA.** Wait for the user to provide the URL before proceeding.
29
+
30
+ ### Step 1: Check Authentication
31
+
32
+ Use `muggle-remote-auth-status` to verify valid credentials. If not authenticated, use `muggle-remote-auth-login` to start the device-code login flow and `muggle-remote-auth-poll` to wait for completion.
33
+
34
+ ### Step 2: Get Test Cases
35
+
36
+ Use `muggle-remote-test-case-list` with the project ID to fetch all test cases.
37
+
38
+ ### Step 3: Filter Relevant Test Cases
39
+
40
+ Based on the changed files and the requirements goal, determine which test cases are relevant:
41
+ - Test cases whose use cases directly relate to the changed functionality
42
+ - Test cases that cover areas potentially affected by the changes
43
+ - When in doubt, include the test case (better to over-test than miss a regression)
44
+
45
+ ### Step 4: Execute Tests Locally
46
+
47
+ For each relevant test case:
48
+
49
+ 1. Call `muggle-remote-test-script-list` filtered by `testCaseId` to check for an existing script.
50
+
51
+ 2. **If a script exists** (replay path):
52
+ - Call `muggle-remote-test-script-get` with the `testScriptId` to fetch the full script object.
53
+ - Call `muggle-local-execute-replay` with:
54
+ - `testScript`: the full script object
55
+ - `localUrl`: the resolved local URL
56
+ - `approveElectronAppLaunch`: `true` *(pipeline context — user starting `muggle-do` is implicit approval)*
57
+
58
+ 3. **If no script exists** (generation path):
59
+ - Call `muggle-remote-test-case-get` with the `testCaseId` to fetch the full test case object.
60
+ - Call `muggle-local-execute-test-generation` with:
61
+ - `testCase`: the full test case object
62
+ - `localUrl`: the resolved local URL
63
+ - `approveElectronAppLaunch`: `true`
64
+
65
+ 4. When execution completes, call `muggle-local-run-result-get` with the `runId` returned by the execute call.
66
+
67
+ 5. **Retain per test case:** `testCaseId`, `testScriptId` (if present), `runId`, `status` (passed/failed), `artifactsDir`.
68
+
69
+ ### Step 5: Collect Results
70
+
71
+ For each test case:
72
+ - Record pass or fail from the run result
73
+ - If failed, capture the error message and `artifactsDir` for reproduction
74
+ - Every test case must be executed — generate a new script if none exists (no skips)
75
+
76
+ ## Output
77
+
78
+ **QA Report:**
79
+
80
+ **Passed:** (count)
81
+ - (test case name) [testCaseId: `<id>`, testScriptId: `<id>`, runId: `<id>`]: passed
82
+
83
+ **Failed:** (count)
84
+ - (test case name) [testCaseId: `<id>`, runId: `<id>`]: (error) — artifacts: `<artifactsDir>`
85
+
86
+ **Metadata:**
87
+ - projectId: `<projectId>`
88
+
89
+ **Overall:** ALL PASSED | FAILURES DETECTED
@@ -0,0 +1,33 @@
1
+ # Requirements Analysis Agent
2
+
3
+ You are analyzing a user's task description to extract structured requirements for an autonomous development cycle.
4
+
5
+ ## Input
6
+
7
+ You receive:
8
+ - A user's task description (natural language)
9
+ - A list of configured repository names
10
+
11
+ ## Your Job
12
+
13
+ 1. **Read the task description carefully.** Understand what the user wants to build, fix, or change.
14
+ 2. **Extract the goal** — one clear sentence describing the outcome.
15
+ 3. **Extract acceptance criteria** — specific, verifiable conditions that must be true when the task is done. Each criterion should be independently testable. If the user's description is vague, infer reasonable criteria but flag them as inferred.
16
+ 4. **Identify which repos are likely affected** — based on the task description and the repo names provided.
17
+
18
+ ## Output
19
+
20
+ Report your findings as a structured summary:
21
+
22
+ **Goal:** (one sentence)
23
+
24
+ **Acceptance Criteria:**
25
+ - (criterion 1)
26
+ - (criterion 2)
27
+ - ...
28
+
29
+ **Affected Repos:** (comma-separated list)
30
+
31
+ **Notes:** (any ambiguities, assumptions, or questions — optional)
32
+
33
+ Do NOT ask the user questions. Make reasonable inferences and flag assumptions in Notes.
@@ -0,0 +1,31 @@
1
+ # Unit Test Runner Agent
2
+
3
+ You are running unit tests for each repository that has changes in the dev cycle pipeline.
4
+
5
+ ## Input
6
+
7
+ You receive:
8
+ - A list of repos with their paths and test commands (e.g., `pnpm test`)
9
+
10
+ ## Your Job
11
+
12
+ For each repo:
13
+
14
+ 1. **Run the test command** using Bash in the repo's directory. Use the provided test command (default: `pnpm test`).
15
+ 2. **Capture the full output** — both stdout and stderr.
16
+ 3. **Determine pass/fail** — exit code 0 means pass, anything else means fail.
17
+ 4. **If tests fail**, extract the specific failing test names/descriptions from the output.
18
+
19
+ ## Output
20
+
21
+ Per repo:
22
+
23
+ **Repo: (name)**
24
+ - Test command: (what was run)
25
+ - Result: PASS | FAIL
26
+ - Failed tests: (list, if any)
27
+ - Output: (relevant portion of test output — full output if failed, summary if passed)
28
+
29
+ **Overall:** ALL PASSED | FAILURES DETECTED
30
+
31
+ If any repo fails, clearly state which repos failed and include enough output for the user to diagnose the issue.
@@ -0,0 +1,30 @@
1
+ # Code Validation Agent
2
+
3
+ You are validating that each repository's git state is ready for the dev cycle pipeline.
4
+
5
+ ## Input
6
+
7
+ You receive:
8
+ - A list of repos with changes (from impact analysis), including their paths and branch names
9
+
10
+ ## Your Job
11
+
12
+ For each repo:
13
+
14
+ 1. **Verify the branch is a feature branch** (not main/master/the default branch). This should already be validated by impact analysis, but double-check.
15
+ 2. **Check for uncommitted changes:** Run `git status --porcelain` in the repo. If there are uncommitted changes, warn the user — uncommitted changes won't be included in PRs.
16
+ 3. **Get the branch diff:** Run `git diff <default-branch>...HEAD --stat` for a summary of changes.
17
+ 4. **Verify commits exist on the branch:** Run `git log <default-branch>..HEAD --oneline` to confirm there are commits to push.
18
+
19
+ ## Output
20
+
21
+ Per repo:
22
+
23
+ **Repo: (name)**
24
+ - Branch: (name)
25
+ - Commits on branch: (count and one-line summaries)
26
+ - Uncommitted changes: yes/no (with warning if yes)
27
+ - Diff stat: (file change summary)
28
+ - Status: READY | WARNING | ERROR
29
+
30
+ **Overall:** READY to proceed / BLOCKED (with reasons)
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: repair
3
+ description: Diagnose and fix a broken Muggle AI installation — re-downloads Electron app and resets credentials if needed.
4
+ ---
5
+
6
+ # Muggle AI Repair
7
+
8
+ Automatically diagnose and fix broken components.
9
+
10
+ ## Steps
11
+
12
+ 1. Run the same checks as `/muggle:status` to identify what is broken.
13
+ 2. If everything passes, report: "Nothing to repair — installation looks healthy."
14
+ 3. For each failing component:
15
+ - **Electron app missing or corrupt** — run `muggle setup --force` to re-download.
16
+ - **Authentication expired or invalid** — run `muggle-remote-auth-login` to re-authenticate.
17
+ - **MCP server unresponsive** — report the error and suggest restarting the session.
18
+ 4. Run status checks again to confirm all components are healthy.
19
+ 5. Report what was repaired.
20
+
21
+ ## Output
22
+
23
+ Show before/after status for each repaired component. If repair fails, report the error with enough context for the user to investigate.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: status
3
+ description: Check health of the Muggle AI installation — Electron QA engine, MCP server, and authentication.
4
+ ---
5
+
6
+ # Muggle AI Status
7
+
8
+ Run a full health check and report results.
9
+
10
+ ## Checks
11
+
12
+ 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`.
13
+
14
+ 2. **MCP server** — call `muggle-local-check-status` to verify the server is responsive. Report auth state (authenticated, email, token expiry).
15
+
16
+ 3. **Authentication** — call `muggle-remote-auth-status`. Report whether credentials are valid and when they expire.
17
+
18
+ ## Output
19
+
20
+ ```
21
+ Muggle AI — Status
22
+
23
+ Electron app [pass/fail] version, binary status
24
+ MCP server [pass/fail] responsive, auth state
25
+ Authentication [pass/fail] user, expiry
26
+
27
+ [All systems operational / Issues found — run /muggle:repair to fix.]
28
+ ```
29
+
30
+ Use pass/fail indicators for each check. If any check fails, tell the user to run `/muggle:repair`.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: test-feature-local
3
+ description: Test a feature's user experience on localhost. Execute locally with muggle-local tools, and present the results on muggle-ai.com.
4
+ ---
5
+
6
+ # Test Feature Local
7
+
8
+ Run end-to-end feature testing from UI against a local URL:
9
+
10
+ - Cloud management: `muggle-remote-*`
11
+ - Local execution and artifacts: `muggle-local-*`
12
+
13
+ ## Workflow
14
+
15
+ 1. **Auth**
16
+ - `muggle-remote-auth-status`
17
+ - If needed: `muggle-remote-auth-login` + `muggle-remote-auth-poll`
18
+
19
+ 2. **Select or create the project -> use case -> test case to use**
20
+ - Explictly ask user to select each target to proceed.
21
+ - `muggle-remote-project-list`
22
+ - `muggle-remote-use-case-list`
23
+ - `muggle-remote-test-case-list-by-use-case`
24
+
25
+ 3. **Resolve local URL**
26
+ - Use the URL provided by the user.
27
+ - If missing, ask explicitly (do not guess).
28
+ - Inform user the local URL does not affect the project's remote test.
29
+
30
+ 4. **Check script availability**
31
+ - `muggle-remote-test-script-list` filtered by testCaseId
32
+ - If script exists, recommend replay unless user-flow changes suggest regeneration.
33
+
34
+ 5. **Execute**
35
+ - Replay path:
36
+ - `muggle-remote-test-script-get`
37
+ - `muggle-local-execute-replay`
38
+ - Generation path:
39
+ - `muggle-remote-test-case-get`
40
+ - `muggle-local-execute-test-generation`
41
+
42
+ 6. **Approval requirement**
43
+ - Before execution, get explicit user approval for launching Electron app.
44
+ - Only then set `approveElectronAppLaunch: true`.
45
+
46
+ 7. **Publish local generation result to MuggleTest cloud records**
47
+ - Use `muggle-local-publish-test-script` after successful generation so user can see the full job details.
48
+ - Return the remote URL for user to view the result and script details.
49
+
50
+ 8. **Report results**
51
+ - `muggle-local-run-result-get` with returned runId.
52
+ - Report:
53
+ - status
54
+ - duration
55
+ - pass/fail summary
56
+ - steps summary
57
+ - artifacts path
58
+ - script detail view URL
59
+
60
+ ## Tool map
61
+
62
+ ### Auth
63
+ - `muggle-remote-auth-status`
64
+ - `muggle-remote-auth-login`
65
+ - `muggle-remote-auth-poll`
66
+ - `muggle-remote-auth-logout`
67
+
68
+ ### Cloud entities
69
+ - `muggle-remote-project-list`
70
+ - `muggle-remote-project-create`
71
+ - `muggle-remote-use-case-list`
72
+ - `muggle-remote-use-case-create-from-prompts`
73
+ - `muggle-remote-test-case-list-by-use-case`
74
+ - `muggle-remote-test-case-get`
75
+ - `muggle-remote-test-case-generate-from-prompt`
76
+ - `muggle-remote-test-script-list`
77
+ - `muggle-remote-test-script-get`
78
+
79
+ ### Local execution
80
+ - `muggle-local-execute-test-generation`
81
+ - `muggle-local-execute-replay`
82
+ - `muggle-local-run-result-list`
83
+ - `muggle-local-run-result-get`
84
+ - `muggle-local-publish-test-script`
85
+
86
+ ## Guardrails
87
+
88
+ - Do not silently skip auth.
89
+ - Do not silently skip test execution when no script exists; generate one.
90
+ - Do not launch Electron without explicit approval.
91
+ - Do not hide failing run details; include error and artifacts path.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: upgrade
3
+ description: Update Muggle AI to the latest version — Electron QA engine and MCP server.
4
+ ---
5
+
6
+ # Muggle AI Upgrade
7
+
8
+ Update all Muggle AI components to the latest published version.
9
+
10
+ ## Steps
11
+
12
+ 1. Run `/muggle:status` checks to capture current versions.
13
+ 2. Run `muggle setup --force` to download the latest Electron QA engine.
14
+ 3. Report the upgrade results:
15
+ - Previous version vs new version for each component.
16
+ - Whether the upgrade succeeded or failed.
17
+ 4. Run `/muggle:status` again to confirm everything is healthy after upgrade.
18
+
19
+ ## Output
20
+
21
+ Show a before/after version comparison. If the upgrade fails at any step, report the error and suggest running `/muggle:repair`.