Visual Understanding – UI Design Analysis: Integrating Screenshot Understanding and Structured Output for Agents

Preface

When handling frontend or design-related tasks in Cursor, Claude Code, or OpenClaw, a common workflow involves the user dropping a UI screenshot and asking, “What’s wrong with this?”, “Extract the text,” or “How much does this differ from the design mockup?”. Relying solely on the conversation model to “look” at attachments often yields output that is too narrative and difficult for subsequent scripts or workflows to consume. On the other hand, integrating multimodal APIs manually involves handling compression, retries, JSON formatting, and credential configuration.

Below is an introduction to the SkillHub community Skill Visual Understanding - UI Design Analysis (coordinates @user_ae22680b/visual-ui-understander, current version 2.0.0). It uses a generic SKILL.md convention to define when the Agent should trigger, and calls Tencent Hunyuan multimodal capabilities via scripts/understand_image.py. It covers UI analysis, OCR, accessibility checks, and multi-image input, while supporting --json for structured results.

What is this

Visual Understanding - UI Design Analysis is a visual understanding Skill designed for Agents such as CodeBuddy / WorkBuddy / OpenClaw. It is maintained by community publisher user_ae22680b, categorized under design-media, and sourced from the community.

Skill Introduction (consistent with SkillHub search results): Enables AI Agents with visual understanding capabilities, supporting UI design analysis, text extraction, accessibility checks, multi-image analysis, and structured JSON output. The page sidebar marks requires_api_key=true, and it actually relies on Tencent Cloud keys and Hunyuan service activation (see configuration below).

On SkillHub, this Skill has a rating of 100000 and 1410 downloads (data at the time of scraping; installation count is 0).

Core Features

The following capabilities are derived from SKILL.md and references/usage_guide.md within the Skill package, and can be verified after installation via skillhub install.

Capability Description
UI Design Analysis --ui-analyze, can be combined with --json to return issues, summary, and highlights
Text Extraction (OCR) --ocr, JSON mode includes blocks and full_text
Accessibility Check --accessibility, outputs issues and pass_count / fail_count based on WCAG dimensions
Multi-image Input --images to pass multiple images accompanied by a natural language question (e.g., design mockup vs. implementation comparison)
General Q&A python scripts/understand_image.py <path> "<question>"
One-sentence Summary --summary, summarizes within approx. 50 characters, suitable for quick Agent notifications
Multi-turn Context --history to pass JSON conversation history, supporting follow-up questions
Image Preprocessing Scales down if the longest side exceeds 2048px, converts large images to JPG, reduces quality if size exceeds 2MB; includes retries for network timeouts and rate limiting

It underlyingly calls the Tencent Hunyuan multimodal interface (as stated in script comments and documentation). Errors are returned in the format ERROR:Type|Description to facilitate Agent parsing (e.g., AUTH_FAILED, QUOTA_EXHAUSTED, TIMEOUT).

Installation and Activation

1. Install SkillHub CLI

If not already installed, check or install the CLI according to the SkillHub official installation documentation:

command -v skillhub && skillhub --version

If not installed, you can execute (full installation, including default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Documentation: https://skillhub.cn/install/skillhub.md

2. Install this Skill to the current Agent’s skills directory

During installation, you must use --dir to point to the actual skills directory read by the current Agent; otherwise, it may default to ./skills/ and not be recognized.

The installation method provided on the SkillHub skill page is: Follow the above installation documentation to install @user_ae22680b/visual-ui-understander. The equivalent command from CLI search results is:

skillhub install visual-ui-understander --namespace user_ae22680b --dir <your skills directory>

Common skills paths for various environments (excerpted from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex CLI: ~/.codex/skills/ or .agents/skills/ under the project
  • WorkBuddy: ~/.workbuddy/skills/

After installation is complete, restart or reload the Agent according to your client’s requirements to enable the Skill.

3. Python Dependencies and Tencent Cloud Credentials

Navigate to the Skill installation directory (e.g., .../@user_ae22680b/visual-ui-understander) and install script dependencies:

pip install tencentcloud-sdk-python Pillow

Pillow is used for compression and format conversion; if not installed, the documentation states that the compression step will be skipped.

Configure in a .env file or system environment variables within the Skill directory:

TENCENTCLOUD_SECRET_ID=your_SecretId
TENCENTCLOUD_SECRET_KEY=your_SecretKey

And activate the service at the Hunyuan Large Model Console, granting QcloudHunyuanFullAccess to the key. Keys can be created at Tencent Cloud API Key Management.

The OpenClaw metadata in SKILL.md marks TENCENTCLOUD_SECRET_ID as primaryEnv, consistent with the requires_api_key tag.

Typical Usage

The following commands are executed in the Skill root directory, with scripts/understand_image.py as the entry point.

UI Design Analysis (Recommended JSON mode for Agents):

python scripts/understand_image.py --ui-analyze --json screenshot.png

Extract text from image:

python scripts/understand_image.py --ocr --json receipt.jpg

Accessibility (a11y) Check:

python scripts/understand_image.py --accessibility --json page.png

Multi-image Comparison or Process Analysis:

python scripts/understand_image.py --images design.png actual.png "How is the fidelity?"

Follow-up question with history:

python scripts/understand_image.py screenshot.png "What about that button on the right?" \
  --history '[{"role":"user","content":"What UI issues are in this image?"},{"role":"assistant","content":"..."}]'

Reproducible workflow for the Agent side (from the official usage guide):

  1. User sends a screenshot and asks about UI issues → Confirm file path → Execute --ui-analyze --json → Parse issues and display by severity.
  2. User provides multiple screenshots asking about common issues → Use --images with a natural language question → Summarize the model’s answer.
  3. User needs text from the image for subsequent processing → --ocr --json → Take full_text and pass to downstream steps.

Trigger keywords are listed in SKILL.md, such as “screenshot”, “UI”, “OCR”, “compare”, “accessibility / a11y”, etc., facilitating Agent routing to this Skill.

Scenarios and Notes

Who it is for

  • Those who need stable, scriptable screenshot analysis within Agent workflows, rather than a single chat-style description.
  • Frontend / Design collaboration: UI review, alignment of design mockups with implementation, rough accessibility checks for Mini Programs or Web, receipt or interface OCR.
  • Teams that already have or can apply for a Tencent Cloud Hunyuan account and API quota.

Limitations and Notes

  1. Must configure keys and activate Hunyuan; if not configured, the script will return clear errors like AUTH_FAILED.
  2. Multi-image mode: Documentation specifies that currently the first image is used for visual analysis, while other images are passed via text description; if fine-grained analysis per image is required, calls should be made separately.
  3. Format and Size: Supports common formats like PNG, JPG, WebP. Before uploading, images are compressed to a longest side ≤ 2048px and size ≤ 2MB.
  4. Cost and Quota: Calls go through the Hunyuan API; attention must be paid to console balance and QUOTA_EXHAUSTED type errors.
  5. The Skill is described for ecosystems like CodeBuddy / WorkBuddy / OpenClaw; when used in clients like Cursor, installation paths and restart behaviors should follow their respective documentation, while the command-line part is identical to the instructions within the Skill package.

Conclusion

Visual Understanding - UI Design Analysis converges “looking at screenshots” into an Agent-executable CLI: combining --ui-analyze, --ocr, --accessibility, and --json makes it easy to integrate UI review, text extraction, and accessibility checks into automated workflows. For installation and priority source configuration, see https://skillhub.cn/install/skillhub.md; for Skill details and installation tips, see https://www.skillhub.cn/skills/user_ae22680b/visual-ui-understander or https://api.skillhub.cn/user_ae22680b/visual-ui-understander.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye