--- name: verify-worldmonitor description: Verify WorldMonitor dashboard behavior with existing browser tests or a scoped manual drive. Use for panels, map layers, settings, search, country briefs, boot, or dashboard screenshots. --- # Verify WorldMonitor WorldMonitor's primary surface is a browser dashboard: a Vite/TypeScript SPA served at `/dashboard`, with a map, a panel grid, a settings overlay, and a command palette. This skill launches one isolated instance of it, drives a feature the way a user does, and leaves evidence behind. This skill proves browser behavior. Use the [code and check map](../../../AGENTS.md#find-the-code-and-its-checks) for backend, desktop, worker, or documentation changes. Run everything from the repo root of the worktree under test. ## Choose the proof 1. Name the user action and expected result. Load the matching [feature recipe](features/README.md), including its data path and proof limits. 2. Follow [worktree preparation](../../../CONTRIBUTING.md#worktrees-and-preflight). Run an existing strict test first when it covers the outcome. Country Brief uses `npm run test:e2e:country-brief`. Playwright owns that test's server; do not also run `launch` for it. 3. For an interaction the test does not cover, use the manual steps below. Extend an existing test when a lasting regression check is needed. 4. Report the exercised path, controlled responses, evidence, and unmet criteria. Apply the [local API proof limits](../../../CONTRIBUTING.md#verify-the-changed-path). A successful drive proves only its assertions. ## Launch One long-lived dev server per run; every drive gets a fresh browser context against it. ```bash .agents/skills/verify-worldmonitor/scripts/wm-verify.sh launch ``` It picks the first free port in 4480-4487, starts `VITE_E2E=1 VITE_VARIANT=full npm run dev`, waits until `/tests/map-harness.html` answers 200 (the same readiness probe `playwright.config.ts` uses — it forces a real module transform, so 200 means "can serve the app", not just "socket open"), and writes `.claude/verify-evidence/instance.json` with the pid, port and base URL. - `VITE_E2E=1` is not optional. It is what stamps `data-wm-event-handlers-ready` and `data-wm-initial-data-ready` on ``; every drive waits on those markers. - Pick a variant with `WM_VERIFY_VARIANT=tech|finance|commodity|energy|happy`. - Force a port with `launch `. Launch refuses a port someone else holds rather than fighting for it. - Prepare dependencies through preflight before launch. If Chromium is missing, run `npx playwright install chromium`. **Isolation.** Two instances can run side by side on different ports, but they share `.claude/verify-evidence/instance.json`, so this skill supports **one instance per worktree**. If `launch` reports an instance already running, either reuse it (`doctor` first) or `cleanup`. Never adopt a dev server this run did not start — the user's own `npm run dev` and other worktrees are also vite processes. ## Doctor ```bash .agents/skills/verify-worldmonitor/scripts/wm-verify.sh doctor ``` Read-only. Answers "is this instance worth driving?": the recorded pid is alive, the port is held by **our** process tree (walking parents, so vite-under-npm counts), `/dashboard` returns 200 with the app shell, the process is still vite/npm, and the launch recorded `VITE_E2E=1`. It also prints the dev-server log's error-line count and path. Run it before the first drive, after any drive that failed, and any time behavior looks wrong. Exit code 0 = OK. If doctor cannot see the problem — a wedged page on a healthy server — relaunch rather than hoping: `cleanup` then `launch`. ## Drive ```bash .agents/skills/verify-worldmonitor/scripts/wm-verify.sh drive --name