agentleFS
fluttersdkfluttersdk/dusk/llms.txt

dusk

llms.txt3 starsChanged 15 days agoMITView on GitHub

Drive a running Flutter app from an LLM agent or a CI script: snapshot the Semantics tree, act on stable refs through an actionability gate, and read back what each action changed, as tapir_* MCP tools and tapir:* CLI commands on the dowel substrate. Stack: Dart >=3.13, Flutter >=3.47. A dowel plugin: TapirDowelProvider adds the tapir:* commands and tapir_* MCP tools, which call ext.tapir.* VM Service extensions inside the app. Install only outside release builds.

  • In this repository2 other files it gives its agents.

The file

We split this llms.txt into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check refused first on a tapir_perf_end report: a refused session carries no metrics because the engine drew nothing.

    line 55
  2. Very specific:

    After mcp:install, point the MCP client at the dowel key and reconnect: the tools ride on dowel's server, and clients do not reload an …

    line 60
  3. Very specific:

    Start every run with ./bin/dowel tapir:doctor, and run dowel start in each project or worktree you drive: without its own session, a call …

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 3,913 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
llms.txt
# tapir

> Drive a running Flutter app from an LLM agent or a CI script: snapshot the Semantics tree, act on stable refs through an actionability gate, and read back what each action changed, as `tapir_*` MCP tools and `tapir:*` CLI commands on the `dowel` substrate.

**Stack**: Dart >=3.13, Flutter >=3.47. A `dowel` plugin: `TapirDowelProvider` adds the `tapir:*` commands and `tapir_*` MCP tools, which call `ext.tapir.*` VM Service extensions inside the app. Install only outside release builds.

**Setup**:

```bash
flutter pub add tapir
dart run tapir tapir:install          # patches lib/main.dart, scaffolds ./bin/dowel, registers the plugin
dart run tapir mcp:install            # the `dowel` entry in .mcp.json
./bin/dowel start --device=chrome     # --cdp-port=9222 adds the web-only CDP verbs and gives up tapir_evaluate
./bin/dowel tapir:snap                # YAML tree with [ref=eN] tokens
```

```dart
import 'package:flutter/foundation.dart' show kReleaseMode;
import 'package:flutter/widgets.dart';
import 'package:tapir/tapir.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  if (!kReleaseMode) {
    TapirPlugin.install();
  }

  runApp(const Placeholder()); // your app
}
```

## API

- `TapirPlugin.install()`: registers the `ext.tapir.*` extensions, holds the semantics tree on, captures `debugPrint` output and non-fatal `FlutterError`s. Idempotent; call it before `runApp` (before `Magic.init` on a Magic app). `--dart-define=TAPIR_DISABLE=1` (or `true`, `yes`) skips it, and `TapirPlugin.isDisabled` reads that flag, so an integration can skip its own hooks too.
- `TapirPlugin.registerNavigateAdapter(TapirNavigateAdapter?)`: a `Future<bool> Function(String route)` that `tapir_navigate` tries before `Navigator.pushNamed` and a route-information broadcast.
- `TapirPlugin.enrichers` and `TapirSnapshotEnricher` (`String? Function(Element, RefRegistry)`): synchronous functions that add YAML lines under each snapshot ref; return `null` to skip an element.
- `recentLogsReader` and `recentExceptionsReader`: pointers a host assigns to feed `tapir_console` and `tapir_exceptions`; they take a `ConsoleRequest` (`limit`, `minLevel`, `grep`, `logger`) and an `ExceptionsRequest` (`limit`), both exported from `package:tapir/tapir.dart`. The barrel exports named symbols only.
- `TapirDowelProvider` (`package:tapir/cli.dart`): the provider dowel loads from `lib/app/_plugins.g.dart`.
- `MagicTapirIntegration.install()` (`package:magic_devtools/tapir.dart`): the Magic enrichers, after `Magic.init()`. Available only with a `magic_devtools` release built on tapir; otherwise `tapir:install` warns and skips it.
- MCP families: see (`tapir_snap`, `tapir_observe`, `tapir_screenshot`), find (`tapir_find`), pointer (`tapir_tap`, `tapir_double_click`, `tapir_right_click`, `tapir_triple_click`, `tapir_hover`, `tapir_drag`), text and keys (`tapir_fill`, `tapir_type`, `tapir_clear`, `tapir_press_key`, `tapir_focus`, `tapir_blur`), form controls (`tapir_set_checkbox`, `tapir_select_option`), `tapir_scroll`, waits (`tapir_wait_for`, `tapir_wait_for_network_idle`), navigation (`tapir_navigate`, `tapir_navigate_back`, `tapir_get_routes`, `tapir_dismiss_modals`, `tapir_reset_overlays`), diagnostics (`tapir_console`, `tapir_exceptions`), `tapir_evaluate`, `tapir_close_app`, perf (`tapir_perf_begin`, `tapir_perf_end`, `tapir_perf_insight`, `tapir_perf_run`, `tapir_perf_compare`, `tapir_perf_trace`), `tapir_run`, `tapir_hot_reload_and_snap`, `tapir_resize_viewport` and `tapir_device_profile`. `tapir_run`, `tapir_hot_reload_and_snap`, `tapir_resize_viewport`, `tapir_device_profile`, `tapir_perf_run`, `tapir_perf_compare` and `tapir_perf_trace` route through the `dowel:tapir:*` substrate, outside the app.
- CLI-only commands: `tapir:install`, `tapir:doctor`, `tapir:perf_campaign`. Every other command carries its tool's name with `tapir:` for `tapir_` (`tapir:wait_for`, `tapir:dismiss_modals`, `tapir:resize_viewport`, `tapir:device_profile`, `tapir:double_click`); `tapir_evaluate` has no command.

