agentleFS
fluttersdkfluttersdk/dusk/llms.txt

dusk

llms.txt3 starsChanged 2 months agoMITView on GitHub

E2E driver for Flutter apps targeting LLM agents and CI. 41 CLI commands and 39 MCP tools drive a running Flutter app over 38 ext.dusk.* VM Service extensions, 33 of which are reached directly by an MCP tool, plus 6 artisan:dusk:* substrate-routed tools. Every gesture passes a 6-step actionability gate (defunct, enabled, zero-rect, off-viewport, stable, receives-events) with substring-parseable failure reasons. Snapshots emit YAML trees with stable [ref=eN] tokens; dusk:find mints re-resolvable q<N> predicate handles (Playwright Locator pattern). The consumer gates…

The file

Files
llms.txt
# fluttersdk_dusk

> E2E driver for Flutter apps targeting LLM agents and CI. 41 CLI commands and 39 MCP tools drive a running Flutter app over 38 `ext.dusk.*` VM Service extensions, 33 of which are reached directly by an MCP tool, plus 6 `artisan:dusk:*` substrate-routed tools. Every gesture passes a 6-step actionability gate (defunct, enabled, zero-rect, off-viewport, stable, receives-events) with substring-parseable failure reasons. Snapshots emit YAML trees with stable `[ref=eN]` tokens; `dusk:find` mints re-resolvable `q<N>` predicate handles (Playwright Locator pattern). The consumer gates with `!kReleaseMode` (debug and profile); release builds tree-shake the entire subsystem.

**MCP tools (39)**, see `doc/mcp/tool-reference.md` for full input schemas. The 33 `ext.dusk.*` and 6 `artisan:dusk:*` (substrate-routed) tools are listed below.

*Snapshot / Screenshot*
- `dusk_snap` (`ext.dusk.snap`): Capture Semantics tree YAML with stable `[ref=eN]` tokens. Narrow instead of reading everything: `within: "e12"` walks one subtree, `interactiveOnly: true` drops the prose, `grep: "<regex>"` keeps only matches plus the ancestors carrying their refs. A full tree costs context, and on a shell whose sidebar repeats page labels the unscoped read is also the misleading one. Nodes inside a currently-overflowing ancestor carry an `overflow: true` sub-line. Nested `textbox` nodes collapse by render-object containment to a single ref tagged `typeable: true` (the node `dusk_type` resolves); sibling fields sharing a label stay distinct. When non-fatal render/build FlutterErrors are in the capture buffer, the response includes a `renderErrors: {count, recent: [{type, message}], hint}` block so a silently-broken screen is visible without a separate `dusk_exceptions` call. A `warnings: {framesEnabled, lifecycleState, hint}` block appears on EVERY tool's payload while the app is not producing frames, which is when a rendering screen reads as empty.
- `dusk_screenshot` (`ext.dusk.screenshot`, in-isolate): Capture base64-encoded JPEG/PNG frame. Optional `ref` captures ONLY that widget (an `e<N>`/`q<N>` token), optional `rect: "x,y,w,h"` narrows further within it; reach for `ref` whenever the question is about one component, since a full-screen capture of a tall page costs far more tokens and buries it. Can hang on web under CanvasKit+DWDS; for reliable web screenshots use the CLI `dusk:screenshot --output=<path>`, which falls back to CDP `Page.captureScreenshot` when artisan was started with `--cdp-port` (CLI-only, not this MCP tool).

*Gestures (pointer actions)*
- `dusk_tap` (`ext.dusk.tap`): Tap a widget (Down + 50ms hold + Up at the LIVE ref center, re-resolved post-gate). Every response carries an `effect: {kind: "treeChanged", changed: bool}` block; `changed: false` means the target's own route and semantics subtree are unchanged, so nothing the agent can see happened. Opt-in `until:"<text>"` polls (up to `untilTimeoutMs`, default 3000) for that text post-tap and adds an `untilMatched` boolean.
- `dusk_hover` (`ext.dusk.hover`): Hover mouse cursor over a widget (PointerHoverEvent).
- `dusk_drag` (`ext.dusk.drag`): Drag from one widget to another (Down + 5x Move + Up).
- `dusk_dblclick` (`ext.dusk.dblclick`): Double-click a widget (two tap sequences ~100ms apart).
- `dusk_right_click` (`ext.dusk.right_click`): Fire secondary (right) mouse button click.
- `dusk_triple_click` (`ext.dusk.triple_click`): Fire three primary clicks (~100ms apart each).

