@muggleai/works 4.13.0 → 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/{chunk-QUWM3JQY.js → chunk-5G7WI7IY.js} +2 -2
- package/dist/{chunk-TWILR37J.js → chunk-YKR2TQ24.js} +16 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- 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/_shared/test-case-chain-readiness.md +41 -0
- 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 +22 -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/dist/{src-BD5AM6OH.js → src-ECRJW2LY.js} +1 -1
- 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/_shared/test-case-chain-readiness.md +41 -0
- 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 +22 -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,4 +1,4 @@
|
|
|
1
|
-
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, isFirstRun, writePreferences, DEFAULT_PREFERENCES, getDataDir, PREFERENCES_FILE_NAME, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, performLogin, toolRequiresAuth, getCallerCredentials, hasShownDisclosure, getDisclosureCopy, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require } from './chunk-
|
|
1
|
+
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, isFirstRun, writePreferences, DEFAULT_PREFERENCES, getDataDir, PREFERENCES_FILE_NAME, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, performLogin, toolRequiresAuth, getCallerCredentials, hasShownDisclosure, getDisclosureCopy, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require } from './chunk-YKR2TQ24.js';
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
3
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
@@ -736,7 +736,7 @@ async function resolveGsScreenshotUrls(report, opts) {
|
|
|
736
736
|
if (gsUrls.length === 0) {
|
|
737
737
|
return report;
|
|
738
738
|
}
|
|
739
|
-
const mcps = await import('./src-
|
|
739
|
+
const mcps = await import('./src-ECRJW2LY.js');
|
|
740
740
|
const credentials = await mcps.getCallerCredentialsAsync();
|
|
741
741
|
if (!credentials.bearerToken && !credentials.apiKey) {
|
|
742
742
|
stderrWrite(
|
|
@@ -3838,6 +3838,9 @@ var TestCaseListInputSchema = z.object({
|
|
|
3838
3838
|
var TestCaseGetInputSchema = z.object({
|
|
3839
3839
|
testCaseId: IdSchema.describe("Test case ID (UUID) to retrieve")
|
|
3840
3840
|
});
|
|
3841
|
+
var TestCaseAncestorsGetInputSchema = z.object({
|
|
3842
|
+
testCaseId: IdSchema.describe("Test case ID (UUID) to resolve the test-plan-graph ancestor chain for")
|
|
3843
|
+
});
|
|
3841
3844
|
var TestCaseListByUseCaseInputSchema = z.object({
|
|
3842
3845
|
useCaseId: IdSchema.describe("Use case ID (UUID) to list test cases for")
|
|
3843
3846
|
});
|
|
@@ -4701,6 +4704,18 @@ var testCaseTools = [
|
|
|
4701
4704
|
};
|
|
4702
4705
|
}
|
|
4703
4706
|
},
|
|
4707
|
+
{
|
|
4708
|
+
name: "muggle-remote-test-case-ancestors-get",
|
|
4709
|
+
description: "Resolve a test case's prerequisite chain from the project's test-plan graph. Returns { testCaseId, ancestors, orphan } where `ancestors` is an array of test case IDs ordered immediate-parent \u2192 root (empty when the case is a graph root). `orphan: true` means the case has no graph node, so it has no prerequisites. Call this before generating or replaying a script to ensure every prerequisite test case already has a ready script.",
|
|
4710
|
+
inputSchema: TestCaseAncestorsGetInputSchema,
|
|
4711
|
+
mapToUpstream: (input) => {
|
|
4712
|
+
const data = input;
|
|
4713
|
+
return {
|
|
4714
|
+
method: "GET",
|
|
4715
|
+
path: `${MUGGLE_TEST_PREFIX}/test-plan-graph/test-cases/${data.testCaseId}/ancestors`
|
|
4716
|
+
};
|
|
4717
|
+
}
|
|
4718
|
+
},
|
|
4704
4719
|
{
|
|
4705
4720
|
name: "muggle-remote-test-case-list-by-use-case",
|
|
4706
4721
|
description: "List test cases for a specific use case.",
|
|
@@ -7305,6 +7320,7 @@ __export(e2e_exports2, {
|
|
|
7305
7320
|
SecretListInputSchema: () => SecretListInputSchema,
|
|
7306
7321
|
SecretUpdateInputSchema: () => SecretUpdateInputSchema,
|
|
7307
7322
|
StripePaymentMethodIdSchema: () => StripePaymentMethodIdSchema,
|
|
7323
|
+
TestCaseAncestorsGetInputSchema: () => TestCaseAncestorsGetInputSchema,
|
|
7308
7324
|
TestCaseCreateInputSchema: () => TestCaseCreateInputSchema,
|
|
7309
7325
|
TestCaseGenerateFromPromptInputSchema: () => TestCaseGenerateFromPromptInputSchema,
|
|
7310
7326
|
TestCaseGetInputSchema: () => TestCaseGetInputSchema,
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-
|
|
2
|
-
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-5G7WI7IY.js';
|
|
2
|
+
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-YKR2TQ24.js';
|
|
@@ -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.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Test Case Chain Readiness
|
|
2
|
+
|
|
3
|
+
A test case may depend on prerequisite ("parent") test cases in the project's **test-plan graph** — e.g. "edit item" depends on "create item". Before generating or replaying the chosen test case, every ancestor in that chain must already have a ready script, or the run starts from missing state and fails for the wrong reason.
|
|
4
|
+
|
|
5
|
+
This is the **graph the backend owns** — do not infer the chain from titles or `precondition` text. Read it from `muggle-remote-test-case-ancestors-get`.
|
|
6
|
+
|
|
7
|
+
**Ready** = `muggle-remote-test-script-list` (with the ancestor's `testCaseId`) returns at least one replayable/succeeded script — the same bar Step 5 uses to offer replay.
|
|
8
|
+
|
|
9
|
+
## Procedure
|
|
10
|
+
|
|
11
|
+
Run once the target `testCaseId` is chosen and the local URL + services are confirmed (the generation calls below need `localUrl` and `cwd`).
|
|
12
|
+
|
|
13
|
+
1. **Resolve the chain.** `muggle-remote-test-case-ancestors-get` with the target `testCaseId`. Response: `{ testCaseId, ancestors, orphan }`.
|
|
14
|
+
- `orphan: true` **or** empty `ancestors` → no prerequisites. Skip the rest; continue to Step 5.
|
|
15
|
+
- Otherwise `ancestors` is ordered **immediate-parent → root**. Reverse it to **root-first** so prerequisites are satisfied bottom-up.
|
|
16
|
+
|
|
17
|
+
2. **For each ancestor, root-first:**
|
|
18
|
+
- Check readiness via `muggle-remote-test-script-list` (`projectId`, `testCaseId` = ancestor). Ready → skip to the next ancestor.
|
|
19
|
+
- Not ready → **generate its script only (never replay):**
|
|
20
|
+
1. `muggle-remote-test-case-get` for the ancestor.
|
|
21
|
+
2. Determine `freshSession` for that ancestor from its own content — same rules as Step 6.
|
|
22
|
+
3. `muggle-local-execute-test-generation` with the ancestor test case, `localUrl`, `cwd`, and a long `timeoutMs` (see Step 6's timeout guidance). Do **not** call `muggle-local-execute-replay`.
|
|
23
|
+
4. `muggle-local-publish-test-script` (`runId`, `cloudTestCaseId` = ancestor) so the generated script is promoted as that ancestor's canonical replay script — it now reads as ready for any case downstream.
|
|
24
|
+
|
|
25
|
+
3. **All ancestors ready** → continue to Step 5 for the target test case.
|
|
26
|
+
|
|
27
|
+
## When an ancestor's generation fails
|
|
28
|
+
|
|
29
|
+
If an ancestor's generation does not reach `passed` (read it via `muggle-local-run-result-get`, never the execute stdout tail), the target's prerequisite state is missing. **Halt the chain** and surface which ancestor failed and why, then ask via `AskUserQuestion`:
|
|
30
|
+
|
|
31
|
+
- **Stop** — don't run the target; the chain is broken.
|
|
32
|
+
- **Proceed anyway** — run the target without the prerequisite (likely to fail; only if the user judges the state already exists).
|
|
33
|
+
- **Give feedback** — invoke the `muggle-feedback` skill with the failed ancestor's `runId`.
|
|
34
|
+
|
|
35
|
+
Do not silently skip a failed ancestor and run the target.
|
|
36
|
+
|
|
37
|
+
## Notes
|
|
38
|
+
|
|
39
|
+
- The target test case is **not** in its own `ancestors` list — only its prerequisites are.
|
|
40
|
+
- Each ancestor is a single path to the root (one parent per node), so the reversed list has no duplicates; generate each at most once per session.
|
|
41
|
+
- This walks the **full** chain to root, not just the immediate parent — a grandparent without a ready script is generated before its child.
|
|
@@ -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
|
|
@@ -127,6 +128,12 @@ Gate `autoSelectLocalHost` per `preference-gates/README.md` + `preference-gates/
|
|
|
127
128
|
|
|
128
129
|
Remind them: local URL is only the execution target, not tied to cloud project config.
|
|
129
130
|
|
|
131
|
+
### 4a. Satisfy the test case chain (prerequisite parents)
|
|
132
|
+
|
|
133
|
+
Before deciding the target's script, resolve its prerequisite chain from the backend test-plan graph and ensure every ancestor already has a ready script — generating any that don't, **test-generation only**, root-first. Follow [`_shared/test-case-chain-readiness.md`](../_shared/test-case-chain-readiness.md).
|
|
134
|
+
|
|
135
|
+
`muggle-remote-test-case-ancestors-get` returns the chain; an `orphan` test case has no prerequisites — skip straight to Step 5. Do **not** infer parents from `precondition` text; the graph is authoritative.
|
|
136
|
+
|
|
130
137
|
### 5. Existing scripts vs new generation
|
|
131
138
|
|
|
132
139
|
`muggle-remote-test-script-list` with `testCaseId`.
|
|
@@ -236,17 +243,30 @@ Non-blocking — one click to dismiss. Do not re-ask for the same `runId` within
|
|
|
236
243
|
|
|
237
244
|
After reporting results:
|
|
238
245
|
|
|
239
|
-
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.
|
|
240
247
|
2. `gh pr view --json number,title,url 2>/dev/null` — find the PR.
|
|
241
|
-
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.
|
|
242
249
|
4. Assemble the `E2eReport` — see [`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md).
|
|
243
250
|
5. Invoke [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A with the `E2eReport`.
|
|
244
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
|
+
|
|
245
264
|
## Non-negotiables
|
|
246
265
|
|
|
247
266
|
- No silent auth skip.
|
|
248
267
|
- **Never prompt for Electron launch approval** before execution — invoking this skill is the approval. Just run.
|
|
249
268
|
- **Never diagnose a failed run from `execute`'s response stdout tail.** Always call `muggle-local-run-result-get` first; classify only from its structured fields and (when present) the artifacts it names. The execute tail is an excerpt and routinely truncates the failure cause.
|
|
269
|
+
- Satisfy the prerequisite chain (Step 4a) before generating or replaying the target. Read it from `muggle-remote-test-case-ancestors-get` — never infer parents from `precondition` text. Generate any not-ready ancestor test-generation-only, root-first.
|
|
250
270
|
- If replayable scripts exist, do not default to generation without user choice.
|
|
251
271
|
- No hiding failures: surface errors and artifact paths.
|
|
252
272
|
- **Always offer the agent-guidance reminder after every Electron run** (Step 9b) — pass or fail — unless 9a already routed the user into `muggle-feedback`. Never silently end a run without giving the user a one-click path to flag what was wrong.
|
|
@@ -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 |
|