/flow-next:flow-next-drivefrom flow-next
Drives web apps, Electron/WebView2 desktop apps, and native macOS surfaces using the best available driver (CDP, Cua, Computer Use). Detects the surface, picks the highest rung, and degrades gracefully for headless/CI environments.
Ships in flow-next. 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.
Read when SKILL.md points to them.
Drive any UI surface the way a real user would. Whatever driver the environment has, the work is the same shape: observe / navigate → snapshot → act on fresh refs → capture evidence → release. This skill is a router: it detects the surface, picks the highest available driver on a ladder, degrades gracefully when a richer driver is absent, and hands off to a per-rung reference for the command detail.
It orchestrates drivers — it does not reimplement them. The default rung (Vercel's agent-browser CLI) is the only driver assumed present; every other rung is detected and optional. A pass must succeed with whatever the environment actually has — most cloud VMs, Linux, and CI have no Computer Use, so it is never a hard dependency and never on a headless/no-display path.
Driver ladder + universal-flow structure adapted from Ray Fernando's
running-bug-review-boardskill (Apache-2.0).
Classify the target into one of three buckets and take the matching path. The universal flow (Step 2) is shared; only the actuation and the per-surface reference differ.
| # | Surface | What it is | Path |
|---|---|---|---|
| A | Web app | A URL in a browser (localhost dev server, staging, production) | Web ladder (Step 3) |
| B | Chromium-backed desktop app | Electron / Windows WebView2 — Chromium under the hood, exposes a CDP debug port | Web ladder (Step 3), attaching over CDP to the app's remote-debugging port |
| C | True-native / non-CDP surface | macOS AppKit/SwiftUI, Catalyst, or a webview exposing no CDP (macOS WKWebView, which Tauri uses on macOS) | Native rung (Step 4) — Cua Driver → Computer Use (attended); Cua Sandbox (headless/CI) |
How to decide:
--remote-debugging-port=<n> (or one already exposing one) → B. Electron and Windows WebView2 are Chromium; the web ladder drives them by CDP-attach. Do not route these to Computer Use.When unsure whether a desktop app exposes CDP, probe for B first (try to launch/attach with a debug port). If no port is reachable, fall to C.
When .flow/features/ exists and the caller did not pass unmapped, Read .flow/features/README.md and the feature file the caller names, else the one matching feature file, first; never the whole map. They pre-resolve the route, preconditions, and gotchas. Select by **Surface:** plus sub-feature IDs (feature-entry-contract.md, "Live-app stages"). Live detection above remains the fallback when the map is absent or does not cover this target. A mapped route that no longer matches the live app gets a drift note per the contract's "Writers and drift notes" section, then live detection continues; never edit the map mid-run.
.flow/features/ existed, the index and the named or one matching feature file were read before driving (none after a caller's unmapped); live detection was the fallback otherwise, and a stale mapped route was filed as a drift note.observe / list what's open
navigate to the target (URL, or focus the app window)
snapshot → fresh element refs (after a DOM change; for ONE known target prefer semantic find)
act → click / fill / type / press / scroll toward the next step
verify → expected text/state appeared AND console clean + no failed API/network requests
capture → screenshot + console/errors at the moment of interest (and on failure)
release → close the tab / end the session when fully done
verify is not DOM-only — every verify checks the console is clean and no API/network request failed, alongside the expected text or state. A pass declared on a green-looking DOM while a request returned 500 or the console threw an uncaught exception has broken this: that is exactly the silent breakage a real user hits, and the /flow-next:qa qa_verdict rests on this evidence. The tooling is already on the default rung (agent-browser console, agent-browser network requests --filter api; the DevTools-MCP rung has richer inspection). A failed request or console error under a green DOM is a finding, not noise.
Snapshot cost: a full interactive snapshot -i before every act is the dominant token cost of a long flow. Re-snapshot after a DOM change, but for a single known target prefer a semantic locator (find role|text|label … <action> — no snapshot needed), and use snapshot -c / -d <depth> when you only need to verify one region.
Refs (@e1, @e2, …) go stale after any navigation, click, or form submit. Element refs are refreshed by re-snapshotting after any navigation, click, or submit. A "ref not found" or pointer-events: none result reported as a bug before a re-snapshot has broken this — it is a stale snapshot until a fresh one says otherwise.
/flow-next:qa verdict rests on artifacts rather than narration.Probe availability top-down and use the highest rung that passes; fail soft to the next; the terminal rung is manual. Never hard-depend on any rung above the default.
| Rung | Driver | Use when | Reference |
|---|---|---|---|
| 1 (default) | agent-browser CLI | Always assumed present. CDP-based, headless-safe, no extra install. Drives web apps; drives Electron / WebView2 over CDP (--cdp <port> / --auto-connect). | references/agent-browser.md |
| 2 | chrome-devtools-mcp | You want built-in auto-wait (fewer stale-ref failures), DevTools-grade network/console inspection, Lighthouse, or to attach to your real signed-in Chrome (--browser-url / --autoConnect) so bot defenses don't challenge an automated profile. | references/chrome-devtools-mcp.md |
| 3 | Playwright (CLI or MCP) | The repo already has Playwright configured, or you need a headless CI-style run / large cross-browser regression suite. | references/playwright.md |
| 4 | cursor-ide-browser MCP | On a Cursor host: no install, no command -v. Probe the server by id cursor-ide-browser (a catalog omission is not absence). If that probe fails in an attended session, ask once for @Browser (no space) or the Browser pane showing connected, then re-probe once — skip the ask when unattended. Real snapshot YAML + browser_cdp. Cannot satisfy verify (console + network) unaided — a /flow-next:qa pass here must set QA_OUTCOME=BLOCKED with blocked_reason naming the missing channels (do not invent console_path / network path values). When higher rungs are missing, prefer this over instructing an install. | references/cursor-ide-browser.md |
| 5 (terminal) | Manual + screenshot relay | No browser driver available — drive yourself, paste console errors and screenshots into chat (attended only; unattended reports no driver and QA records BLOCKED). | — |
Surface B note: an Electron / WebView2 app is driven through this same web ladder, over its CDP debug port. Routing a Chromium-backed desktop app to the native rung has broken this. Attach to the app's remote-debugging port (agent-browser --cdp <port> / --auto-connect; chrome-devtools-mcp --browser-url=http://127.0.0.1:<port>). Launch the app with a dedicated debug port and a dedicated user-data-dir; treat the open debug port as a security exposure (any local app can drive that session).
agent-browser command detail lives in
references/agent-browser.md, which indexes the per-topic references.
Only for surface C (a genuinely native app or a non-CDP webview): read references/cua.md § Native rung (surface C) first; it holds the driver probe order and routes to Computer Use.
command -v, MCP list, uname -s for the macOS-only paths). Treat anything above the default rung — incl. Cua Driver and Computer Use — as probably absent. On a Cursor host, probe cursor-ide-browser by exact server id at least once before concluding it is absent — catalog omission alone is not a negative, and there is no install step. If that probe fails in an attended session, ask once via AskUserQuestion: type @Browser in chat (no space), or open the Browser pane until it shows connected, and confirm Settings → Tools & MCP → Browser Automation is Browser Tab. On portable hosts without that tool, use a numbered prompt with a final Other — type your own answer option. After they confirm, re-probe once. Skip the ask when unattended / autonomous / $CI / FLOW_AUTONOMOUS=1 and degrade. A mid-run MCP server does not exist after this pass already drove the pane is the lease-drop flake, not a first-use miss — do not ask @Browser for that; see references/cursor-ide-browser.md.references/cua.md.)$CI ⇒ headless, else the empirical cua-driver call get_screen_size display probe; NOT $DISPLAY on macOS. See references/cua.md § "Determining headless / CI".)
references/cua.md.references/cua.md).agent-browser that the plan relies on was probed first (command -v, MCP list, uname -s; for cursor-ide-browser, an id-probe — and on an attended Cursor miss, one @Browser ask plus one re-probe). A pass that planned around an unprobed rung has broken this./flow-next:qa concern.references/advanced.md (opens in a new tab)references/agent-browser.md (opens in a new tab)references/auth.md (opens in a new tab)references/chrome-devtools-mcp.md (opens in a new tab)references/commands.md (opens in a new tab)references/computer-use.md (opens in a new tab)references/cua.md (opens in a new tab)references/cursor-ide-browser.md (opens in a new tab)references/debugging.md (opens in a new tab)references/playwright.md (opens in a new tab)references/proxy.md (opens in a new tab)references/session-management.md (opens in a new tab)references/snapshot-refs.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gmickel/flow-next --plugin flow-next29 skills in this plugin
/flow-nextManage .flow/ tasks and specs. Triggers: 'show me my tasks', 'list specs', 'what tasks are there', 'add a task', 'create task', 'what's ready', 'task status', 'show fn-1-add-oauth'. NOT for /flow-next:plan or /flow-next:work./flow-next-auditAudit `.flow/memory/` entries against the current codebase and decide Keep / Update / Consolidate / Replace / Delete / Harden per entry. Triggers on /flow-next:audit, "audit memory", "review memory", "refresh learnings", "sweep stale memory", "consolidate overlapping memory entries", "graduate a recurring lesson into a gate". Optional `mode:autofix` token in arguments runs without questions and marks ambiguous as stale (Harden is never auto-applied). Optional scope hint after the mode token (concept, category, module, or path) narrows what gets audited./flow-Other plugins' skills for the same job