visual-verdict
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<Purpose>
Use this skill to compare generated UI screenshots against one or more reference images and return a strict JSON verdict that can drive the next edit iteration.
</Purpose>
<Use_When>
- The task includes visual fidelity requirements (layout, spacing, typography, component styling)
- You have a generated screenshot and at least one reference image
- You need deterministic pass/fail guidance before continuing edits </Use_When>
<Output_Contract>
Return JSON only with this exact shape:
json
{
"score": 0,
"verdict": "revise",
"category_match": false,
"differences": ["..."],
"suggestions": ["..."],
"reasoning": "short explanation"
}Rules:
- : integer 0-100
score - : short status (
verdict,pass, orrevise)fail - :
category_matchwhen the generated screenshot matches the intended UI category/styletrue - : concrete visual mismatches (layout, spacing, typography, colors, hierarchy)
differences[] - : actionable next edits tied to the differences
suggestions[] - : 1-2 sentence summary
reasoning
<Threshold_And_Loop>
- Target pass threshold is 90+.
- If , continue editing and rerun
score < 90before any further code edits in the next iteration.$visual-verdict - Persist the verdict in with both:
.omx/state/{scope}/ralph-progress.json- numeric signal (, threshold pass/fail)
score - qualitative signal (,
reasoning,suggestions) </Threshold_And_Loop>next_actions
- numeric signal (
<Debug_Visualization>
When mismatch diagnosis is hard:
- Keep as the authoritative decision.
$visual-verdict - Use pixel-level diff tooling (pixel diff / pixelmatch overlay) as a secondary debug aid to localize hotspots.
- Convert pixel diff hotspots into concrete and
differences[]updates. </Debug_Visualization>suggestions[]
<用途>
使用此skill将生成的UI截图与一张或多张参考图像进行比对,并返回严格的JSON格式判定结果,可用于驱动下一轮编辑迭代。
</用途>
<适用场景>
- 任务包含视觉保真度要求(布局、间距、排版、组件样式)
- 你已持有生成的截图和至少一张参考图像
- 在继续编辑前需要确定性的通过/不通过指导 </适用场景>
<输入参数>
- (一张或多张图片路径)
reference_images[] - (当前输出图像)
generated_screenshot - 可选参数:(例如:
category_hint、hackernews、sns-feed) </输入参数>dashboard
<输出约定>
返回仅JSON格式内容,且严格遵循如下结构:
json
{
"score": 0,
"verdict": "revise",
"category_match": false,
"differences": ["..."],
"suggestions": ["..."],
"reasoning": "short explanation"
}规则说明:
- :取值为0-100的整数
score - :简短状态标识(可选值为
verdict、pass、revise)fail - :当生成的截图符合预期UI分类/风格时返回
category_matchtrue - :具体的视觉不匹配项(包含布局、间距、排版、颜色、层级等维度)
differences[] - :与不匹配项对应的可执行下一步编辑建议
suggestions[] - :1-2句话的结果总结说明
reasoning
<阈值与循环逻辑>
- 目标通过阈值为90分及以上。
- 如果,请先继续编辑并重新运行
score < 90,再开展下一轮的代码编辑工作。$visual-verdict - 请将判定结果持久化存储到中,需同时包含两类信息:
.omx/state/{scope}/ralph-progress.json- 量化信号(、阈值达标/未达标状态)
score - 定性信号(、
reasoning、suggestions) </阈值与循环逻辑>next_actions
- 量化信号(
<调试可视化>
当难以诊断不匹配问题时,可按如下步骤操作:
- 始终以的判定结果作为权威依据。
$visual-verdict - 使用像素级差异工具(像素diff / pixelmatch叠加层)作为次要调试辅助来定位问题区域。
- 将像素差异定位到的问题区域转化为具体的和
differences[]更新项。 </调试可视化>suggestions[]
<示例>
json
{
"score": 87,
"verdict": "revise",
"category_match": true,
"differences": [
"Top nav spacing is tighter than reference",
"Primary button uses smaller font weight"
],
"suggestions": [
"Increase nav item horizontal padding by 4px",
"Set primary button font-weight to 600"
],
"reasoning": "Core layout matches, but style details still diverge."
}</示例>