Create a timestamped output directory under `capture_output_dir`:
```
task_dir = capture_output_dir / "task_{timestamp}"
android_capture_dir = task_dir / "android_page_{i}_{name}"
hmos_capture_dir = task_dir / "hmos_page_{i}_{name}"
```
Each paired hmos-android page-pair should have the same `i`

## Navigation prompt rules

Each page's `android_nav_path` / `hmos_nav_path` is used as the `--prompt` for `app_feature_verify.ts`.
The `--prompt` mode auto-prepends "打开{app_name}，" so do not include "打开{app_name}" in the prompt.

## Navigate to Android page and Capture (If navigated Success)
```bash
node ./app_feature_verify.ts \
  --device adb \
  --app "{android.app_name}" \
  --package "{android.package}" \
  --prompt "{pages[i].android_nav_path}" \
  --max-steps 15
```

**Capture Android page** (if navigation succeeded — TypeScript version, run with Node ≥ 22.18 / 23.6, no build step / no dependencies)
```bash
node ./page_capture.ts --device adb -o "{android_capture_dir}"
```

## Navigate & Capture HarmonyOS Pages

Same as Andorid but with `--device hdc` and HarmonyOS config values. Directory pattern:
```
hmos_capture_dir = task_dir / "hmos_page_{i}_{name}"
```
For pages missed in harmony OS app, navigation will certainly fail — `hmos_capture_dir` will be empty, which is expected. Skip navigation for these pages and leave the directory empty.

## Burst Capture for Multi-State Components (Step 1.5)

Use `page_capture_burst.ts` to continuously capture view tree + screenshot pairs at 1-second intervals. This is designed for dynamic/stateful UI where a single snapshot is insufficient.

### Usage
```bash
node ./scripts/page_capture_burst.ts --device adb -o "{output_dir}" --duration {seconds}
```
- `--device`: `adb` for Android (currently the only supported device)
- `-o`: output directory (each frame produces `view_NNN.xml` + `screenshot_NNN.png`)
- `--duration`: capture duration in seconds (default 10, recommended 5 for most states)
- `--serial`: device serial if multiple devices connected

### Workflow: Auto-Capturable States
For states that can be triggered by simple gestures (tap, short long-press then release):
1. Navigate to the base page using `app_feature_verify.ts`
2. Start burst capture in background: `page_capture_burst.ts --duration 5`
3. Immediately trigger the state change via `app_feature_verify.ts` with the action prompt
4. From burst output, select the frame that best represents each state

### Workflow: Manual-Capture States
For states requiring continuous gestures (long-press hold, drag) or physical input (voice, sensor):
1. Navigate to the base page using `app_feature_verify.ts`
2. Print instructions for the user to manually perform the gesture
3. User runs burst capture in terminal while performing the gesture on device
4. User confirms capture is complete

### Output Directory Naming for State Captures
```
{platform}_page_{i}_{base_name}_state_{state_id}_{state_name}/
  screenshot_001.png
  view_001.xml
  state_context.md   (extracted from state_model.md)
```

### Selecting Representative Frames
After burst capture, compare consecutive frames by diffing their view tree XML:
- If `view_NNN.xml` differs significantly from `view_NNN-1.xml` (new nodes, visibility changes, text changes), it likely represents a state transition
- Select the first stable frame after a transition as the representative for that state

