name: "QmlPreviewer" description: "Auto-detects the active QML file from editor context, runs qmlscene, and copies the rendered image to the clipboard by default. Invoke proactively when the agent needs to preview or visually verify a QML UI."
QML Previewer
Use this skill whenever the agent needs to preview or visually verify a QML UI. Prefer the clipboard capture flow by default, and fall back to launching qmlscene directly when capture is unavailable or unsuitable.
When To Use
Invoke this skill proactively when any of the following is true:
- The agent needs to preview the active QML file to understand the visual result.
- The agent needs to visually verify QML changes it just made or reviewed.
- The agent needs screenshot-based evidence to inspect layout, rendering, clipping, or missing assets.
- The agent needs to confirm whether a QML page loads successfully.
- Visual verification is needed even if the user did not explicitly ask for a preview.
Capabilities
- Auto Detection: Resolve the active QML file from editor context.
- Clipboard Preview: Run the capture script and copy the rendered result to the clipboard.
- Direct Launch: Fall back to
qmlscenewhen clipboard capture is unavailable or unsuitable. - Visual Verification: Report whether the page loads and whether obvious visual problems are present.
- Failure Reporting: Surface path issues, launch failures, and runtime errors.
Critical Rules
These rules are always enforced. Follow them in this order.
File Resolution
- Prefer the active editor file when it is a
.qmlfile. - If multiple files are open, use the focused editor tab.
- If editor context is missing, search for the most relevant recently edited
.qmlfile. - If auto-detection still fails, ask the user once for the QML file path.
Preview Execution
- Use the clipboard capture flow by default.
- Pass absolute paths only for both
qmlscene.exeand the QML file. - Use the direct
qmlscenelaunch only as a fallback when capture is unavailable or unsuitable. - Do not silently skip preview. If preview cannot run, explain why.
Reporting
- Report whether the QML page loads successfully.
- Report obvious layout or rendering issues such as clipping, blank content, missing assets, or unexpected sizing.
- Include runtime or terminal errors when QML fails to launch.
- Be explicit about which flow was used: clipboard capture or direct launch.
Execution Workflow
- Resolve the QML file path from editor context.
- Validate that the QML file path is absolute and exists.
- Resolve the absolute path to
qmlscene.exe. - Run the default clipboard capture flow:
& "<SKILL_DIR>\capture_qmlscene_to_clipboard.ps1" -QmlScenePath "<qmlscene.exe>" -QmlFilePath "<auto-detected absolute QML file path>"
- If clipboard capture is unavailable or unsuitable, launch the page directly:
& "<qmlscene.exe>" "<auto-detected absolute QML file path>" --maximized
- Inspect the clipboard image or live preview.
- Report load status, visible issues, and any runtime failures.
Fallback Workflow
Use this fallback order:
- If clipboard capture fails, verify both paths and retry only if the failure is clearly path-related.
- If capture remains unsuitable, launch the page directly with
qmlscene. - If auto-detection fails, ask once for the QML file path, then continue.
- If QML cannot load, capture terminal or runtime error output and include it in the report.
Response Policy
When using this skill in an answer:
- State which QML file was previewed.
- State which execution flow was used.
- Report whether the page loaded successfully.
- Summarize obvious visual findings.
- Include launch or runtime errors when present.
- State what blocked verification if preview could not be completed.
Quick Reference
# Default clipboard capture flow
& "<SKILL_DIR>\capture_qmlscene_to_clipboard.ps1" -QmlScenePath "<qmlscene.exe>" -QmlFilePath "<absolute QML file path>"
# Direct qmlscene fallback
& "<qmlscene.exe>" "<absolute QML file path>" --maximized
Current Skill Context
The skill currently depends on:
<SKILL_DIR>\SKILL.md
<SKILL_DIR>\capture_qmlscene_to_clipboard.ps1
The capture script currently supports:
- Required
-QmlScenePath - Required
-QmlFilePath - Optional
-StartupDelayMs - Optional
-WindowPollTimeoutMs - Optional
-WindowPollIntervalMs - Optional
-KeepOpen
Detailed References
capture_qmlscene_to_clipboard.ps1- default preview and clipboard capture entrypointqmlscene.exe- fallback runtime for direct QML preview