agentleFS
mengpsmengps/HuskarUI/.agents/skills/qmlpreviewer/SKILL.md

QmlPreviewer

Skill605 starsChanged 28 days agoMITView on GitHub

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.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    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:

    Use this skill whenever the agent needs to preview or visually verify a QML UI.

    line 8
  2. Distinctive:

    Clipboard Preview: Run the capture script and copy the rendered result to the clipboard.

    line 23
  3. Very specific:

    Use the direct qmlscene launch only as a fallback: when capture is unavailable or unsuitable.

    line 43
  4. Distinctive:

    Do not silently skip preview: If preview cannot run, explain why.

    line 44
  5. Distinctive:

    Include runtime or terminal errors: when QML fails to launch.

    line 50
  6. Distinctive:

    Run the default clipboard capture flow:

    line 58
  7. Distinctive:

    If clipboard capture is unavailable or unsuitable, launch the page directly:

    line 64
  8. Distinctive:

    Use this fallback order:

    line 75
  9. Distinctive:

    If clipboard capture fails, verify both paths and retry only if the failure is clearly path-related.

    line 77
  10. Very specific:

    If capture remains unsuitable, launch the page directly with qmlscene.

    line 78
  11. Distinctive:

    If auto-detection fails, ask once for the QML file path, then continue.

    line 79
  12. Distinctive:

    If QML cannot load, capture terminal or runtime error output and include it in the report.

    line 80
  13. Distinctive:

    When using this skill in an answer:

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

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:

  1. The agent needs to preview the active QML file to understand the visual result.
  2. The agent needs to visually verify QML changes it just made or reviewed.
  3. The agent needs screenshot-based evidence to inspect layout, rendering, clipping, or missing assets.
  4. The agent needs to confirm whether a QML page loads successfully.
  5. Visual verification is needed even if the user did not explicitly ask for a preview.

Capabilities

  1. Auto Detection: Resolve the active QML file from editor context.
  2. Clipboard Preview: Run the capture script and copy the rendered result to the clipboard.
  3. Direct Launch: Fall back to qmlscene when clipboard capture is unavailable or unsuitable.
  4. Visual Verification: Report whether the page loads and whether obvious visual problems are present.
  5. 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 .qml file.
  • If multiple files are open, use the focused editor tab.
  • If editor context is missing, search for the most relevant recently edited .qml file.
  • 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.exe and the QML file.
  • Use the direct qmlscene launch 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

  1. Resolve the QML file path from editor context.
  2. Validate that the QML file path is absolute and exists.
  3. Resolve the absolute path to qmlscene.exe.
  4. Run the default clipboard capture flow:
& "<SKILL_DIR>\capture_qmlscene_to_clipboard.ps1" -QmlScenePath "<qmlscene.exe>" -QmlFilePath "<auto-detected absolute QML file path>"
  1. If clipboard capture is unavailable or unsuitable, launch the page directly:
& "<qmlscene.exe>" "<auto-detected absolute QML file path>" --maximized
  1. Inspect the clipboard image or live preview.
  2. Report load status, visible issues, and any runtime failures.

Fallback Workflow

Use this fallback order:

  1. If clipboard capture fails, verify both paths and retry only if the failure is clearly path-related.
  2. If capture remains unsuitable, launch the page directly with qmlscene.
  3. If auto-detection fails, ask once for the QML file path, then continue.
  4. 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:

  1. State which QML file was previewed.
  2. State which execution flow was used.
  3. Report whether the page loaded successfully.
  4. Summarize obvious visual findings.
  5. Include launch or runtime errors when present.
  6. 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 entrypoint
  • qmlscene.exe - fallback runtime for direct QML preview

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.