Examples are Flutter projects offered as templates on the prompt page. They live as real files in the repository under examples/ and are served to the frontend as ZIP files.
examples/
├── examples.yaml # Source of truth for all examples
├── simple_counter/ # Directory name = id from the manifest
│ ├── pubspec.yaml
│ └── lib/
│ ├── main.dart
│ └── counter.dart
├── overflow_debug/
│ ├── pubspec.yaml
│ └── lib/
│ └── main.dart
└── rebuild_weather_app/
├── pubspec.yaml # Minimal pubspec (no code)
└── weather_app_screenshot.png # Image attached to the prompt
The source of truth for all examples is examples/examples.yaml. Each entry defines:
| Field | Required | Description |
|---|---|---|
id | ✅ | Must match the directory name under examples/ |
title | ✅ | Display name shown on the prompt page |
prompt | ❌ | Optional agent prompt pre-filled in the composer |
image | ❌ | Optional image file (relative to the example dir) attached to the prompt |
examples: - id: simple_counter title: Counter Template - id: overflow_debug title: Overflow Debug prompt: >- My profile screen doesn't look right — some content seems to be cut off or missing. Can you take a screenshot and help me figure out what's wrong? - id: rebuild_weather_app title: Rebuild Weather App prompt: >- Rebuild this weather app and verify your result with screenshots. Generate background images for the different weather conditions. image: weather_app_screenshot.png
| Has prompt? | Has image? | Behavior |
|---|---|---|
| ❌ | ❌ | Opens editor with lib/main.dart. No agent panel. |
| ✅ | ❌ | Opens editor + agent panel. Prompt is pre-filled in the composer. |
| ✅ | ✅ | Opens editor + agent panel. Prompt + image thumbnail pre-filled. |
In all cases, the user reviews the prompt and hits Send manually — the agent does not start automatically.
The script tool/bundle_examples.dart reads examples.yaml and:
examples.json in packages/frontend/web/examples/ (with id, title, optional prompt, and optional base64-embedded image data).dart run tool/bundle_examples.dart
The generated files under web/examples/ are checked in.
Note: The
yamlpackage is required as a dev dependency (already inpubspec.yaml).
On startup the frontend fetches examples/examples.json and displays the templates on the prompt page. When a template is selected:
examples/<id>.zip) is fetched and extracted into the workspace.prompt (and/or image), the agent panel opens with the prompt pre-filled in the composer.lib/main.dart.examples/<id>/ with a pubspec.yaml and lib/main.dartexamples/examples.yaml:- id: my_example title: My Example
dart run tool/bundle_examples.dartexamples/<id>/ with at least a pubspec.yamllib/ and/or an image fileexamples/examples.yaml:- id: my_example title: My Example prompt: >- Describe what the agent should do... image: screenshot.png # optional
dart run tool/bundle_examples.dartFor examples where the agent should build everything from a prompt (no starter code):
examples/<id>/ with only a minimal pubspec.yaml:name: my_example environment: sdk: ">=3.6.0"
prompt (and optionally image) to examples.yamldart run tool/bundle_examples.dartA minimal Flutter counter app. Demonstrates basic StatefulWidget usage with setState.
A Flutter profile screen with intentional overflow and layout issues. The pre-filled prompt asks the agent to take screenshots, diagnose the problems, and fix them iteratively.
An empty project with a screenshot of a weather app UI. The agent is asked to rebuild the app from the screenshot and generate background images for different weather conditions.