@muggleai/works 4.13.1 → 4.14.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.
- package/README.md +3 -3
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/README.md +1 -1
- package/dist/plugin/commands/mprfollowup.md +7 -0
- package/dist/plugin/skills/_aliases.json +1 -1
- package/dist/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -1
- package/dist/plugin/skills/do/address-reviews.md +1 -1
- package/dist/plugin/skills/do/build.md +2 -1
- package/dist/plugin/skills/do/open-prs/forward.md +2 -2
- package/dist/plugin/skills/do/open-prs/update.md +1 -1
- package/dist/plugin/skills/mprfollowup/SKILL.md +8 -0
- package/dist/plugin/skills/muggle/SKILL.md +1 -0
- package/dist/plugin/skills/muggle-do/SKILL.md +26 -1
- package/dist/plugin/skills/muggle-feedback/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-pr-followup/SKILL.md +1 -2
- package/dist/plugin/skills/muggle-pr-followup/bootstrap.md +5 -3
- package/dist/plugin/skills/muggle-pr-followup/contract.md +1 -1
- package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +5 -1
- package/dist/plugin/skills/muggle-preferences/ops/configure.md +2 -1
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoWatchPR.md +13 -0
- package/dist/plugin/skills/muggle-preferences/preference-gates/reusePreparePlan.md +11 -0
- package/dist/plugin/skills/muggle-status/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-test/SKILL.md +16 -3
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +15 -2
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +5 -1
- package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +7 -5
- package/dist/plugin/skills/muggle-test-prepare/steps/identify-services.md +2 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/readiness-report.md +30 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +44 -0
- package/dist/release-manifest.json +4 -4
- package/package.json +7 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/README.md +1 -1
- package/plugin/commands/mprfollowup.md +7 -0
- package/plugin/skills/_aliases.json +1 -1
- package/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -1
- package/plugin/skills/do/address-reviews.md +1 -1
- package/plugin/skills/do/build.md +2 -1
- package/plugin/skills/do/open-prs/forward.md +2 -2
- package/plugin/skills/do/open-prs/update.md +1 -1
- package/plugin/skills/mprfollowup/SKILL.md +8 -0
- package/plugin/skills/muggle/SKILL.md +1 -0
- package/plugin/skills/muggle-do/SKILL.md +26 -1
- package/plugin/skills/muggle-feedback/SKILL.md +1 -1
- package/plugin/skills/muggle-pr-followup/SKILL.md +1 -2
- package/plugin/skills/muggle-pr-followup/bootstrap.md +5 -3
- package/plugin/skills/muggle-pr-followup/contract.md +1 -1
- package/plugin/skills/muggle-pr-followup/state-schemas.md +5 -1
- package/plugin/skills/muggle-preferences/ops/configure.md +2 -1
- package/plugin/skills/muggle-preferences/preference-gates/autoWatchPR.md +13 -0
- package/plugin/skills/muggle-preferences/preference-gates/reusePreparePlan.md +11 -0
- package/plugin/skills/muggle-status/SKILL.md +1 -1
- package/plugin/skills/muggle-test/SKILL.md +16 -3
- package/plugin/skills/muggle-test-feature-local/SKILL.md +15 -2
- package/plugin/skills/muggle-test-prepare/SKILL.md +5 -1
- package/plugin/skills/muggle-test-prepare/steps/check-running.md +7 -5
- package/plugin/skills/muggle-test-prepare/steps/identify-services.md +2 -0
- package/plugin/skills/muggle-test-prepare/steps/readiness-report.md +30 -0
- package/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +44 -0
- package/dist/plugin/commands/mrelease.md +0 -7
- package/dist/plugin/skills/mrelease/SKILL.md +0 -8
- package/dist/plugin/skills/muggle-works-npm-release/SKILL.md +0 -200
- package/plugin/commands/mrelease.md +0 -7
- package/plugin/skills/mrelease/SKILL.md +0 -8
- package/plugin/skills/muggle-works-npm-release/SKILL.md +0 -200
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Call local execution MCP tools directly (for example `muggle-local-execute-test-
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
##
|
|
126
|
+
## Architecture
|
|
127
127
|
|
|
128
128
|
muggle-ai-works separates test management from test execution. All entity management (projects, use cases, test cases) lives in the cloud via `muggle-remote-*` tools. Local execution (`muggle-local-*`) is stateless — it receives what it needs and runs the test.
|
|
129
129
|
|
|
@@ -201,7 +201,7 @@ OPEN_PRS → PR #42 opened
|
|
|
201
201
|
DONE → 1 iteration, all green
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
-
- Session-based with crash recovery (
|
|
204
|
+
- Session-based with crash recovery (`~/.muggle-ai/muggle-do/sessions/`)
|
|
205
205
|
- Auto-triage: analyzes failures and loops back to fix (max 3 iterations)
|
|
206
206
|
- Multi-repo support via `muggle-repos.json`
|
|
207
207
|
- PRs include E2E acceptance results and screenshots in the description
|
|
@@ -556,7 +556,7 @@ CI/CD and publishing
|
|
|
556
556
|
| `verify-end-user-upgrade.yml` | Weekly + manual | Existing-user upgrade validation (cleanup + re-download + health checks) |
|
|
557
557
|
| `publish-works-to-npm.yml` | Tag `v*` or manual | Verify (including release checksums), audit, smoke-install, publish to npm |
|
|
558
558
|
|
|
559
|
-
**Publishing `@muggleai/works`:** use the
|
|
559
|
+
**Publishing `@muggleai/works`:** use the maintainer-only skill **`.claude/skills/muggle-works-npm-release/SKILL.md`** — a repo-local project skill (invoke `/muggle-works-npm-release` in Claude Code, or `/mrelease`, while working in this repo; mirrored to `.cursor/skills/` for Cursor). It is intentionally not in the published plugin (`plugin/skills/`) since it is maintainer-only. It does the bump + `pnpm run sync:versions`, local verify, `chore(release)` PR, merge, then `workflow_dispatch` with an explicit `version`. Do not rely on tagging alone while `package.json` / marketplace manifests on `master` are still old — CI can publish a version that does not match the checked-in manifests. Tag `v*` push remains a valid workflow trigger when it matches the merged release commit.
|
|
560
560
|
|
|
561
561
|
Release tag strategy
|
|
562
562
|
|
|
@@ -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.14.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -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.14.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Type `muggle` to discover the full command family.
|
|
|
33
33
|
| `/muggle:muggle-repair` | Diagnose and fix broken installation automatically. |
|
|
34
34
|
| `/muggle:muggle-upgrade` | Update Electron browser test runner and MCP server to latest version. |
|
|
35
35
|
|
|
36
|
-
Each skill above also ships a short alias to save typing — `m` (router), `mtest`, `mdo`, `mpr`, `mprefs`, `mstatus`, `mrepair`, `mupgrade`, `mfeedback`, `mimport`, `mtestlocal`, `mtestprep`, `mregen
|
|
36
|
+
Each skill above also ships a short alias to save typing — `m` (router), `mtest`, `mdo`, `mpr`, `mprefs`, `mstatus`, `mrepair`, `mupgrade`, `mfeedback`, `mimport`, `mtestlocal`, `mtestprep`, `mregen`. Type `/m` (Claude Code) or `m` (Cursor) to open the menu, or jump straight to one (e.g. `/mtest`).
|
|
37
37
|
|
|
38
38
|
## MCP Tools
|
|
39
39
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Watch a PR for review follow-ups (alias for /muggle-pr-followup)
|
|
3
|
+
argument-hint: [PR url | slug pr-number | empty to auto-track]
|
|
4
|
+
allowed-tools: [Skill]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Invoke the `muggle-pr-followup` skill via the Skill tool. Forward `$ARGUMENTS` as the skill's `args`.
|
|
@@ -8,7 +8,7 @@ The sections below are the steps in order: reuse an existing context if one is o
|
|
|
8
8
|
|
|
9
9
|
## Reuse an existing context
|
|
10
10
|
|
|
11
|
-
If a `## Pre-flight answers` block already exists for this working tree — the current session slot, or the most recent sibling session under
|
|
11
|
+
If a `## Pre-flight answers` block already exists for this working tree — the current session slot, or the most recent sibling session under `~/.muggle-ai/muggle-do/sessions/*` — fire the [`autoReuseValidationContext`](../muggle-preferences/preference-gates/autoReuseValidationContext.md) gate before gathering anything:
|
|
12
12
|
|
|
13
13
|
- `always` → copy the existing block into this session; skip the questionnaire.
|
|
14
14
|
- `never` → ignore it; run the full gather below.
|
|
@@ -19,7 +19,7 @@ Exact phrasing comes from the watcher's dispatch (see [`../muggle-pr-followup/co
|
|
|
19
19
|
|
|
20
20
|
## Inputs from disk
|
|
21
21
|
|
|
22
|
-
Read from
|
|
22
|
+
Read from `~/.muggle-ai/muggle-do/sessions/<slug>/`:
|
|
23
23
|
|
|
24
24
|
- `prs.json` — to locate the PR's local checkout path (the `repo` field maps to a configured local repo) and capture `head_sha_before`.
|
|
25
25
|
- `last_seen.json` — for `pushed_shas[]` (used by the resolve-reminder stage) and to update the cursor.
|
|
@@ -20,7 +20,8 @@ For each affected repo:
|
|
|
20
20
|
1. **Re-read `requirements.md`.** Treat goal + AC as frozen. If something is unclear at this stage, that's a pre-flight bug — escalate, do not improvise.
|
|
21
21
|
2. **Apply the change** in the repo's worktree. Edit existing files first; create new files only when the requirements demand it. Match the surrounding code's style, naming, and file layout.
|
|
22
22
|
3. **Don't add what wasn't asked for.** No speculative abstractions, no extra logging, no "while I'm here" refactors. Three similar lines is better than a premature abstraction.
|
|
23
|
-
4. **
|
|
23
|
+
4. **Cover new logic with tests.** If you added or changed non-trivial logic (a hook, reducer, parser, state machine, branching util), write its unit tests now — Stage 5 only *runs* the suite, it never authors tests. Untested new logic is a Definition-of-Done failure, not a Stage-5 gap.
|
|
24
|
+
5. **Commit** with a conventional-commit subject:
|
|
24
25
|
- `feat(<scope>): <short>` for new behavior
|
|
25
26
|
- `fix(<scope>): <short>` for bug fixes
|
|
26
27
|
- `refactor(<scope>): <short>` for reshape
|
|
@@ -40,13 +40,13 @@ Forward pipeline's Stage 7. Invoked by `/muggle-do` after stages 1–6 of a fres
|
|
|
40
40
|
|
|
41
41
|
After every repo is processed, build the watcher manifest and dispatch one watcher loop per opened PR. The dispatches are the LAST action this stage takes.
|
|
42
42
|
|
|
43
|
-
Write
|
|
43
|
+
Write `~/.muggle-ai/muggle-do/sessions/<slug>/prs.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#prsjson):
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
[{ "repo": "owner/repo", "number": 142, "url": "...", "head_sha": "...", "state": "open" }]
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Seed
|
|
49
|
+
Seed `~/.muggle-ai/muggle-do/sessions/<slug>/last_seen.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#last_seenjson) — empty cursor shape with `pushed_shas: []`. Forward mode never has prior reviews to skip, so `reviewId: 0`.
|
|
50
50
|
|
|
51
51
|
**Do not** seed `cycle.json` or `requirements.md`. The watcher is a dumb pipe; `/muggle-do` reads reviews off GitHub.
|
|
52
52
|
|
|
@@ -13,7 +13,7 @@ Does **not** create a PR, seed session state, or dispatch a watcher (`/muggle-do
|
|
|
13
13
|
## Inputs
|
|
14
14
|
|
|
15
15
|
- Per-repo: path, branch (head ref name).
|
|
16
|
-
- The existing PR URL + number from
|
|
16
|
+
- The existing PR URL + number from `~/.muggle-ai/muggle-do/sessions/<slug>/prs.json`.
|
|
17
17
|
- **Optional** E2E acceptance report from stage 6. Produced by [`../e2e-acceptance.md`](../e2e-acceptance.md); schema in [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md).
|
|
18
18
|
|
|
19
19
|
## Procedure
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mprfollowup
|
|
3
|
+
description: Explicit short alias for the `muggle-pr-followup` skill. ONLY invoke when the user explicitly types `mprfollowup` or `/mprfollowup` — never auto-trigger from any other phrasing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# mprfollowup — alias for muggle-pr-followup
|
|
7
|
+
|
|
8
|
+
Invoke the `muggle-pr-followup` skill via the Skill tool. Forward any user-provided arguments unchanged.
|
|
@@ -37,6 +37,7 @@ If the user intent clearly matches one command, route directly — no menu neede
|
|
|
37
37
|
- test localhost/validate single feature/test a feature → `muggle-test-feature-local`
|
|
38
38
|
- build/implement from request/end-to-end → `muggle-do`
|
|
39
39
|
- post results to PR/attach walkthrough/visual evidence on PR → `muggle-pr-visual-walkthrough`
|
|
40
|
+
- watch my PR for reviews/follow up on PR reviews/babysit PR review thread → `muggle-pr-followup`
|
|
40
41
|
- give feedback on a run/the test was wrong/step N didn't work/show my feedback/delete feedback → `muggle-feedback`
|
|
41
42
|
|
|
42
43
|
If intent is ambiguous, use `AskUserQuestion` with the most likely options rather than asking the user to type a clarification.
|
|
@@ -25,6 +25,31 @@ Runs an autonomous dev cycle from requirements to PR. **Fire and review:** user
|
|
|
25
25
|
|
|
26
26
|
Stage 7 dispatches one watcher per opened PR as its last action.
|
|
27
27
|
|
|
28
|
+
## Execution protocol (non-negotiable)
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
**Bootstrap before any code, in order:**
|
|
33
|
+
1. Emit telemetry — [`../_shared/telemetry-emit.md`](../_shared/telemetry-emit.md), `skillName: "muggle-do"`.
|
|
34
|
+
2. Create `~/.muggle-ai/muggle-do/sessions/<slug>/` with `state.md` + `iterations/001.md` (pre-flight owns this; do it even when running unattended).
|
|
35
|
+
3. `TodoWrite` one item per stage 1–8 — these stages are the checklist; never swap in your own decomposition.
|
|
36
|
+
|
|
37
|
+
**Per stage:** read the file → execute it → append a marker to `iterations/<NNN>.md` citing the evidence that file requires (jest exit code, E2E verdict + `runId`, screenshot path). A stage is done only when its evidence is written, never on recollection.
|
|
38
|
+
|
|
39
|
+
### "Autonomous" / "without my intervention" collapses exactly one thing
|
|
40
|
+
Best-effort the Stage-1 questionnaire and don't ask. It does **not** license skipping telemetry, session artifacts, requirements, unit tests, E2E (`autoE2ETest` defaults to `always`), browser verification, the gate below, or the watcher hand-off. Run the whole pipeline silently — never a shortcut.
|
|
41
|
+
|
|
42
|
+
### Definition of Done — gate before Stage 7
|
|
43
|
+
Do not create or update a PR until each line holds, or is waived by a one-line reason written into `state.md` (silence is not a waiver):
|
|
44
|
+
- `requirements.md` written (forward runs)
|
|
45
|
+
- Build clean — typecheck + lint on changed files
|
|
46
|
+
- New/changed logic carries unit tests (authored in Stage 3; Stage 5 only runs the suite)
|
|
47
|
+
- Unit suite run, PASS recorded
|
|
48
|
+
- E2E verdict recorded with `runId` per `autoE2ETest` — or `[E2E FAILING]` / `SKIPPED` + reason
|
|
49
|
+
- UI changes verified in a real browser with evidence (screenshot path or muggle `runId`); `curl` + `grep` is not verification
|
|
50
|
+
|
|
51
|
+
Opening a PR with an unchecked, unwaived line is a cycle failure.
|
|
52
|
+
|
|
28
53
|
## Address-reviews flow
|
|
29
54
|
|
|
30
55
|
When invoked with the directive (PR URL + slug + review ids), routes to [`../do/address-reviews.md`](../do/address-reviews.md). Shares stages 3–6 + walkthrough with the forward pipeline; skips pre-flight, requirements, and PR creation. See the orchestrator for the cycle's exact step order, classification rules, and respawn logic.
|
|
@@ -50,7 +75,7 @@ When in doubt between #3 and #4, ask one question.
|
|
|
50
75
|
|
|
51
76
|
## Session model
|
|
52
77
|
|
|
53
|
-
|
|
78
|
+
`~/.muggle-ai/muggle-do/sessions/<slug>/`. Schemas: [`../muggle-pr-followup/state-schemas.md`](../muggle-pr-followup/state-schemas.md).
|
|
54
79
|
|
|
55
80
|
| File | Owner |
|
|
56
81
|
| :--- | :---- |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-feedback
|
|
3
|
-
description:
|
|
3
|
+
description: Use when the user wants to flag that a generated Muggle Test action script — or one specific step in it — did the wrong thing, and have it captured so Muggle can analyze and regenerate affected scripts. Covers any report that a script or step is wrong, broken, or misbehaving (clicked the wrong element, bad summary, "step N didn't work", "broken at the submit step"), whether the user just ran a test locally or remotely or pastes a Muggle dashboard run/script URL and points at what failed. Also use to view, list, or delete previously submitted feedback. Triggers on '/muggle-feedback', 'give feedback on this run', 'the test was wrong', 'flag this run', 'show/list/delete my feedback'. Auto-detects run context from a recent local run, a remote run, or a dashboard URL in the prompt.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Muggle Test Feedback
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-pr-followup
|
|
3
|
-
description:
|
|
4
|
-
disable-model-invocation: true
|
|
3
|
+
description: Use this skill when the user wants a pull request's incoming review feedback handled for them — it watches one PR's review thread and, each time a reviewer submits new comments, dispatches the work to address them. Engage on PR-review-follow-up intent: "watch my PR and address review comments as they come in", "keep an eye on PR #123 and respond to reviewer feedback", "follow up on my PR's reviews", "babysit my PR's review thread", "auto-handle reviews on the PR I just opened", "I'm stepping away — handle my PR's reviews while I'm gone". Run with no args to track every PR you pushed this session (any repo); pass a PR URL to start watching a specific one. This is PR-review-specific automation: when the recurring thing the user wants handled is a PR's review comments, use this — not the generic `loop` skill. It only watches and dispatches; the actual edits and replies are `muggle-do`. Not for posting test results to a PR (use muggle-pr-visual-walkthrough).
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# muggle-pr-followup
|
|
@@ -37,11 +37,13 @@ Per [`../_shared/github-cli-recipes/verify-working-tree.md`](../_shared/github-c
|
|
|
37
37
|
|
|
38
38
|
### Step 4 — Resolve the slug
|
|
39
39
|
|
|
40
|
-
Default: `<repo>-pr<n>` (e.g. `muggle-ai-works-pr154`). Override: `--slug=<name>`. Session dir is
|
|
40
|
+
Default: `<repo>-pr<n>` (e.g. `muggle-ai-works-pr154`). Override: `--slug=<name>`. Session dir is `~/.muggle-ai/muggle-do/sessions/<slug>/` (under the user's home, shared across repos; the slug's repo-pr<n> prefix keeps it unique).
|
|
41
41
|
|
|
42
42
|
### Step 5 — Idempotency check
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
**Legacy-slot migration.** Pre-move sessions lived at the repo-relative `.muggle-do/sessions/<slug>/` ([`state-schemas.md`](state-schemas.md#legacy-location)). If the new home-dir slot is absent but `<working-tree>/.muggle-do/sessions/<slug>/` exists (working tree from Step 3), move it to the new location first — this carries an in-flight watcher's cursor, `escalated_review_ids`, and `pushed_shas` across the upgrade. Bootstrap is the only stage that performs this: it is the one entry point that knows the old repo-relative path (the cwd), and it is the natural re-entry point after a plugin upgrade. A slot that fails to migrate loses nothing durable — GitHub holds the reviews, so a fresh bootstrap (cursor `0`) re-processes them.
|
|
45
|
+
|
|
46
|
+
If `~/.muggle-ai/muggle-do/sessions/<slug>/` exists (including a slot just migrated above):
|
|
45
47
|
|
|
46
48
|
- Without `--resume` → exit with the slot-conflict abort. Both remedies (delete + re-run, or pass `--resume`) are spelled out in the message.
|
|
47
49
|
- With `--resume` → refresh `prs.json[0].head_sha` to the current `headRefOid` from Step 2; leave `last_seen.json` and the cursor untouched. If `state.md` already has a `## Pre-flight answers` block, skip to Step 8; if not (older session), run Step 6.5 to backfill it, then skip to Step 8.
|
|
@@ -61,7 +63,7 @@ Capture the fields for Step 7. Do **not** run E2E now — the first watcher tick
|
|
|
61
63
|
|
|
62
64
|
Identify the loop user once per [`../_shared/github-cli-recipes/loop-user-identity.md`](../_shared/github-cli-recipes/loop-user-identity.md); cache in `state.md`.
|
|
63
65
|
|
|
64
|
-
Write under
|
|
66
|
+
Write under `~/.muggle-ai/muggle-do/sessions/<slug>/`:
|
|
65
67
|
|
|
66
68
|
**`prs.json`** — see [`state-schemas.md`](state-schemas.md#prsjson). One entry, `state` = `"open"`, `head_sha` from Step 2's `headRefOid`.
|
|
67
69
|
|
|
@@ -16,7 +16,7 @@ Routing into this mode is documented in [`SKILL.md`](SKILL.md#routing). The arch
|
|
|
16
16
|
|
|
17
17
|
## Inputs from disk
|
|
18
18
|
|
|
19
|
-
Read these from
|
|
19
|
+
Read these from `~/.muggle-ai/muggle-do/sessions/<slug>/`:
|
|
20
20
|
|
|
21
21
|
- `prs.json` — see [`state-schemas.md`](state-schemas.md#prsjson). The watcher touches the single entry whose `number` matches the dispatched PR number.
|
|
22
22
|
- `last_seen.json` — see [`state-schemas.md`](state-schemas.md#last_seenjson). Keyed by `"<owner>/<repo>#<n>"`.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# Session State Schemas
|
|
2
2
|
|
|
3
|
-
Canonical shapes for the JSON files in a PR-follow-up session slot. The slot path is
|
|
3
|
+
Canonical shapes for the JSON files in a PR-follow-up session slot. The slot path is `~/.muggle-ai/muggle-do/sessions/<slug>/` (under the user's home, shared across repos; `muggle-do` is the current and only caller).
|
|
4
4
|
|
|
5
5
|
All files are atomic writes — the caller rewrites the whole file each time, never mutates in place. Use a temp file + rename if the platform supports it.
|
|
6
6
|
|
|
7
|
+
## Legacy location
|
|
8
|
+
|
|
9
|
+
Before the move to the user's home, slots lived at the repo-relative `.muggle-do/sessions/<slug>/` (one per working tree, still gitignored). Bootstrap's Step 5 migrates a legacy slot to the home-dir location on the next run for that PR; nothing else reads the old path. The state is ephemeral and reconstructible from GitHub, so an un-migrated slot costs only a re-bootstrap, not data.
|
|
10
|
+
|
|
7
11
|
## `prs.json`
|
|
8
12
|
|
|
9
13
|
A list of one entry. (Historical: the file is an array for forward-compat with the original session-wide model. Today, each PR has its own session slot, so the array always has exactly one entry.)
|
|
@@ -28,7 +28,8 @@ For each option: label = key name, description = first paragraph of `preference-
|
|
|
28
28
|
- `multiSelect: true`, `header: "Auth & session"` — `autoLogin`, `autoSelectProject`, `checkForUpdates`, `verboseOutput`
|
|
29
29
|
- `multiSelect: true`, `header: "Test setup"` — `autoSelectLocalHost`, `autoDetectChanges`, `autoReuseValidationContext`
|
|
30
30
|
- `multiSelect: true`, `header: "Test run"` — `showElectronBrowser`, `openTestResultsAfterRun`, `autoPublishLocalResults`
|
|
31
|
-
- `multiSelect: true`, `header: "Suggestions
|
|
31
|
+
- `multiSelect: true`, `header: "Suggestions"` — `suggestRelatedUseCases`, `suggestRelatedTestCases`
|
|
32
|
+
- `multiSelect: true`, `header: "PR"` — `postPRVisualWalkthrough`, `autoCreatePR`, `autoWatchPR`
|
|
32
33
|
- `multiSelect: true`, `header: "Branch hygiene"` — `autoUseWorktree`, `autoRebase`, `autoCleanup`
|
|
33
34
|
- `multiSelect: false`, `header: "E2E acceptance"` — `autoE2ETest`. Options: `Always run Stage 6 at the end` (`always` — default), `Ask each cycle` (`ask`). No `never` option.
|
|
34
35
|
- `multiSelect: false`, `header: "Default mode"` — `defaultExecutionMode`. Options: `Local — run on my computer` (`local`), `Remote — run in the Muggle Test cloud` (`remote`), `Ask each time` (don't change).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# `autoWatchPR`
|
|
2
|
+
|
|
3
|
+
After a PR is sent at the end of a test run, controls whether Muggle starts a `muggle-pr-followup` watcher on it — a loop that polls the PR for newly submitted reviews and hands them to `/muggle-do` to address — or leaves you to start one yourself with `/mprfollowup`. Fires once a PR exists (muggle-test, muggle-test-feature-local), reusing the E2E validation context from that run so the watcher never re-prompts. Substitute `{pr}`.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Watch PR?`, question `"Watch '{pr}' for review follow-ups and address them as they land?"`
|
|
6
|
+
- `Watch it` — `Start a muggle-pr-followup loop on this PR.` → `always`
|
|
7
|
+
- `Ask me next time` — `Decide per run.` → `ask`
|
|
8
|
+
- `Skip — I'll watch it myself` — `Leave it; run /mprfollowup later if you want.` → `never`
|
|
9
|
+
|
|
10
|
+
**Silent action**
|
|
11
|
+
- `always` → `Watching {pr} for review follow-ups`
|
|
12
|
+
- `ask` → `Asking about PR watching`
|
|
13
|
+
- `never` → `Not watching {pr}`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `reusePreparePlan`
|
|
2
|
+
|
|
3
|
+
Reuse the saved prepare plan for this stack (skip scope / viability / service-selection / start-commands and jump straight to check-running + smoke-test), or rediscover from scratch. Substitute `{services}` with a comma-separated list of saved service names.
|
|
4
|
+
|
|
5
|
+
**Picker 1** — header `Reuse prepare plan`, question `"Found a saved plan for this stack ({services}) — reuse it, or rediscover from scratch?"`
|
|
6
|
+
- `Reuse this plan` — `Skip the discovery questions; verify and start what's missing.` → `always`
|
|
7
|
+
- `Rediscover from scratch` — `Re-ask scope, services, and start commands.` → `never`
|
|
8
|
+
|
|
9
|
+
**Silent action**
|
|
10
|
+
- `always` → `Reusing saved prepare plan ({services})`
|
|
11
|
+
- `never` → `Rediscovering this stack from scratch`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-status
|
|
3
|
-
description:
|
|
3
|
+
description: Use this skill to check the health of the user's Muggle AI installation and diagnose why it's misbehaving — MCP server connectivity, tool loading, login/auth validity, and overall setup. Engage on an explicit "muggle status", but also on any diagnostic question about Muggle itself: "is muggle working / healthy / set up right?", "why does muggle keep failing / timing out / saying it can't connect?", "are the muggle MCP tools actually loading?", "is my muggle login/auth still valid?", "muggle's been acting up — take a look / what's wrong?", "muggle commands fail silently — is the install unhealthy?". This is diagnosis and reporting: prefer it over answering from memory whenever the user is unsure Muggle itself is functioning. Boundary: checking/diagnosing is muggle-status; actually fixing a broken install is muggle-repair (a clear "fix it" goes there). Not for the health of the user's own app, CI, or infrastructure.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Muggle Test Status
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-test
|
|
3
|
-
description: "Run change-driven E2E acceptance testing using Muggle AI —
|
|
3
|
+
description: "Run change-driven E2E acceptance testing using Muggle AI — detect the user's recent code changes (local diff or a PR), map them to affected user flows, then run real-browser acceptance tests on localhost or a deployed preview/staging URL, publish results to the dashboard, and post a screenshot summary to the PR. Use this whenever the user wants to test, validate, check, or regression-test their own changes or work — 'test my changes', 'validate my changes', 'regression test my work', 'make sure I didn't break anything', 'did my recent commits/changes break anything or any user flows?', 'test before I push' — and especially as the acceptance-test gate before opening a pull request or merging (e.g. 'validate my changes before I open the PR' means run the acceptance suite, not just a completion checklist). The defining signal is change-driven validation of in-progress work tied to a commit, push, PR, or merge. For testing one specific named feature/flow use muggle-test-feature-local; this is not importing existing tests, configuring preferences, or replaying a single named script."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Muggle Test — Change-Driven E2E Acceptance Router
|
|
@@ -49,6 +49,7 @@ Gates run per `preference-gates/README.md`.
|
|
|
49
49
|
| `showElectronBrowser` | 7A | Show the Electron browser window during local test execution (vs. run headless) |
|
|
50
50
|
| `postPRVisualWalkthrough` | 9 | Post visual walkthrough to PR after results are available |
|
|
51
51
|
| `autoCreatePR` | 9 (if no PR) | Auto-create the PR when posting the walkthrough has no PR to target |
|
|
52
|
+
| `autoWatchPR` | 9.5 (if a PR exists) | Start a `muggle-pr-followup` watcher on the PR after the run |
|
|
52
53
|
|
|
53
54
|
## Step 1: Confirm Scope of Work (Always First)
|
|
54
55
|
|
|
@@ -413,12 +414,24 @@ Tell the user:
|
|
|
413
414
|
|
|
414
415
|
After reporting results:
|
|
415
416
|
|
|
416
|
-
1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip → Step
|
|
417
|
+
1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip → Step 9.5.
|
|
417
418
|
2. `gh pr view --json number,title,url 2>/dev/null` — find the PR.
|
|
418
|
-
3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip → Step
|
|
419
|
+
3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip → Step 9.5.
|
|
419
420
|
4. Assemble the `E2eReport` — see [`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md). Include all runs from Step 7A (passed and failed).
|
|
420
421
|
5. Invoke [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A with the `E2eReport`.
|
|
421
422
|
|
|
423
|
+
## Step 9.5: Offer to watch the PR for review follow-ups
|
|
424
|
+
|
|
425
|
+
Once a PR exists for this work, offer to keep watching its review thread.
|
|
426
|
+
|
|
427
|
+
1. Identify the PR — reuse the `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.
|
|
428
|
+
2. Fire [`autoWatchPR`](../muggle-preferences/preference-gates/autoWatchPR.md) with `{pr}` = `<owner>/<repo>#<number>`. On skip → Step 10.
|
|
429
|
+
3. On proceed: start the watcher reusing this run's context so it never re-prompts —
|
|
430
|
+
- Seed the `muggle-pr-followup` session slot and dispatch its loop per the stage-8 seeding in [`../do/open-prs/forward.md`](../do/open-prs/forward.md) (default slug `<repo>-pr<number>`).
|
|
431
|
+
- Additionally write `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`](../_shared/resolve-e2e-validation-context.md#persisted-fields). Strategy = `local-e2e` (local run), `staging-replay` (remote), or `unit-only`/`skip` if no E2E ran.
|
|
432
|
+
|
|
433
|
+
The `/mprfollowup` shortcut starts the same watcher manually at any time.
|
|
434
|
+
|
|
422
435
|
## Step 10: Offer feedback on failures
|
|
423
436
|
|
|
424
437
|
After the report is complete, if **any** test in the run had a `failed` or unexpected status (or the user verbally flags something looked off), suggest the feedback skill:
|
|
@@ -51,6 +51,7 @@ Gates run per `preference-gates/README.md`.
|
|
|
51
51
|
| `openTestResultsAfterRun` | 8 | Open results page on Muggle Test dashboard after run |
|
|
52
52
|
| `postPRVisualWalkthrough` | 10 | Post visual walkthrough to PR after results |
|
|
53
53
|
| `autoCreatePR` | 10 (if no PR) | Auto-create the PR when posting the walkthrough has no PR to target |
|
|
54
|
+
| `autoWatchPR` | 10.5 (if a PR exists) | Start a `muggle-pr-followup` watcher on the PR after the run |
|
|
54
55
|
| `autoCleanup` | post-merge | Run cleanup after the PR for this work is merged (see [`_shared/post-merge-cleanup.md`](../_shared/post-merge-cleanup.md)) |
|
|
55
56
|
|
|
56
57
|
## Workflow
|
|
@@ -242,12 +243,24 @@ Non-blocking — one click to dismiss. Do not re-ask for the same `runId` within
|
|
|
242
243
|
|
|
243
244
|
After reporting results:
|
|
244
245
|
|
|
245
|
-
1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip →
|
|
246
|
+
1. Fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md). On skip → 10.5.
|
|
246
247
|
2. `gh pr view --json number,title,url 2>/dev/null` — find the PR.
|
|
247
|
-
3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip →
|
|
248
|
+
3. If no PR: fire [`autoCreatePR`](../muggle-preferences/preference-gates/autoCreatePR.md). On skip → 10.5.
|
|
248
249
|
4. Assemble the `E2eReport` — see [`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md).
|
|
249
250
|
5. Invoke [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A with the `E2eReport`.
|
|
250
251
|
|
|
252
|
+
### 10.5. Offer to watch the PR for review follow-ups
|
|
253
|
+
|
|
254
|
+
Once a PR exists for this work, offer to keep watching its review thread.
|
|
255
|
+
|
|
256
|
+
1. Identify the PR — reuse the `gh pr view --json number,title,url` result from section 10 if available, else run it now. No PR (none exists, none created) → end.
|
|
257
|
+
2. Fire [`autoWatchPR`](../muggle-preferences/preference-gates/autoWatchPR.md) with `{pr}` = `<owner>/<repo>#<number>`. On skip → end.
|
|
258
|
+
3. On proceed: start the watcher reusing this run's context so it never re-prompts —
|
|
259
|
+
- Seed the `muggle-pr-followup` session slot and dispatch its loop per the stage-8 seeding in [`../do/open-prs/forward.md`](../do/open-prs/forward.md) (default slug `<repo>-pr<number>`).
|
|
260
|
+
- Additionally write `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`](../_shared/resolve-e2e-validation-context.md#persisted-fields). Strategy = `local-e2e` for this local E2E run.
|
|
261
|
+
|
|
262
|
+
The `/mprfollowup` shortcut starts the same watcher manually at any time.
|
|
263
|
+
|
|
251
264
|
## Non-negotiables
|
|
252
265
|
|
|
253
266
|
- No silent auth skip.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muggle-test-prepare
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use this skill to get a user's local environment ready before running E2E acceptance tests — verifying that the dev servers, APIs, and sibling services they need are actually up and responding, and offering to start whatever is missing (with approval at each step). Trigger whenever the user wants to confirm that specific ports or localhost URLs are listening/up before testing (e.g. 'check if localhost:3000 and the api on 8080 are listening', 'are my services up?'), make sure required services are running, spin up or prepare their local dev stack, or verify their setup — and whenever another muggle skill (muggle-test, muggle-do, muggle-test-feature-local) needs services running but they're not listening on the expected ports. This is environment readiness and service startup, not running the tests themselves."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Muggle Test Prepare
|
|
@@ -45,6 +45,8 @@ All launched processes are tracked in `/tmp/muggle-test-prepare.json`:
|
|
|
45
45
|
|
|
46
46
|
`testing_scope` records what the user is testing (from [scope](./steps/scope.md)). `excluded_services` records services the user said can't run locally (from [viability-check](./steps/viability-check.md)).
|
|
47
47
|
|
|
48
|
+
This file is **ephemeral runtime state**, not the saved recipe. The durable plan lives at `<repo>/.muggle-ai/prepare-plan.json` (or the parent-dir-keyed entry in `~/.muggle-ai/prepare-plans.json`) and is consulted in [reuse-plan](./steps/reuse-plan.md) before any other stage. The two files never merge.
|
|
49
|
+
|
|
48
50
|
**On every invocation**, check this file first. If it exists with live PIDs (verify with `kill -0`), `AskUserQuestion`:
|
|
49
51
|
- Option 1: "Keep them running — skip to testing"
|
|
50
52
|
- Option 2: "Tear down and start fresh"
|
|
@@ -59,6 +61,7 @@ Gates run per [`preference-gates/README.md`](../muggle-preferences/preference-ga
|
|
|
59
61
|
| Preference | Gates |
|
|
60
62
|
|------------|-------|
|
|
61
63
|
| `autoRebase` | [rebase-check](./steps/rebase-check.md) — rebase onto `origin/<default>` before starting dev servers |
|
|
64
|
+
| `reusePreparePlan` | [reuse-plan](./steps/reuse-plan.md) — reuse the saved prepare plan for this stack, or rediscover |
|
|
62
65
|
|
|
63
66
|
## Workflow
|
|
64
67
|
|
|
@@ -66,6 +69,7 @@ Run the stages in this order. The sequence number is display-only — it lives o
|
|
|
66
69
|
|
|
67
70
|
| # | Stage | Summary |
|
|
68
71
|
|:--|:------|:--------|
|
|
72
|
+
| 0 | [reuse-plan](./steps/reuse-plan.md) | Reuse saved prepare plan (gated); short-circuits to check-running on reuse |
|
|
69
73
|
| 1 | [rebase-check](./steps/rebase-check.md) | Rebase onto default branch (gated) |
|
|
70
74
|
| 2 | [scope](./steps/scope.md) | Frontend / backend / full stack |
|
|
71
75
|
| 3 | [viability-check](./steps/viability-check.md) | Exclude services that can't run locally |
|
|
@@ -6,7 +6,7 @@ Run port detection and (when an app declares a backend URL) backend-health probe
|
|
|
6
6
|
|
|
7
7
|
If **all** required services are running, skip straight to [smoke-test](./smoke-test.md) — don't trust port-listening alone.
|
|
8
8
|
|
|
9
|
-
If some are running, acknowledge and continue to [start-commands](./start-commands.md) only for the missing ones. For already-running services:
|
|
9
|
+
If some are running, acknowledge and continue to [start-commands](./start-commands.md) only for the missing ones. **Exception:** when this stage is entered via the [reuse-plan](./reuse-plan.md) short-circuit, the missing entries already have their `command` populated in `/tmp/muggle-test-prepare.json` from the reused plan — skip `start-commands` and go straight to [env-file](./env-file.md). For already-running services:
|
|
10
10
|
- Option 1: "It's fine, keep it"
|
|
11
11
|
- Option 2: "Restart it"
|
|
12
12
|
|
|
@@ -16,11 +16,13 @@ Mark kept services as `external: true` in the tracking file so cleanup leaves th
|
|
|
16
16
|
|
|
17
17
|
When the user wants a port held by a process they did **not** select (typically a stale dev server from a sibling worktree):
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The held process is likely something the user is still using — a current test or dev server they value more than this prepare run. Don't auto-decide; leave the kill-vs-pause call to them.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- Option
|
|
21
|
+
> "Port 3999 is held by PID 87421 (you didn't select this process — it may be a test or dev server you're still using). How do you want to proceed?"
|
|
22
|
+
|
|
23
|
+
- Option 1: "Use the next available port" (recommended — non-destructive, leaves the existing process running)
|
|
24
|
+
- Option 2: "Force-kill PID 87421 and claim port 3999" (kill-switch — only if you don't need that process)
|
|
25
|
+
- Option 3: "Pause — leave it running, I'll finish up and re-run prepare later"
|
|
24
26
|
|
|
25
27
|
**Option 1**: probe `3999 + N` for `N = 1, 2, …` until nothing listens. Record the new port and any env file edit (`PORT=` in `.env.local` etc.). Dev server may need restart to pick up.
|
|
26
28
|
|
|
@@ -24,3 +24,33 @@ If you launched the services:
|
|
|
24
24
|
Logs: /tmp/muggle-prepare-*.log
|
|
25
25
|
Cleanup: say "stop services" or re-invoke this skill.
|
|
26
26
|
```
|
|
27
|
+
|
|
28
|
+
## Save the plan
|
|
29
|
+
|
|
30
|
+
If this run came through discovery (i.e. Stage 0 [reuse-plan](./reuse-plan.md) did **not** short-circuit), persist the plan so the next run can skip the questions.
|
|
31
|
+
|
|
32
|
+
Build the JSON from the in-memory tracking file, dropping runtime fields:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
jq '{
|
|
36
|
+
version: 1,
|
|
37
|
+
updated: now | todate,
|
|
38
|
+
testing_scope: .testing_scope,
|
|
39
|
+
excluded_services: .excluded_services,
|
|
40
|
+
services: [.services[] | {name, dir, command, port}]
|
|
41
|
+
}' /tmp/muggle-test-prepare.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Resolve the write location:
|
|
45
|
+
|
|
46
|
+
- If `git rev-parse --show-toplevel` succeeds (call the result `$REPO`) → write `$REPO/.muggle-ai/prepare-plan.json`. Create `$REPO/.muggle-ai/` if missing.
|
|
47
|
+
- Else → upsert the entry under key `$(dirname "$PWD")` (absolute) in `~/.muggle-ai/prepare-plans.json`. Create the file as `{}` if missing.
|
|
48
|
+
|
|
49
|
+
Then print, once:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
✓ Saved this stack as your prepare plan — next run can skip the questions.
|
|
53
|
+
(Disable with `/muggle-preferences reusePreparePlan`.)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If this run short-circuited via [reuse-plan](./reuse-plan.md), don't rewrite — but **do** refresh `updated` and any `command` that was re-derived during validation. Skip the announcement on the refresh path.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Stage 0 — reuse saved plan (or fall through)
|
|
2
|
+
|
|
3
|
+
A previously saved **prepare plan** is the durable recipe for this stack. Distinct from the ephemeral `/tmp/muggle-test-prepare.json` tracker — that file holds live PIDs/logs and is rebuilt every run.
|
|
4
|
+
|
|
5
|
+
## Resolve
|
|
6
|
+
|
|
7
|
+
In order; first hit wins.
|
|
8
|
+
|
|
9
|
+
1. **Project plan.** If `git rev-parse --show-toplevel` succeeds (call the result `$REPO`) and `$REPO/.muggle-ai/prepare-plan.json` exists → load it.
|
|
10
|
+
2. **Global plan.** Else if `~/.muggle-ai/prepare-plans.json` exists, read the entry keyed by `$(dirname "$PWD")` (absolute path). If present → load that entry's value.
|
|
11
|
+
3. **No plan found** → exit this step; the workflow continues at [rebase-check](./rebase-check.md).
|
|
12
|
+
|
|
13
|
+
A loaded plan is a JSON object with `version`, `updated`, `testing_scope`, `excluded_services`, `services`. Reject and treat as "no plan" if `version != 1` or `services` is empty.
|
|
14
|
+
|
|
15
|
+
## Gate `reusePreparePlan`
|
|
16
|
+
|
|
17
|
+
Per [`muggle-preferences/preference-gates/README.md`](../../muggle-preferences/preference-gates/README.md). Read the current value from the `Muggle Test Preferences` session-context line; absent → `ask`.
|
|
18
|
+
|
|
19
|
+
- `always` → silently take the **reuse path** (below). Print the silent footer (substitute `{services}` with the comma-separated names from the loaded plan).
|
|
20
|
+
- `never` → take the **rediscover path**: exit this step; continue at [rebase-check](./rebase-check.md).
|
|
21
|
+
- `ask` → print the loaded plan as a table:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Service Directory Command Port
|
|
25
|
+
──────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
backend-api ~/Github/backend-api npm run dev 3001
|
|
27
|
+
…
|
|
28
|
+
──────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run Picker 1 from the gate file (substitute `{services}`). Then Picker 2 ("Remember this choice?") per the shared template. Branch by Picker 1.
|
|
32
|
+
|
|
33
|
+
## Reuse path
|
|
34
|
+
|
|
35
|
+
1. **Validate per service entry.** For each `{name, dir, command, port}`:
|
|
36
|
+
- `dir` exists → keep. Else drop the entry and log `"Dropped <name>: directory <dir> no longer exists"`.
|
|
37
|
+
- The indicator file that produced `command` still exists in `dir` (e.g. `package.json` for an `npm`/`node` command; see the indicator table in [start-commands](./start-commands.md)) → keep. Else re-derive **just that one entry** by running the indicator-detection from [start-commands](./start-commands.md) against `dir`, and replace its `command`. Log `"Re-derived <name>: <old> → <new>"`.
|
|
38
|
+
2. **All entries dropped** → discard the plan; continue at [rebase-check](./rebase-check.md). Otherwise proceed with surviving + re-derived entries.
|
|
39
|
+
3. **Hydrate** `/tmp/muggle-test-prepare.json` with the surviving entries (no PIDs yet, `testing_scope` from the plan, `excluded_services` from the plan).
|
|
40
|
+
4. **Short-circuit** to [check-running](./check-running.md). The skipped stages are [scope](./scope.md), [viability-check](./viability-check.md), [identify-services](./identify-services.md), [start-commands](./start-commands.md) — the reused plan supplies their answers. The remaining stages run normally: [env-file](./env-file.md), [fresh-install](./fresh-install.md), [start-services](./start-services.md) (only for entries not already listening), [smoke-test](./smoke-test.md), [readiness-report](./readiness-report.md).
|
|
41
|
+
|
|
42
|
+
## Rediscover path
|
|
43
|
+
|
|
44
|
+
Continue at [rebase-check](./rebase-check.md). The full normal flow runs.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "4.
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-05-
|
|
2
|
+
"release": "4.14.0",
|
|
3
|
+
"buildId": "run-45-1",
|
|
4
|
+
"commitSha": "47f4274095fc578a67e19811afc335a1b8e0c0b4",
|
|
5
|
+
"buildTime": "2026-05-29T22:27:05Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|