From muggle
Verifies local dev servers and APIs are up before E2E tests, and offers to start missing services with user approval. Useful for environment readiness and service startup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/muggle:muggle-test-prepareopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-test-prepare"`.
Telemetry first step: see
_shared/telemetry-emit.md. UseskillName: "muggle-test-prepare".
Make sure the local services a user needs for E2E acceptance testing are up and ready. Check what's already running, discover sibling service directories by folder name, and offer to start anything that's missing — always with the user in control.
Some users start their own services (tmux scripts, docker-compose, a terminal per service). Others want help launching them. This skill handles both: it verifies readiness first, and only offers to start things when something is missing.
This skill touches the user's local machine — processes, ports, directories outside the current repo. Every action is explicit and confirmed.
package.json, Makefile, Cargo.toml, go.mod, pyproject.toml, docker-compose.yml) to determine the start command.All launched processes are tracked in /tmp/muggle-test-prepare.json:
{
"session_started": "2025-01-15T10:30:00Z",
"testing_scope": "frontend",
"excluded_services": [
{"name": "payment-gateway", "reason": "Needs production certificates"}
],
"services": [
{
"name": "backend-api",
"dir": "/Users/user/Github/backend-api",
"command": "npm run dev",
"pid": 12345,
"port": 3001,
"log": "/tmp/muggle-prepare-backend-api.log"
}
]
}
testing_scope records what the user is testing (from scope). excluded_services records services the user said can't run locally (from viability-check).
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 before any other stage. The two files never merge.
On every invocation, check this file first. If it exists with live PIDs (verify with kill -0), AskUserQuestion:
Prune dead PIDs silently.
Gates run per preference-gates/README.md.
| Preference | Gates |
|---|---|
autoRebase | rebase-check — rebase onto origin/<default> before starting dev servers |
reusePreparePlan | reuse-plan — reuse the saved prepare plan for this stack, or rediscover |
autoSelectLocalHost | check-running — reuse the recorded dev-server URL silently, or confirm it each run |
Run the stages in this order. The sequence number is display-only — it lives only in this table for at-a-glance ordering; detail files and cross-references use slugs. Each row links to its detail file; read the file when you reach the stage.
| # | Stage | Summary |
|---|---|---|
| 0 | reuse-plan | Reuse saved prepare plan (gated); short-circuits to check-running on reuse |
| 1 | rebase-check | Rebase onto default branch (gated) |
| 2 | scope | Frontend / backend / full stack |
| 3 | viability-check | Exclude services that can't run locally |
| 4 | identify-services | Pick required services + startup mode |
| 5 | check-running | Detect what's already listening |
| 6 | env-file | Env file present + correct |
| 7 | start-commands | Determine per-service start command |
| 8 | fresh-install | Auto-install deps if missing/stale |
| 9 | start-services | Launch + two-stage readiness |
| 10 | smoke-test | HTTP + body sniff + log tail; clean-restart on fail |
| 11 | readiness-report | Final ready table |
Triggered when the user says "stop services", "tear down", "clean up", "I'm done testing", another skill signals run complete, or this skill is re-invoked with "tear down and start fresh".
/tmp/muggle-test-prepare.jsonexternal: truekill <pid> (SIGTERM)kill -0kill -9 <pid>rm -f /tmp/muggle-prepare-*.logrm -f /tmp/muggle-test-prepare.jsonReport:
Stopped 3 services:
backend-api (PID 12345)
auth-service (PID 12346)
frontend (PID 12347)
muggle-test-feature-local, muggle-do, and local-mode muggle-test MUST invoke this skill before any workflow step. Idempotent — fast exit when healthy. Treat success as short-lived; re-invoke if more than a few minutes pass before testing. Never bypass on "the user knows their stack is up" — that assumption is why this skill exists.
After a test run, the caller can re-invoke for cleanup or leave services running for the next run.
<repo>/.muggle-ai/last-host.json (the autoSelectLocalHost cache) before probing ports; a framework default like :3000 is never a fallback. See check-running.always is the only license to skip the question; absent that, ask.external: true survives cleanup.npx claudepluginhub multiplex-ai/muggle-ai-works --plugin muggleaiRuns real-browser end-to-end acceptance tests against localhost to verify UI flows, signups, checkout, form validation, and user-facing behavior. Captures screenshots.
Generates or upgrades a project's e2e-test skill to a three-tier BDD layer-gate shape. Handles scaffolding, migration from legacy, and cross-tool symlink placement.