*Text Input*
- `dusk_type` (`ext.dusk.type`): Type text into a TextField (calls userUpdateTextEditingValue).
- `dusk_clear` (`ext.dusk.clear`): Clear TextEditingController backing a text field.
- `dusk_fill` (`ext.dusk.fill`): Focus + clear + type + settle a text field in one call; composes the gated focus/clear/type handlers and retries once on a stale handle. Replaces the manual fill dance.

*Scrolling*
- `dusk_scroll` (`ext.dusk.scroll`): Scroll a Scrollable widget by direction + pixels.

*Waits / Polling*
- `dusk_wait_for` (`ext.dusk.wait_for`): Wait until text/textGone/expression condition met or timeout.
- `dusk_wait_for_network_idle` (`ext.dusk.wait_for_network_idle`): Wait until in-flight HTTP count reaches 0 + idle window.

*Navigation*
- `dusk_navigate` (`ext.dusk.navigate`): Push a named route onto the active router.
- `dusk_navigate_back` (`ext.dusk.navigate_back`): Pop the top route off navigator stack.
- `dusk_get_routes` (`ext.dusk.get_routes`): Report where the app is: the mounted Router's `uri` (null before one mounts), the top page name `location`, and a `title` hint; it does not list declared routes.
- `dusk_dismiss_modals` (`ext.dusk.dismiss_modals`): Pop every PopupRoute (dialog, bottom sheet, popup menu) across all NavigatorState instances; returns additive `popped` count.
- `dusk_reset_overlays` (`ext.dusk.reset_overlays`): Return to a clean screen via 3 idempotent layers: dismiss all PopupRoutes, press Escape, then tap a Cancel/Dismiss/Close/OK/Done affordance. Returns `{popped, escaped, dismissTapped}`.

*Find (Query Handles)*
- `dusk_find` (`ext.dusk.find`): Find widget by text/semanticsLabel/key, return re-resolvable `q<N>` handle. Optional `within: "e12"` evaluates the predicates inside one subtree and becomes part of the handle, so the scope survives every re-resolve (Playwright scoped-locator semantics, including the part where the handle stops matching once its scope is gone).

*Diagnostics*
- `dusk_console` (`ext.dusk.console`): Read recent log entries. Returns merged union of in-package `debugPrint` capture buffer (captures `debugPrint()`, `print()`, and any Flutter framework path through the `debugPrint` callback; does NOT capture direct `developer.log()` calls) and telescope reader when wired; deduped, newest-first. Works without telescope.
- `dusk_exceptions` (`ext.dusk.exceptions`): Read recent exception entries. Returns merged union of in-package non-fatal `FlutterError` capture buffer (incl. overflow tagged `type: "overflow"`) and telescope reader; deduped, newest-first. Optional `since` ISO8601 param filters to entries strictly after that timestamp, and `clear: true` empties the in-package buffer AFTER the read. The buffer is cumulative, so one boot-time fault otherwise rides along on every later read and a per-route sweep reports it against every route.
- `dusk_observe` (`ext.dusk.observe`): Return structured candidate list of every interactive widget on screen.

