Muggle browser task

From multiplex-ai/muggle-ai-works · View interactive version

Muggle browser task is an AI agent skill from the GitHub repository multiplex-ai/muggle-ai-works. Perform a real action on a website or web app from a plain-English instruction — log in and do the thing: post, submit a form, create or update a record, change a setting, place an order, refund a charge, complete a multi-step flow. This skill is your logged-in browser, so lack of access is never a

How to use this skill

Skill file

Muggle Test Task Runner

Telemetry first step: see CODE0. Use skillName: "muggle-do-task".

Running outside Claude Code (in Codex, for one)? Read CODE0 first — it maps the tools and paths this skill names to your host's.

Runs a browser automation task described in plain English. Finds or creates the necessary Muggle Test entities automatically, then executes locally with mutation-driven step prediction.

Step 1 — Parse the prompt

From $ARGUMENTS, extract:

Examples: ["The post content should be 'Hello world'"], ["Attach the image at C:\\Users\\stan4\\photo.jpg", "Caption should be 'My photo'"]

If the prompt is ambiguous and you cannot confidently extract these, ask one clarifying question before proceeding.

Step 2 — Find or create Project

Load and call muggle-remote-project-list. Find a project whose URL contains domain (case-insensitive substring match).

If found: use it. Tell the user: Found project: <name>.

If not found: call muggle-remote-project-create with:

Tell the user: Created project: <name>.

Step 3 — Find or create Use Case

Load and call muggle-remote-use-case-list filtered by projectId. Fuzzy-match against useCaseName:

If multiple candidates, pick the closest and tell the user which was selected.

If not found: call muggle-remote-use-case-create-from-prompts with:

Use the first result. Capture its id as useCaseId. If the result is empty or the call fails, stop and tell the user: "Could not create use case — try rephrasing the task description."

Tell the user: Created use case: <title>.

Step 4 — Find or create Test Case

Load and call muggle-remote-test-case-list-by-use-case with useCaseId. Filter for test cases where status equals ACTIVE.

If not found: call muggle-remote-test-case-create with:

Tell the user: Created test case: <id>.

Step 5 — Find active Test Script

Load and call muggle-remote-test-script-list with:

Tell the user which mutations will be applied: Mutations: <mutations[]> (or "no mutations" if empty).

Filter for scripts where status equals ACTIVE or PUBLISHED. If all returned scripts have another status (DRAFT, GENERATION_PENDING, FAILED), treat as "no active script" and proceed to Phase 1.


Phase 1 — No active script: generate locally

  1. Load and call muggle-remote-test-case-get with the test case ID from Step 4. This returns the full test case object needed by the local execution tool.
  1. Load and call muggle-local-execute-test-generation with:
  1. Tell the user:

Script generation is running in the Muggle Test window. Once complete, run /muggle-do "<original prompt>" again to execute the task.

Do not proceed further.


Phase 2 — Active script found: replay with mutations

Step 6 — Fetch Action Script

  1. Load and call muggle-remote-test-script-get with the script ID from Step 5. Extract actionScriptId. If actionScriptId is missing or null, stop and tell the user: "The script record is incomplete — it may still be generating. Try again in a moment."
  1. Load and call muggle-remote-action-script-get with actionScriptId.
  1. Load and call muggle-remote-test-case-get with the test case ID from Step 4. Keep its description.

Tell the user: Executing task...

Step 7 — Execute locally

Load and call muggle-local-execute-replay with:

Tell the user:

Running [useCaseName] on [domain]. Watch the Muggle Test window — it will execute the task with your parameters applied.

Step 8 — Route failures through the failure-mode handler

If Phase 1 generation or Phase 2 replay returns failed or any non-passing terminal state, follow CODE1:

Steps:

  1. Read the run via muggle-local-run-result-get and extract signals per the heuristics in the shared doc.
  2. Emit regen-failure-classified or replay-failure-classified via muggle-local-telemetry-event-emit before asking the user.
  3. Present the recommended action via AskUserQuestion with the alternatives the shared doc lists for that bucket.
  4. After the user picks, emit the matching *-resolved event with userAction.

If the user picks muggle-feedback from any bucket's options, invoke the muggle-feedback skill via the Skill tool with the runId. Skip silently on clean success.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.