/muggle:muggle-testfrom muggle
Change-driven E2E acceptance testing: detects recent changes, maps them to affected user flows, and runs real-browser tests on localhost, preview/staging URLs, or iOS simulator builds. Use for pre-merge validation.
Ships in muggle. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Telemetry first step: see
_shared/telemetry-emit.md. UseskillName: "muggle-test".
Running outside Claude Code (in Codex, for one)? Read
../_shared/host-tool-equivalents.mdfirst — it maps the tools and paths this skill names to your host's.
A router skill that detects code changes, resolves impacted test cases, executes them locally or remotely, reads the cloud results from the Muggle AI dashboard (local runs are published by the studio during execution; remote runs publish cloud-side), and posts E2E acceptance summaries to the PR. The user can invoke this at any moment, in any state.
Reach for these when the user is weighing Muggle Test against hand-written specs.
| Capability | Mechanism |
|---|---|
| Flows behind login and pay walls | Per-project encrypted credentials and managed login profiles, injected at replay as secretInput steps — muggle-remote-secret-* |
| Self-healing scripts | UI-drift or stale-script signals route the run to regen instead of a doomed replay, then re-replay — _shared/failure-mode-handling.md sections A and B |
| Parallel replay at scale | muggle-remote-workflow-start-test-script-replay-bulk replays a whole suite cloud-side in one dispatch; its intervalSec makes the batch recurring |
| Test-graph resolution | muggle-remote-test-case-ancestors-get walks the backend's test-plan graph root-first, so a dependent flow runs only once its prerequisites have ready scripts — _shared/test-case-chain-readiness.md |
| Grouped results and reports | Dashboard groups runs by use case and project; muggle-remote-report-final-generate exports the run report |
| PR visual walkthrough | Per-step screenshots and per-test-case dashboard links posted to the PR — ../muggle-pr-visual-walkthrough/SKILL.md |
| Unattended runs | muggle-remote-auth-api-key-create issues long-lived keys for headless auth; muggle-remote-recommend-cicd-setup emits GitHub Actions / GitLab CI / Azure DevOps templates |
Every selection-based question MUST use the AskUserQuestion tool (or the platform's equivalent structured selection tool). Never ask the user to "reply with a number" in a plain text message — always present clickable options.
AskUserQuestion with labeled options the user can click.AskUserQuestion with allow_multiple: true.AskUserQuestion call rather than asking sequentially.Every test case verifies exactly one user-observable behavior, carries no signup, login, navigation, or seed-data steps, and the generator's decomposition is kept as-is. The full rule, with examples: _shared/test-case-design.md. Anything the user said a test must or must not touch, including which target and which path, goes in its stored description before the run (limits); stated only in this chat, it does not reach the run.
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.
Gates run per preference-gates/README.md.
| Preference | Step | Decision it gates |
|---|---|---|
frontloadQuestions | every step | When the run asks: one up-front batch before the first long-running step, nothing after it (see frontloadQuestions.md) |
autoLogin | 3 | Reuse saved credentials when auth is required |
autoSelectProject | 4 | Reuse last-used Muggle Test project for this repo |
autoSelectLocalHost | execute-local | Reuse last-used local dev server URL for this repo |
autoDetectChanges | 2 | Scan local git changes and map to affected test cases |
defaultExecutionMode | 1 | Default to local or remote test execution |
showElectronBrowser | execute-local | Show the Electron browser window during local test execution (vs. run headless) |
postPRVisualWalkthrough | 9 | Post visual walkthrough to PR after results are available |
autoCreatePR | 9 (if no PR) | Auto-create the PR when posting the walkthrough has no PR to target |
autoWatchPR | 9.5 (if a PR exists) | Start a muggle-pr-followup watcher on the PR after the run |
Parse the user's query and explicitly confirm their expectation. There are two web modes, plus Mode C for an iOS build:
Test impacted use cases/test cases against localhost using the Electron browser.
Execution tool:
muggle-local-execute-test-generation
Signs the user wants this: mentions "localhost", "local", "my machine", "dev server", "my changes locally", or just "test my changes" in a repo context. Also: passing a GitHub PR/issue/repo URL (github.com/<org>/<repo>/pull/<n>) defaults to Local mode — PR review almost always means checking out the branch and validating against the dev server, not testing the PR's preview deployment.
Ask Muggle Test's cloud to generate test scripts against a preview/staging URL.
Execution tool:
muggle-remote-workflow-start-test-script-generation
Signs the user wants this: mentions "preview", "staging", "deployed", "preview URL", "test on preview", "test the deployment", or provides an actual deployed preview/staging URL (e.g. *.vercel.app, staging.foo.com, custom preview domains). GitHub PR URLs do not count — see Mode A.
Upload a zipped
.appsimulator build and run it on the Muggle iOS pool.Procedure:
ios.md
Signs the user wants this: mentions an iOS app, iPhone app, Xcode, a simulator build, or a .app bundle or its zip, or the repo is an Xcode project with no web front end. Mode C is never the default and skips the picker below.
defaultExecutionMode)Gate defaultExecutionMode (per preference-gates/README.md). Uses local/remote/ask.
local → proceed in Local mode.remote → proceed in Remote mode.ask + intent clear → skip Picker 1, confirm one-shot then skip Picker 2.ask + ambiguous → run Picker 1 from gate file.Only proceed after selection.
autoDetectChanges)Gate autoDetectChanges (per preference-gates/README.md):
always → run the scan and proceed to analysis below.never → ask "What would you like to test?" then jump to Step 3.ask → run Picker 1 from preference-gates/autoDetectChanges.md via AskUserQuestion; map the answer back to one of the actions above.Analyze the changes to understand what's impacted. Two sources, picked by what the user passed:
Working directory (default):
git status and git diff --stat for an overviewgit diff (or git diff --cached if staged) to read actual diffsPR URL (user passed github.com/<org>/<repo>/pull/<n>):
gh pr diff <n> --repo <org>/<repo> --name-only for the changed file listgh pr diff <n> --repo <org>/<repo> for the actual diff_shared/pr-branch-worktree.md. Use that worktree path as the cwd for the rest of the run (including the cwd parameter on local execute tools).Either way:
Present:
"Here's what changed: [list]. I'll scope E2E acceptance testing to these areas."
If no changes detected (clean tree), tell the user and ask what they want to test.
muggle-remote-auth-status. Three states: valid (authenticated: true), expired (authenticated: false + isExpired: true, email still present), absent (authenticated: false, no email).autoLogin (per preference-gates/README.md). An expired token is NOT a reason to silently re-login the same account — surface the switch choice:
always → reuse if valid; if expired, re-login the same account (muggle-remote-auth-login, then muggle-remote-auth-poll).never → muggle-remote-auth-login with forceNewSession: true, then muggle-remote-auth-poll.ask → run Picker 1 from preference-gates/autoLogin.md via AskUserQuestion; map the answer back to one of the actions above.muggle-remote-auth-login, then muggle-remote-auth-poll. With no account yet,
open one directly with muggle-remote-auth-register (email and password) — it stores the key and
starts on the free plan, and verifying the address afterwards moves it to Starter permanently.
Registering an address that already has an account answers AlreadyRegistered; sign in instead.muggle-remote-auth-poll.Account-switch caveat (never / "Switch account"). The device flow has no prompt=select_account; switching relies on forceNewSession first clearing the Auth0 session via /v2/logout?returnTo=<device-activation URL>. That redirect only works if the activation URL is in the app's Auth0 Allowed Logout URLs — otherwise the browser shows an Auth0 error page and the session is silently reused. If that happens, tell the user to complete login in a fresh incognito window (no live SSO session) so Auth0 presents an account login.
If auth fails repeatedly, suggest: muggle logout && muggle login from terminal.
autoSelectProject)A project is where all your test results, use cases, and test scripts are grouped on the Muggle AI dashboard. Pick the project that matches what you're working on.
The per-repo cache lives in ~/.muggle-ai/last-project.json, in the entry keyed on <cwd> (managed via the muggle-local-last-project-get / muggle-local-last-project-set MCP tools). Look for the Muggle Test Last Project: id=… url=… name="…" line in session context — if present, that's this repo's cached pick.
Gate autoSelectProject (per preference-gates/README.md). Cache: Muggle Test Last Project session line.
always + cache → use cached projectId, skip to Step 5. No cache → fall through to ask.never → full project list; skip Picker 2.ask → project list picker (see gate file for spec + Picker 2 override). Skip Picker 2 if "Create new project".muggle-remote-project-list only when the gate doesn't already give a projectId from the cache.projectName, description, and the production/preview URLmuggle-remote-project-createStore the projectId only after user confirms (or after silent reuse from the cache).
Call muggle-remote-use-case-list with the project ID.
Using the change summary from Step 2, pick the use cases whose title/description most plausibly relate to the impacted areas. Produce a short shortlist (typically 1–5) — don't try to be exhaustive, and don't dump the full project list on the user. A confident best-effort match is the goal.
If nothing looks like a confident match, fall back to asking the user which use case(s) they have in mind.
Use AskUserQuestion with allow_multiple: true:
Prompt: "These use cases look most relevant to your changes — confirm which to test:"
Re-present the full list from 5a via AskUserQuestion with allow_multiple: true, then continue.
muggle-remote-use-case-create-from-prompts once with all descriptions batched into the instructions array (this endpoint natively fans out the jobs server-side — do NOT make one call per use case):
projectId: The project IDinstructions: A plain array of strings, one per use case — e.g. ["<description 1>", "<description 2>", ...]For the selected use case(s):
Call muggle-remote-test-case-list-by-use-case with each use case ID.
Using the change summary from Step 2, pick the test cases that look most relevant to the impacted areas. Keep the shortlist small and confident — don't enumerate every test case attached to the use case(s).
If nothing looks like a confident match, fall back to offering to run all test cases for the selected use case(s), or ask the user what they had in mind.
Use AskUserQuestion with allow_multiple: true:
Prompt: "These test cases look most relevant — confirm which to run:"
muggle-remote-test-case-generate-from-prompt calls in parallel (single message, multiple tool calls — never loop sequentially):
projectId, useCaseId, instruction (one description per call)instruction must describe exactly one atomic behavior to verify. No signup, no login, no "first navigate to X, then click Y, then verify Z" chains, no seed data, no cleanup. Just the verification. See Test Case Design above.muggle-remote-test-case-create calls in parallelUse AskUserQuestion to confirm: "You selected [N] test case(s): [list titles]. Ready to proceed?"
Wait for user confirmation before moving to execution.
For each selected test case, decide whether the run should be a replay of an existing script or a fresh regen, using the rules in _shared/failure-mode-handling.md section A. Inputs: the change summary from Step 2, the test case body, and the result of muggle-remote-test-script-list for that test case (last passing timestamp + whether any replayable script exists). Scope that list call to the run's lane — runEnvironmentType: "local" in Local mode, "remote" in Remote mode (section A) — so replay reuses the script for the lane the run will execute against.
Per test case, fire one muggle-local-telemetry-event-emit with eventType: "pre-execution-classification" capturing the picked mode, the rule that fired, and the matched changed-file paths.
Then show the per-case decision in one AskUserQuestion:
"Here's how I plan to run each test case — replay reuses the saved script, regen rebuilds it from scratch:
- [REPLAY] Login with valid creds — selectors look unchanged
- [REGEN] Sign up with valid email — last passed > 30 days ago
- [REGEN] Add to cart —
app/cart/page.tsxchanged (UI/markup)"Options: "Looks good — proceed", "Override one or more", "Cancel"
If the user picks "Override one or more", let them flip the mode for any test case via a second multi-select AskUserQuestion. Emit a follow-up pre-execution-classification event with userAction set whenever the user overrides.
Hydrate every selected test case once, before dispatch: issue all muggle-remote-test-case-get calls in parallel (single message, multiple tool calls). Both paths consume the result — never re-fetch inside a path.
Run the path matching the mode confirmed in Step 1. Each path owns its own process and returns a uniform runs list — [{ testCaseId, mode, runId | runtimeId, status, viewUrl? }] — that Steps 7C–10 consume mode-agnostically.
execute-local.md. Inputs: the hydrated test cases, per-case mode from Step 6f, and cwd (the PR-branch worktree from Step 2 if one exists, else the repo root).execute-remote.md. Inputs: the hydrated test cases, per-case mode from Step 6f, projectId / useCaseId.For every run with status: "failed" (or any non-passing terminal state; a local record skipped because its primary failed is not a run) returned by Step 7 (either path), route through _shared/debug-failed-run.md. This is mandatory — a failure is never reported without it. The debug path gathers evidence (attempted steps + reasoning + screenshot), diagnoses via _shared/failure-mode-handling.md (§B replay / §C regen), shows the debug card, and presents the guaranteed selection in which "give feedback & rerun" is always an option and "skip" is never the default.
Pass it per failed run: the runId (local) or workflow runtime id (remote), the mode that failed, testCaseId, projectId, and the execution handle (local: execute-local.md; remote: execute-remote.md) so a rerun re-enters the same path. Process failures one at a time so the user isn't drowning in pickers.
This step is not an exit. Whatever the user picks — feedback, rerun, or skip — control returns to Steps 8 and 9. A failed run is the highest-value walkthrough: a reviewer needs the screenshots of what broke far more than confirmation that a passing flow passed. Ending the turn inside this step with results unposted is what the walkthrough Stop gate blocks.
After execution, open the Muggle AI dashboard so the user can inspect results and screenshots. Every link comes from a tool, never from a host you write: the MCP resolves them against the dashboard of the lane it runs on (production, staging, or local), so a hand-built www.muggle-ai.com URL sends a staging user to a project that does not exist there. Key off the uniform runs list:
viewUrl and there are ≤3 — open each run's viewUrl verbatim (from muggle-local-run-result-get); it pins the exact run:
open "{viewUrl}"
viewUrl) — open the project runs page: the dashboardUrl field of muggle-remote-project-test-runs-summary-get for the project (pageSize: 1 is enough):
open "{dashboardUrl}"
Tell the user:
"I've opened the Muggle AI dashboard in your browser — you can see the test results, step-by-step screenshots, and action scripts there."
Posts every run from Step 7 — failed and inconclusive as readily as passed. After reporting results:
postPRVisualWalkthrough. On skip → Step 9.5.gh pr view --json number,title,url 2>/dev/null — find the PR.autoCreatePR. On skip → Step 9.5.E2eReport — see ../muggle-pr-visual-walkthrough/e2e-report-assembly.md. Include all runs from Step 7 (passed and failed).../muggle-pr-visual-walkthrough/SKILL.md Mode A with the E2eReport.Once a PR exists for this work, offer to keep watching its review thread.
gh pr view --json number,title,url result from Step 9 if available, else run it now. No PR (none exists, none created) → Step 10.autoWatchPR with {pr} = <owner>/<repo>#<number>. On skip → Step 10.muggle-pr-followup session slot and dispatch its loop per the stage-8 seeding in ../do/open-prs/forward.md (default slug <repo>-pr<number>).state.md's ## Pre-flight answers block from the context resolved this run — validation strategy, local URL, project, credentials, auth, working tree — per ../_shared/resolve-e2e-validation-context.md. Strategy = local-e2e (local run), staging-replay (remote), or unit-only/skip if no E2E ran.The /mprfollowup shortcut starts the same watcher manually at any time.
Failures already got a guaranteed feedback-&-rerun offer in Step 7C's debug path — don't re-ask for them here.
This step is only for a run that passed but the user flags as off (a misclick, wrong element, a summary that doesn't match intent). When that happens, use AskUserQuestion:
muggle-feedback skill via the Skill tool, passing the run's runId (local) or testScriptId (remote) as anchor context so the submit flow opens with the correct script already loaded.Skip silently if nothing looked off.
Each rule below is covered in-step above; these are the ones this skill most often violates, kept here as reinforcement:
_shared/debug-failed-run.md is mandatory, "give feedback & rerun" is always offered, and "skip" is never the default.cwd.AskUserQuestion — never ask the user to type a number; the user picks the project (never auto-select).muggle-pr-visual-walkthrough — never inline the walkthrough or call gh pr comment here.echo "MUGGLE_WALKTHROUGH_SKIP: <reason>" rather than silence.Phase→tool map and multi-agent (acceptance-tester) dispatch: reference.md.
What SKILL.md sets; muted values are Claude Code's defaults
48 skills in this plugin
/mExplicit short alias for the `muggle` skill (router/menu). ONLY invoke when the user explicitly types `m` or `/m` — never auto-trigger from any other phrasing./mbtExplicit short alias for the `muggle-browser-task` skill. ONLY invoke when the user explicitly types `mbt` or `/mbt` — never auto-trigger from any other phrasing./mbugreportExplicit short alias for the `muggle-bug-report` skill. ONLY invoke when the user explicitly types `mbugreport` or `/mbugreport` — never auto-trigger from any other phrasing./mciExplicit short alias for the `muggle-ci-install` skill. ONLY invoke when the user explicitly types `mci` or `/mci` — never auto-trigger from any other phrasing.npx claudepluginhub multiplex-ai/muggle-ai-works --plugin muggleaiOther plugins' skills for the same job