*Performance*
- `dusk_perf_begin` (`ext.dusk.perf_begin`): Open a measurement session around an interaction you are about to drive. Switches `FlutterTimeline` collection plus `debugProfileBuildsEnabled` on (and, with `phases: true`, layout and paint), zeroes wind's counters and telescope's frame buffer, and records the liveness baseline. Returns `{sessionToken, phases, livenessBaseline, restartedPreviousSession}`; a begin on an open session restarts it rather than failing.
- `dusk_perf_end` (`ext.dusk.perf_end`): Close the session and read the attribution: `frameSummary` under `flutter_driver`'s own metric names plus a gap-derived `dropped_frame_count`, a session-wide `blockAttribution` ranking `{name, micros, count, frames}`, wind's cache hit/miss/bypass counters and magic's controller notifies. Restores every profiling flag to its PRIOR value. Check `refused` first: a session the engine did not render through returns `refused: true` with a reason and NO metrics, because a table of zeros reads as "fast"; the liveness counter is the authority there, not `SchedulerBinding.framesEnabled`, which was measured reporting `true` on a hidden page. Per-type durations are indicative, not representative.
- `dusk_perf_insight` (`ext.dusk.perf_insight`): Drill into one ranked insight from the last `dusk_perf_end` report by id (e.g. `I1`): title, summary, the rows behind it, estimated savings and the next step.
- `dusk_perf_run` (`artisan:dusk:perf_run`, substrate-routed): Run a perf scenario N times from a clean start (hot restart or relaunch between repeats) and write medians, spread, insights and every repeat to `<out>/<scenario>-<label>.json`.
- `dusk_perf_compare` (`artisan:dusk:perf_compare`, substrate-routed): Compare two `dusk_perf_run` files on counts per painted frame (and timing-mode ms) and print a verdict table. Raw counts are never compared directly since a run that drew fewer frames reads as a false improvement.
- `dusk_perf_trace` (`artisan:dusk:perf_trace`, substrate-routed): Write the last closed perf session's interactions, frames and host rows as Chrome Trace Event JSON (opens in ui.perfetto.dev or chrome://tracing) and return only its path.

*Keyboard / Input*
- `dusk_press_key` (`ext.dusk.press_key`): Press hardware key with optional modifiers (control, shift, alt, meta).
- `dusk_focus` (`ext.dusk.focus`): Request keyboard focus on widget identified by ref.
- `dusk_blur` (`ext.dusk.blur`): Clear keyboard focus from current focus holder.

*Form Controls*
- `dusk_select_option` (`ext.dusk.select_option`): Select option in DropdownButton by ref + value.
- `dusk_set_checkbox` (`ext.dusk.set_checkbox`): Set checked state of Checkbox or Switch widget.

*Evaluate (MCP-only; no CLI mirror)*
- `dusk_evaluate` (`ext.dusk.evaluate`): Evaluate Dart expression in running app isolate via Tinker bridge.

*App Control*
- `dusk_close_app` (`ext.dusk.close_app`): Request graceful shutdown via `SystemNavigator.pop()`.

*Hot Reload (substrate-routed)*
- `dusk_hot_reload_and_snap` (`artisan:dusk:hot_reload_and_snap`): Hot reload app, capture snapshot + screenshot + recent exceptions in one round-trip.

*Viewport / Device Emulation (substrate-routed, CDP)*
- `dusk_resize_viewport` (`artisan:dusk:resize`): Resize Flutter web viewport via Chrome DevTools Protocol; the override lasts only as long as the call's CDP session (the CLI's `dusk:resize --hold` keeps it).
- `dusk_device_profile` (`artisan:dusk:device`): Emulate named device preset via CDP; the emulation lasts only as long as the call's CDP session, only the window size stays.

