Muggle do

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

Muggle do is an AI agent skill from the GitHub repository multiplex-ai/muggle-ai-works. Take a feature request, spec, design, bug, or ticket and carry it autonomously to an opened pull request — write the code, test it, raise the PR. The PR carries real-browser proof: email-gated flows run through live test inboxes, logins through encrypted secrets, and prerequisite flows in test-graph

How to use this skill

Skill file

Muggle Test Do

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

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 an autonomous dev cycle from requirements to PR. Fire and review: user answers one pre-flight questionnaire, then walks away. The muggle-pr-followup watcher invokes /muggle-do again with the address-reviews directive when new reviews land.

Forward pipeline (fresh feature)

| # | Stage | File |

| :- | :---- | :--- |

| 1 | Pre-flight (one questioning turn) | CODE0 |

| 2 | Requirements | CODE0 |

| 2.5 | Design — a design PR; merging it approves the design and starts the build | CODE0 |

| 3 | Build | CODE0 |

| 4 | Impact analysis | CODE0 |

| 5 | Unit tests | CODE0 |

| 5.5 | Open PR | CODE0 |

| 6 | E2E acceptance | CODE0 |

| 7 | Report on the PR | CODE0 |

| 7.5 | E2E repair loop | CODE0 |

| 8 | Hand off to watcher | CODE0 |

The PR opens before E2E. Stage 5.5 opens it as soon as unit tests pass; Stage 6 then runs against the PR's head, its progress showing on the PR, and Stage 7 settles the walkthrough with the result. The walkthrough check stays red until then.

Waves and streams. A session's PRs are either a wave — one change split across repos — or a stream of independent changes, or both; CODE0 defines which is which, and pre-flight decides it once.

Design PRs. A change that needs a design stops after Stage 2.5 with a [DESIGN] PR carrying the spec. Merging it is the approval: the merge's cleanup resumes the cycle at Stage 3; closing it unmerged rejects the design. See CODE1.

Multi-repo waves. When a task's PRs need each other to work — one PR per repo — they form a wave: every repo's service starts from its branch, Stage 6 runs one E2E pass against the combined stack, and that same result is posted to every PR in the wave. See CODE0; pre-flight decides whether a cycle is a wave.

Streams — several changes in one session. Unrelated fixes — several bugs in one request, or a second task while the first is still in flight — are separate changes, each with its own session directory, worktree, PR, and E2E run; a wave is one change among them. When a change reaches Stage 6 while other work is in front of the session, its run goes to a background acceptance-tester and the session moves on; the report comes back to the main session, which carries that change through Stages 7–8. One local run at a time, and a PR's walkthrough only ever carries its own change's run. See CODE1.

Stage 7 dispatches one watcher per opened PR as its last action, gated on Stage 7.5's clearance — a cycle with unrepaired E2E failures never reaches a watcher.

Execution protocol (non-negotiable)

The pipeline table lists pointers, not summaries. Open each stage's file and execute from it — running a stage off its one-line row here is how tests, E2E, and session state get silently skipped. If you have not read a stage's file this run, you have not run that stage.

Bootstrap before any code, in order:

  1. Emit telemetry — CODE0, skillName: "muggle-do".
  2. Create ~/.muggle-ai/muggle-do/sessions/<slug>/ with state.md + iterations/001.md (pre-flight owns this; do it even when running unattended).
  3. TodoWrite one item per stage 1–8, Stages 2.5, 5.5 and 7.5 included — these stages are the checklist; never swap in your own decomposition. Several changes → one set of stage items per change.

Per stage: read the file → execute it → append one marker line to iterations/<NNN>.md, always in the form Stage <N> done — <evidence>, citing the evidence that file requires (jest exit code, E2E verdict + runId, screenshot path). The marker is the stage's last line, written after its notes, and carries the evidence itself: nothing between done and —, never a pointer such as Stage 4 done (see below) —. A stage is done only when its evidence is written, never on recollection.

"Autonomous" / "without my intervention" collapses exactly one thing

Best-effort the Stage-1 questionnaire and don't ask. It does not license skipping telemetry, session artifacts, requirements, the Stage-2.5 design PR, unit tests, E2E (autoE2ETest defaults to always), browser verification, the gate below, the Stage-7.5 repair loop, or the watcher hand-off. Stage 7.5 investigates and repairs unattended too; only its user decision is deferred — left open for the user and carried by the watcher, never waived on their behalf. Run the whole pipeline silently — never a shortcut.

Definition of Done — gates before Stages 5.5 and 7

Each line holds, or is waived by a one-line reason written into state.md (silence is not a waiver).

Before Stage 5.5 opens the PR:

Before Stage 7 settles the PR's walkthrough:

Opening a PR, or settling its walkthrough, with an unchecked, unwaived line of its gate is a cycle failure. A Stage 6 readiness halt (CODE0 Step 0.5) leaves the E2E line open: no skip code, waiver, or explicit request to open the PR closes it.

Audit trail

Every cycle's closing message opens with the fenced block CODE0 defines: the unit tests involved, the E2E tests with results, links to the evidence, and what is missing. A prose recap does not replace it. It reports and gates nothing, and it comes after the last action: the watcher arms first.

Address-reviews flow

When invoked with the directive (PR URL + slug + review ids), routes to CODE0. Shares stages 3–5 with the forward pipeline, then sizes the cycle from its diff per CODE1: a full cycle adds stage 6 and a fresh walkthrough, a minor one skips E2E under a verified NO_APP_LOGIC_CHANGE. Skips pre-flight, requirements, and PR creation. See the orchestrator for the cycle's exact step order, classification rules, and respawn logic.

Input routing

/muggle-do serves one interactive mode (the forward pipeline, from a fresh task) and four programmatic modes the watcher dispatches (address-reviews, fix-ci, rebase, post-merge cleanup). Resolve $ARGUMENTS to a mode per CODE2 before doing anything else.

Preferences

| Preference | Gate |

| :--------- | :--- |

| frontloadQuestions | Every stage — always keeps Stage 1 the only questioning turn, with Stage 2.5's design approval taken as a design-PR merge and Stage 7.5's decision open rather than asked; never lets a later stage ask when a question arises (rule) |

| autoE2ETest | Stage 6 — run E2E every cycle (default always), or fold into pre-flight |

| autoResolveConflicts | On rebase conflict — always resolves autonomously behind a verify-or-rollback gate, never aborts + escalates; resolve from the configured preference (don't assume a default) |

| autoRouteBuildToMuggleDo | Front-door guardrail — route build/implement/fix requests through this pipeline (build delegated to superpowers); fired by the UserPromptSubmit guardrail, default ask |

| autoInstallCiWorkflow | Stage 7 — add the muggle-walkthrough CI check to a GitHub repo that lacks it, shipped in the PR; ask folds into pre-flight, default ask. An unedited copy from an earlier release is refreshed unless never |

autoUseWorktree, autoRebase, autoResolveConflicts, autoCreatePR, autoCleanup, postPRVisualWalkthrough fire from per-stage files.

Session model

~/.muggle-ai/muggle-do/sessions/<slug>/. Schemas: CODE1.

| File | Owner |

| :--- | :---- |

| state.md | Stage 1 or bootstrap |

| iterations/<NNN>.md | Every stage |

| requirements.md | Stage 2 (forward only) |

| prs.json, last_seen.json, followup.log | Stage 7 / watcher / /muggle-do |

| result.md | Stage 5.5 (seeded), terminal tick (finalized) |

Guardrails

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.