/phase-runner:phase-wave-testfrom phase-runner
Per-wave UI and browser verification sub-agent for phase-builder. Runs dev server, executes assigned testing skills, and returns WAVE TEST RESULT before doc-sync.
Ships in phase-runner. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Per-wave UI and browser verification sub-agent. Read-only for phase plan files — you may fix app code only when the orchestrator explicitly sets fix_mode: true in the payload (rare; default is report-only and return FAIL so the implementation agent fixes).
The phase-builder orchestrator spawns you after CLI verify passes and before doc-sync on UI waves. You follow whatever skills the orchestrator assigns — do not assume a specific testing skill is installed; read each assigned skill file/name first, and if none are assigned, fall back to a basic manual-style check (see Step 4).
The orchestrator MUST:
skills_to_follow) — only ones actually available in this environment, per skill-router.mdtier on each test_urls entry: full only in the route's last wave in the phase, light in every earlier wave that touches it, regression on every entry (with retest_only) on retries. One wave can mix full and lightharness_doc, design_sections, e2e_specs (from the last passing VERIFY RESULT) and screenshot_dirWAVE TEST RESULT: before orchestrator runs doc-syncSTATUS: FAIL — orchestrator re-spawns implementation, re-runs verify, then re-spawns wave-test until PASS / WARN or retry limit (default 3, then escalate to user)
6b. On STATUS: WARN — never retry. Orchestrator keeps the issues and lists them at the phase checkpoint for the user to decide. Strict mode: WARN is treated as FAIL✓ Wave test — {sprint ids} ({summary}) — no browser automation or CLI run directly in the orchestrator threadThe orchestrator MUST NOT run browser automation, start dev servers, or read tool JSON descriptors during an active phase run.
Model: this role is mostly mechanical — drive a browser through a known checklist — and it's the most expensive gate by volume. If runtime-adapter.md resolved a gate_model, spawn with it. Otherwise use the session default.
{
"project_root": "/path/to/app-root",
"workspace_root": "/path/to/workspace-root",
"phase_file": "docs/phases/Phase-5-Example-Feature.md",
"wave_sprints": [
{ "id": "5.2", "title": "Utility Layer", "ui_routes": [] },
{ "id": "5.3", "title": "Feature UI", "ui_routes": ["/settings/profile"] }
],
"skills_to_follow": [
"{any browser/visual/responsive testing skill actually available in this environment, per skill-router.md}"
],
"test_urls": [
{ "url": "http://localhost:3000/settings/profile", "tier": "full" },
{ "url": "http://localhost:3000/settings", "tier": "light" }
],
"viewports": [375, 1280],
"acceptance_notes": "From sprint acceptance criteria — what to confirm in browser",
"design_system_doc": "{workspace_root}/docs/design/design-system.md, only if it exists",
"design_sections": ["Tabs", "Menus"],
"harness_doc": "{app_root}/docs/testing/wave-test-harness.md",
"retest_only": ["failures from the previous attempt — regression tier only"],
"e2e_specs": ["tests/e2e/settings.spec.ts"],
"screenshot_dir": "/path/to/workspace-root/docs/phases/.runs/screenshots/phase-5/wave-2/",
"run_log": { "path": "/path/to/workspace-root/docs/phases/.runs/phase-5.jsonl", "phase": 5, "wave": 2, "attempt": 1, "max": 3 },
"fix_mode": false
}
| Field | Purpose |
|---|---|
project_root | app_root — dev server, build tooling, browser tests |
workspace_root | Coordination folder |
skills_to_follow | Absolute SKILL.md paths (Read them) or exact names (load with the skill tool) — read each one before testing; may be empty if none installed. Never search the disk for one; if a path doesn't open or a name doesn't load, note it and carry on without it |
e2e_specs | Spec files in this wave's diff that verify already ran and saw pass. Read them (they're short) before testing; see "Don't repeat verify" |
screenshot_dir | Absolute folder for every screenshot you take. Create it if missing |
design_system_doc | {workspace_root}/docs/design/design-system.md only, and only when present |
test_urls | Routes to open, each with its tier (full, light or regression — see Test tiers). A plain string is full. Infer from sprint tasks if omitted |
viewports | Default [375, 1280] if omitted. A phase plan's viewports: line overrides it |
fix_mode | If true, fix trivial issues and re-test; default false → report FAIL |
design_sections | Headings of design_system_doc that cover this wave's UI. Read only these |
harness_doc | The project's test-setup notes: how to start the app, sign in as each role, which seed data to use, what not to touch. Read first |
retest_only | On a regression retry: the failed checks to re-run |
run_log | Optional. When present, append wave_test events (see Run log). Absent → write nothing |
Each test_urls entry carries its own tier, so one wave can test one route full and another light.
| Tier | When the orchestrator picks it | Shape | Budget |
|---|---|---|---|
| full | The route's last wave in the phase — the one full test each screen gets | Acceptance asserts the e2e specs don't cover, and design asserts. Screenshot each viewport in viewports (plus the other theme, if the design system has two). No checks at other widths | ~40 tool calls |
| regression | A retry after FAIL (every entry) | retest_only checks, plus a smoke load of each test_url. Narrowest and widest viewport only. Screenshot only what changed | ~20 tool calls |
| light | An earlier wave that touches a route a later wave in the phase touches again | Narrowest viewport, DOM/HTTP asserts, console and network errors. No design asserts. Screenshot only on failure | ~10 tool calls |
Mixed tiers: the heaviest tier's budget, plus the light budget for each light entry. The budget is a guide, not a hard stop. If you're about to pass it, finish the checks that matter most and say in NOTES what you left untested — don't keep going. Never re-test a check that passed in an earlier attempt unless this retry touched it.
Verify has already run the tests related to this wave's changes, including every spec in e2e_specs, and they passed. Anything those specs assert — an element renders, a route navigates, no horizontal scroll at 375px, a banner appears for a fixture — is covered. Don't re-check it in the browser. Your job is what a spec can't judge:
If e2e_specs is empty or missing, nothing is covered and the tier applies as written.
Every step you take re-reads everything you've read so far, so what you pull into context costs you on every later step.
^#) first, then read only the sections in design_sections, plus any other heading that's clearly about what you're testing. Read each section once. Never read the whole file.screenshot_dir by passing its absolute path as the filename (e.g. {screenshot_dir}/overview-375.png). If the tool reports saving somewhere else, open it from the path it reports and note that in the harness doc. Never search the disk for a screenshot. Only open one when a check needs your eyes on it.harness_doc if it exists. It's what makes a test cheap: how to start the app, how to sign in as each role, which seed data to use, what not to touch. If it doesn't exist, work those out, and then create it (see "Harness doc" below) so the next wave doesn't have to.e2e_specs files, so you know what's already covered.design_sections of design_system_doc, when present. Use them for the design asserts below. If the file is missing, skip this and note it in RESULT.test_url at its own tier, using the assigned skills. If none are assigned, do a basic manual-style check: navigate to each test_url, screenshot it, check the console for errors, check the network tab for failed requests, and resize to each viewport the tier allows, looking for obvious layout breakage.full entries, and only when design_system_doc provided) — spot-check visible UI against that project's own design-system.md. Do not invent generic design rules here; every check in this step must trace back to something the project's own design-system.md actually says (colors, type scale, touch target minimums, spacing, copy voice — whatever that file specifies). If design_system_doc is absent, skip this step entirely rather than falling back to generic taste.
Record drift in DESIGN_ISSUES → STATUS: WARN, never FAIL (see STATUS). Layout breakage is not drift: it's a FAILfix_mode: true — apply minimal fixes, re-run failed checks, set STATUS accordinglyharness_doc if you learned something the next test would otherwise have to rediscover — a new fixture recipe, a quirk, a changed sign-in step. Keep it short; replace stale lines rather than appending.
9b. Log the result — once STATUS is decided, if run_log is present, append one wave_test line per sprint in wave_sprints (see Run log)
9c. Clean up — stop any dev server you started. On PASS or WARN, delete screenshot_dir; on FAIL, keep it and name the relevant files in FAILURES so the retry can see themWAVE TEST RESULT: block (required){app_root}/docs/testing/wave-test-harness.md, committed with the project. A wave test that has one should spend its turns testing, not working out how to sign in. When you create one, cover only what you had to work out:
Put reusable helper scripts in the repo (e.g. scripts/qa/) rather than rewriting them in a scratch folder every time.
WT ) so it's easy to find and remove.NOTES. Don't run it yourself: another session may be using the same database.Only when the payload has run_log. The spec is phase-builder's run-log.md; this is the part you need. Append with this exact line, replacing only the {…} placeholders and keeping every other character, including the summary's tr pipe and "${RL_FILES:-}". {path}, {phase}, {wave}, {attempt} and {max} come from run_log. Never write the log with a file-edit tool.
mkdir -p "$(dirname '{path}')" && printf '{"v":1,"ts":"%s","phase":%d,"wave":%d,"sprint":"%s","gate":"%s","result":"%s","attempt":%d,"max":%d,"summary":"%s"%s}\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '{phase}' '{wave}' '{sprint}' '{gate}' '{result}' '{attempt}' '{max}' "$(printf '%s' '{summary}' | tr '\042\134\011\012\015' "'/ " | tr -d '\000-\037')" "${RL_FILES:-}" >> '{path}'
gate | One line per | result | summary |
|---|---|---|---|
wave_test | sprint in wave_sprints | fail / warn if STATUS is FAIL / WARN and the sprint is in AFFECTED_SPRINTS (or it's ALL); else pass | on fail / warn, the sprint's first failure or issue; else {n} URLs, {m} viewports |
'\''; type everything else as-is, including " and \. Never backslash-escape a character: inside single quotes \" stays two characters and lands in the log as /'.NOTES (run log: append failed — {reason}). It never changes STATUS.WAVE TEST RESULT:
STATUS: PASS | WARN | FAIL
URLS: [tested URLs]
VIEWPORTS: [375: PASS, 1280: PASS]
CONSOLE_ERRORS: [list or NONE]
ISSUES: [list or NONE]
DESIGN_ISSUES: [design-system.md violations or NONE — omit section if no design_system_doc was provided]
AFFECTED_SPRINTS: [sprint ids if known, or ALL]
FAILURES: [actionable list for implementation retry, or NONE]
NOTES: [pre-existing warnings, env quirks]
| STATUS | Meaning |
|---|---|
| PASS | All required checks passed |
| WARN | Design-system drift (spacing, colour, type, token mismatch), or pre-existing console noise. Never triggers a retry — orchestrator lists it at the phase checkpoint for the user to decide. Strict mode: orchestrator treats WARN as FAIL |
| FAIL | Broken flow, crash, console error, missing acceptance element, or layout breakage (horizontal overflow, overlap, clipped content) — orchestrator must retry implementation (phase-ui-implement for UI sprints) then re-run wave-test |
Drift goes in DESIGN_ISSUES, never FAILURES. A result with only drift and noise is WARN.
&& reliably (some Windows shells), run the dev server as its own background process instead of chainingdocs/phases/*.mdWAVE TEST RESULT:skills_to_followdesign_system_doc — no design_system_doc, no design assertse2e_specs spec already assertsfind /, globbing the home folder) — for skills, screenshots or anything elsescreenshot_dirWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ayejk/phase-runner --plugin phase-runner9 skills in this plugin
/design-plannerEstablishes visual design language and screen contracts between project scope docs and phase-planner. Produces docs/design/DESIGN.md (Google design.md spec), screen specs, HTML mockups (screens/*.html + index hub), and design-system.md for phase-builder. Use when the user wants to design UI before phase planning, lock a design system, write screen specs, review HTML mockups, or run the design pass after a scope/rebuild plan. Trigger phrases: design pass, design-planner, design the UI, design system, DESIGN.md, screen specs, visual direction, before phase planner./phase-builderOrchestrates automated sprint implementation from phase plans — e.g. 'run phase 1', 'implement sprint 1.3', 'run phase 4 in a worktree'. Optional worktree mode isolates a phase run on its own branch so two phases can run at once. Spawns phase-ui-implement (UI sprints + docs/design/design-system.md), general implementation (data/mixed), phase-verify, phase-wave-test (design asserts), phase-doc-sync. Skill-router per sprint. Clean orchestrator thread. Max 3 retries per gate then escalate. Pauses at blockers and phase boundaries./phase-doc-syncApplies sprint implementation results to docs/phases/ phase plan files. Used by phase-builder as a sub-agent after each implementation wave — updates task Status columns from structured SPRINT RESULT payloads in batched edits. Orchestrator must never edit phase files directly during a phase run; spawn this instead. Also use when the user asks to sync phase docs from sprint results without re-implementing code.Other plugins' skills for the same job