## Docs
- [Installation](https://fluttersdk.com/dusk/getting-started/installation.md)
- [Quickstart](https://fluttersdk.com/dusk/getting-started/quickstart.md)
- [Commands index](https://fluttersdk.com/dusk/commands/index.md)
- [Driving real apps: gotchas for agents](https://fluttersdk.com/dusk/getting-started/driving-real-apps-gotchas.md)
- [dusk:snap](https://fluttersdk.com/dusk/commands/dusk-snap.md)
- [dusk:tap](https://fluttersdk.com/dusk/commands/dusk-tap.md)
- [dusk:fill](https://fluttersdk.com/dusk/commands/dusk-fill.md)
- [dusk:reset_overlays](https://fluttersdk.com/dusk/commands/dusk-reset-overlays.md)
- [dusk:find](https://fluttersdk.com/dusk/commands/dusk-find.md)
- [dusk:observe](https://fluttersdk.com/dusk/commands/dusk-observe.md)
- [dusk:screenshot](https://fluttersdk.com/dusk/commands/dusk-screenshot.md)
- [dusk:perf_begin](https://fluttersdk.com/dusk/commands/dusk-perf-begin.md)
- [dusk:perf_end](https://fluttersdk.com/dusk/commands/dusk-perf-end.md)
- [dusk:perf_insight](https://fluttersdk.com/dusk/commands/dusk-perf-insight.md)
- [dusk:perf_run](https://fluttersdk.com/dusk/commands/dusk-perf-run.md)
- [dusk:perf_campaign](https://fluttersdk.com/dusk/commands/dusk-perf-campaign.md): every scenario of a campaign YAML on one platform, each from a cold start, with hooks, Android preparation, retries and a pass/fail summary. CLI only.
- [dusk:perf_compare](https://fluttersdk.com/dusk/commands/dusk-perf-compare.md)
- [dusk:perf_trace](https://fluttersdk.com/dusk/commands/dusk-perf-trace.md)
- [dusk:doctor](https://fluttersdk.com/dusk/commands/dusk-doctor.md)
- [dusk:install](https://fluttersdk.com/dusk/commands/dusk-install.md)
- [Actionability gate](https://fluttersdk.com/dusk/reference/actionability-gate.md)
- [Frame production](https://fluttersdk.com/dusk/reference/frame-production.md): why a backgrounded tab makes a snapshot read empty and an action report a success it could not have landed, and the `warnings` block that says so.

## MCP
- [MCP overview](https://fluttersdk.com/dusk/mcp/overview.md)
- [MCP setup (.mcp.json wiring)](https://fluttersdk.com/dusk/mcp/setup.md): when fastcli is absent, `mcp:install` auto-selects `dart run fluttersdk_dusk mcp:serve` as the plugin-aware fallback (no manual edit needed).
- [MCP tool reference (39 tools)](https://fluttersdk.com/dusk/mcp/tool-reference.md)

## Plugins
- [Magic integration](https://fluttersdk.com/dusk/plugins/magic-integration.md)
- [Wind integration](https://fluttersdk.com/dusk/plugins/wind-integration.md)
- [Authoring a snapshot enricher](https://fluttersdk.com/dusk/plugins/enricher-authoring.md)

## AI & Tooling
- [fluttersdk/ai](https://github.com/fluttersdk/ai): canonical distribution channel. One-command install via `npx skills add fluttersdk/ai --skill fluttersdk-dusk` covers Claude Code, Cursor, OpenCode, Gemini CLI, VS Code Copilot, Codex CLI, Cline, Roo Code.
- [Dusk skill source](https://github.com/fluttersdk/dusk/tree/master/skills/fluttersdk-dusk): canonical `SKILL.md` + references (`mcp-tools.md`, `cli-commands.md`, `actionability-and-refs.md`, `workflows.md`, `community.md`); `fluttersdk/ai` mirrors this directory.
- [Hosted docs MCP server](https://mcp.fluttersdk.com): Streamable HTTP, single `search-docs` tool over the dusk docs corpus, no auth required.
- [Stdio MCP bridge](https://www.npmjs.com/package/@fluttersdk/mcp): `npx @fluttersdk/mcp` for clients without HTTP MCP transport.

## Source
- [GitHub](https://github.com/fluttersdk/dusk)
- [pub.dev](https://pub.dev/packages/fluttersdk_dusk)
- [CHANGELOG](https://github.com/fluttersdk/dusk/blob/master/CHANGELOG.md)
- [ARCHITECTURE](https://github.com/fluttersdk/dusk/blob/master/ARCHITECTURE.md)

## Optional
- [README](https://github.com/fluttersdk/dusk/blob/master/README.md)
- [LICENSE](https://github.com/fluttersdk/dusk/blob/master/LICENSE)
- [Issues](https://github.com/fluttersdk/dusk/issues)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.