## Platforms

Any Flutter target that exposes a VM Service in a debug or profile build: Android, iOS, web, macOS, Windows and Linux. `tapir_resize_viewport`, `tapir_device_profile` and the CLI's CDP screenshot and hidden-tab recovery need Chrome started with `--cdp-port`. `tapir_hot_reload_and_snap` writes to the `flutter run` stdin FIFO dowel records, so it needs a POSIX host. On a Windows host `mcp:install` writes a `dart run` entry, never `./bin/dowel`. Release builds carry no tapir code.

## Rules for agents

- Snapshot first, then act on a ref from that snapshot. `e<N>` (from `tapir_snap`) names one node of one snapshot; `q<N>` (from `tapir_find` or `tapir_observe`) re-resolves on every action. Hold a `q<N>` across retries, navigation and hot reload.
- Branch on the gate's reason substring: `defunct` (`defunct (element no longer mounted)` or `defunct (element no longer attached to a render object)`, both frozen text), `not enabled`, `zero rect`, `off-viewport (rect=..., viewport=...)`, `not stable (rect changed by Xpx)`, `obscured by other widget (top=...)`. A retry of `not enabled` fails the same way.
- A success means dispatched. Read `effect` (`changed`, `verified`, `value`, `target.matchKind`) before concluding anything happened.
- While a response carries `warnings`, the app is not producing frames: an empty snapshot is not an empty screen. Follow its `hint` and retry. `framesForced: true` is normal.
- Narrow reads with `within`, `interactiveOnly` and `grep`; pass `snapshot: "diff"` to actions; batch known steps with `tapir_run`.
- Check `refused` first on a `tapir_perf_end` report: a refused session carries no metrics because the engine drew nothing. Bring the app to the front and repeat.
- `tapir_wait_for_network_idle` reports idle until an in-flight count is wired: it reads `pendingHttpCountReader`, which an app can replace with its own counter or set to `() => CrumbsStore.pendingHttpCount` (the `crumbs` package, published on pub.dev). The count is zero unless an adapter or a reader the app installs reports one (`MagicHttpFacadeAdapter` from `magic_devtools` is one; an interceptor that only calls `CrumbsStore.recordHttp` counts nothing), so without that it returns `matched: true` after `ceil(idleMs / pollIntervalMs)` consecutive zero samples (about `idleMs`; the first sample counts, and a request that starts and finishes between two samples is not seen). `timeoutMs` is checked only after a poll sample, so a window that completes at or after `timeoutMs` still matches, and a timeout needs `timeoutMs` to run out before the window completes (200 ms or less with the defaults): neither outcome proves anything, so wait on the UI instead. Read `tapir_exceptions` as a delta (`since`, `clear: true`).
- `tapir_set_checkbox` runs the gate on the control it taps: one below the fold is scrolled into view, and one that is disabled, covered or moving is refused with the gate's reason, so there is no need to scroll first (never reveal it with a `tapir_tap`, which would toggle it). Its `value` is the state read back after the tap, equal to `effect.after`, and `checks` appears when the gate could not confirm. `tapir_select_option` skips the gate: it calls the dropdown's `onChanged` directly, so nothing is tapped or scrolled.
- Tell a refusal from a failure by the error envelope: `refused` (code `-32001`) is a target or session state tapir will not act on (a ref that is not a text field, a container of several checkboxes, a perf call with no session), so pick another target rather than retry; `invalid_param` and `missing_param` (code `-32602`) are a bad or absent argument; the gate's own reasons and the rest keep `-32000`.
- `tapir_evaluate` runs one Dart expression in the app's root library (dowel's MCP server answers it; `dowel_tinker` evaluates the same way), a runtime exception, a compile error or a stale isolate comes back as an error, and an expression with `await` returns the `Future`, not its value.
- After `mcp:install`, point the MCP client at the `dowel` key and reconnect: the tools ride on dowel's server, and clients do not reload an entry on their own.
- Start every run with `./bin/dowel tapir:doctor`, and run `dowel start` in each project or worktree you drive: without its own session, a call falls back to whichever app dowel started last.

## Docs

- [Getting started](https://anilcancakir.com/tapir/docs/getting-started/index.md): what tapir is and the first snapshot, tap and screenshot
- [Installation](https://anilcancakir.com/tapir/docs/getting-started/installation.md): requirements, `tapir:install`, the `!kReleaseMode` guard, MCP wiring
- [Quickstart](https://anilcancakir.com/tapir/docs/getting-started/quickstart.md): drive the bundled `example/` app with a snapshot, a tap and a screenshot
- [Migrating from fluttersdk_dusk](https://anilcancakir.com/tapir/docs/getting-started/migrating-from-fluttersdk-dusk.md): swap the packages, clear what the old install left, and learn the renamed commands and tools
- [Driving real apps: gotchas for agents](https://anilcancakir.com/tapir/docs/getting-started/driving-real-apps-gotchas.md): the recurring traps of a long session and the workaround for each
- [Commands](https://anilcancakir.com/tapir/docs/commands/index.md): every command by intent, with its boot mode and extension
- [tapir:snap](https://anilcancakir.com/tapir/docs/commands/tapir-snap.md): the Semantics tree as YAML with `[ref=eN]` tokens
- [tapir:observe](https://anilcancakir.com/tapir/docs/commands/tapir-observe.md): every interactive widget as a candidate with a `q<N>` handle
- [tapir:find](https://anilcancakir.com/tapir/docs/commands/tapir-find.md): a re-resolvable `q<N>` handle from predicates
- [tapir:tap](https://anilcancakir.com/tapir/docs/commands/tapir-tap.md): a tap at a ref, with the effect report and retargeting
- [tapir:fill](https://anilcancakir.com/tapir/docs/commands/tapir-fill.md): focus, clear, type and settle a text field in one call
- [tapir:screenshot](https://anilcancakir.com/tapir/docs/commands/tapir-screenshot.md): the app or one widget to a file, with the CDP fallback on web and `--strict` to refuse a stale frame
- [tapir:reset_overlays](https://anilcancakir.com/tapir/docs/commands/tapir-reset-overlays.md): back to a clean screen in escalating layers
- [tapir:run](https://anilcancakir.com/tapir/docs/commands/tapir-run.md): several verbs in one call, one summary line per step
- [tapir:doctor](https://anilcancakir.com/tapir/docs/commands/tapir-doctor.md): runtime, wiring and session health in one pass
- [tapir:install](https://anilcancakir.com/tapir/docs/commands/tapir-install.md): the bootstrap that patches `lib/main.dart` and registers the plugin
- [tapir:perf_begin](https://anilcancakir.com/tapir/docs/commands/tapir-perf-begin.md): open a measurement session around one interaction
- [tapir:perf_end](https://anilcancakir.com/tapir/docs/commands/tapir-perf-end.md): close it and read frames, blocks, counters and insights
- [tapir:perf_insight](https://anilcancakir.com/tapir/docs/commands/tapir-perf-insight.md): drill into one insight of the last report
- [tapir:perf_run](https://anilcancakir.com/tapir/docs/commands/tapir-perf-run.md): repeat a scenario from a clean start and write a run file
- [tapir:perf_compare](https://anilcancakir.com/tapir/docs/commands/tapir-perf-compare.md): judge one run file against another on counts per painted frame
- [tapir:perf_trace](https://anilcancakir.com/tapir/docs/commands/tapir-perf-trace.md): the last closed session as a Chrome Trace file
- [tapir:perf_campaign](https://anilcancakir.com/tapir/docs/commands/tapir-perf-campaign.md): every scenario of a campaign on one platform, each from a cold start
- [MCP overview](https://anilcancakir.com/tapir/docs/mcp/overview.md): how the tapir tools join dowel's MCP server
- [MCP setup](https://anilcancakir.com/tapir/docs/mcp/setup.md): the `.mcp.json` entry per client and the reconnect
- [MCP tool reference](https://anilcancakir.com/tapir/docs/mcp/tool-reference.md): input schema, return shape and an example for every `tapir_*` tool
- [Magic integration](https://anilcancakir.com/tapir/docs/plugins/magic-integration.md): the Magic enrichers from `magic_devtools`
- [Wind integration](https://anilcancakir.com/tapir/docs/plugins/wind-integration.md): Wind state through the diagnostics bridge
- [Authoring a snapshot enricher](https://anilcancakir.com/tapir/docs/plugins/enricher-authoring.md): the typedef, the contract, registration and tests
- [Actionability gate](https://anilcancakir.com/tapir/docs/reference/actionability-gate.md): the checks before every gesture and their reason substrings
- [Frame production](https://anilcancakir.com/tapir/docs/reference/frame-production.md): when the app stops drawing, what tapir does, and the `warnings` block
- [Interactions and the perf trace](https://anilcancakir.com/tapir/docs/reference/perf-trace.md): how gestures become interactions in the Chrome Trace export
- [The semantics hold](https://anilcancakir.com/tapir/docs/reference/semantics-hold.md): releasing the semantics tree for a timed perf measurement

## Links

- [README](https://github.com/anilcancakir/tapir#readme): overview, feature tables and quick start
- [API reference](https://pub.dev/documentation/tapir/latest/): generated from the doc comments
- [Changelog](https://github.com/anilcancakir/tapir/blob/master/CHANGELOG.md): what changed in each version
- [Source](https://github.com/anilcancakir/tapir): issues and pull requests
- [Agent skill](https://github.com/anilcancakir/tapir/tree/master/skills/tapir): install with `npx skills add anilcancakir/tapir`

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.